-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
37 lines (28 loc) · 929 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
# Since includes may make targets, add a proxy default rule first
default: all
include make/once.mk
# Include all buildconfigs to get all apps and test fixtures
include make/targets/*.mk
include make/verbosity.mk
# Filter out all input .elf files and generate hex variant of it
hexapp=$(patsubst %.elf,%.hex,$(filter %.elf,$(1)))
# Some apps may be .elf, should also have a .hex variant
ALLAPPS=$(APPS) $(call hexapp,$(APPS))
all: $(APPS:.elf=.hex)
# For verbosity
APP=""
help: FORCE
@echo " Build all apps: make"
@echo " Clean all build files: make clean"
# Both *.elf and *.hex is built when building the elf version as hex
define TARGET_BUILD
$(target) $(call hexapp,$(target)): FORCE
$(Q)$$(MAKE) $(MAKE_FLAGS) -f make/target.mk $(target:elf=hex) APP=$(target)
endef
$(foreach target,$(APPS),$(eval $(TARGET_BUILD)))
clean: FORCE
rm -rf build
rm -rf reports
rm -rf $(ALLAPPS)
FORCE:
.PHONY: FORCE