forked from AversivePlusPlus/AversivePlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
74 lines (53 loc) · 1.85 KB
/
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.PHONY: all update doc
export CONAN ?= $(PWD)/tools/bin/conan
MODULES = base container device device-2wheel device-control filter sasiae stream feetech fs string coap
THIRDPARTY = arduino cmsis-core cmsis-stm32f4xx stm32cube-hal-stm32f4xx qt5 teensy riot/riot riot/stream-riot
TOOLCHAINS = avr generic simul stm32 switch
HAL = device-hal hal hal-atmegaxx0_1 hal-stm32cubef4 hal-switch hdl-atmegaxx0_1 memory_mapping stream-hal
################################
all:
@echo "Usage: make {export,test,clean,mrpoper}"
################################
define MAKE_RULE
$(3): $(3)_$(1)
$(3)_$(1):
@cd $(2)/$(1) && $(MAKE) -s $(3)
endef
################################
export:
@$(CONAN) export AversivePlusPlus/dev
define CONAN_EXPORT_RULE
export: export_$(1)
export_$(1):
@cd $(2)/$(1) && $(CONAN) export AversivePlusPlus/dev
endef
$(foreach m,$(MODULES),$(eval $(call MAKE_RULE,$(m),modules,export)))
$(foreach m,$(THIRDPARTY),$(eval $(call CONAN_EXPORT_RULE,$(m),modules/thirdparty)))
$(foreach m,$(HAL),$(eval $(call CONAN_EXPORT_RULE,$(m),modules/hal)))
$(foreach m,$(TOOLCHAINS),$(eval $(call CONAN_EXPORT_RULE,$(m),toolchains)))
$(eval $(call CONAN_EXPORT_RULE,toolchain,cmake))
################################
clean:
@rm -rf build
$(foreach m,$(MODULES),$(eval $(call MAKE_RULE,$(m),modules,clean)))
mrproper:
@rm -f *~
@rm -f *.pyc
$(foreach m,$(MODULES),$(eval $(call MAKE_RULE,$(m),modules,mrproper)))
################################
test:
@rm -rf build
test: test_template-project
test_template-project:
@cd examples/template-project && $(MAKE) -s
test: test_project-2wheel-asserv
test_project-2wheel-asserv:
@cd examples/project-2wheel-asserv && $(MAKE) -s
$(foreach m,$(MODULES),$(eval $(call MAKE_RULE,$(m),modules,test)))
################################
update:
git submodule update --init
################################
doc:
@mkdir build -p
@doxygen