forked from gkostka/lwext4
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
84 lines (56 loc) · 1.53 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
75
76
77
78
79
80
81
82
83
84
#Release
#Debug
BUILD_TYPE = Release
ifneq ($(shell test -d .git), 0)
GIT_SHORT_HASH:= $(shell git rev-parse --short HEAD)
endif
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_PATCH = 0
VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_PATCH)-$(GIT_SHORT_HASH)
COMMON_DEFINITIONS = \
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) \
-DVERSION_MAJOR=$(VERSION_MAJOR) \
-DVERSION_MINOR=$(VERSION_MINOR) \
-DVERSION_PATCH=$(VERSION_PATCH) \
-DVERSION=$(VERSION) \
define generate_common
rm -R -f build_$(1)
mkdir build_$(1)
cd build_$(1) && cmake -G"Unix Makefiles" \
$(COMMON_DEFINITIONS) \
$(2) \
-DCMAKE_TOOLCHAIN_FILE=../toolchain/$(1).cmake ..
endef
generic:
$(call generate_common,$@)
cortex-m0:
$(call generate_common,$@)
cortex-m0+:
$(call generate_common,$@)
cortex-m3:
$(call generate_common,$@)
cortex-m4:
$(call generate_common,$@)
cortex-m4f:
$(call generate_common,$@)
cortex-m7:
$(call generate_common,$@)
arm-sim:
$(call generate_common,$@)
avrxmega7:
$(call generate_common,$@)
msp430:
$(call generate_common,$@)
mingw:
$(call generate_common,$@,-DWIN32=1)
lib_only:
rm -R -f build_lib_only
mkdir build_lib_only
cd build_lib_only && cmake $(COMMON_DEFINITIONS) -DLIB_ONLY=TRUE ..
all:
generic
clean:
rm -R -f build_*
rm -R -f ext_images
include fs_test.mk