-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
37 lines (29 loc) · 878 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
build_target = NUCLEO_F401RE
build_toolchain = GCC_ARM
build_dir = BUILD/$(board)
project_name = firmware-launch
outdir = out/
outname = $(board).bin
outpath = $(outdir)$(outname)
FLATC = general/flatc
OS := $(shell uname)
ifeq ($(OS), Darwin)
FLATC = general/flatc_mac
endif
validate:
ifndef board
$(error Board is not set to one of: bb, gs, fc, tpc)
endif
build: validate msg_downlink_generated.h msg_uplink_generated.h msg_fc_update_generated.h
time mbed compile --target $(build_target) --toolchain $(build_toolchain) -D$(board) --build $(build_dir) \
&& mkdir -p $(outdir) && cp $(build_dir)/$(project_name).bin $(outpath) \
&& echo "Copied output to $(outpath)"
flash: validate
st-flash write $(outpath) 0x8000000
%_generated.h: general/%.fbs
$(FLATC) --cpp $<
build-all:
make build board=bb
make build board=fc
make build board=gs
make build board=tpc