-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
72 lines (62 loc) · 1.97 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
# This Makefile acts as a composite builder for all the elements
# of this repository.
# It has target patterns for all, clean and test for sub-directories of the
# form dir.target e.g. calling:
#
# xmake app_uart_demo.all
#
# will execute 'xmake all' in the app_uart_demo sub-directory.
#
# In addition the following targets are defined:
#
# all:
#
# This target will build all the applications listed in the BUILD_SUBDIRS
# variable.
#
# plugins:
#
# This target will build all the plugins listed in the PLUGIN_SUBDIRS
# variable
#
# clean:
#
# This target will clean all the applications listed in the BUILD_SUBDIRS
# variable.
#
# clean_plugins:
#
# This target will clean all the plugins listed in the PLUGIN_SUBDIRS
# variable.
#
# test:
#
# This target will make the test make target in all the directories
# listed in TEST_SUBDIRS.
#
TLWARN = $$(warning Source file $1 in top level will not be built)
$(foreach x,$(wildcard *.xc) $(wildcard *.c) $(wildcard *.cpp) $(wildcard *.h) $(wildcard *.S),$(eval $(call TLWARN,$x)))
# This variable should contain a space separated list of all
# the directories containing buildable applications (usually
# prefixed with the app_ prefix)
BUILD_SUBDIRS = app_flashlib_example
# This variable should contain a space separated list of all
# the directories containing buildable plugins (usually
# prefixed with the plugin_ prefix)
PLUGIN_SUBDIRS =
# This variable should contain a space separated list of all
# the directories containing applications with a 'test' make target
TEST_SUBDIRS =
# Provided that the above variables are set you shouldn't need to modify
# the targets below here.
%.all:
cd $* && xmake all
%.clean:
cd $* && xmake clean
%.test:
cd $* && xmake test
all: $(foreach x, $(BUILD_SUBDIRS), $x.all)
plugins: $(foreach x, $(PLUGIN_SUBDIRS), $x.all)
clean: $(foreach x, $(BUILD_SUBDIRS), $x.clean)
clean_plugins: $(foreach x, $(PLUGIN_SUBDIRS), $x.clean)
test: $(foreach x, $(TEST_SUBDIRS), $x.test)