-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
94 lines (70 loc) · 2.22 KB
/
Makefile
File metadata and controls
94 lines (70 loc) · 2.22 KB
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
85
86
87
88
89
90
91
92
93
94
#Release
#Debug
BUILD_TYPE = Release
ifneq ($(shell test -d .git), 0)
GIT_SHORT_HASH:= $(shell git rev-parse --short HEAD)
endif
VERSION_MAJOR = 0
VERSION_MINOR = 9
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) \
generic:
rm -R -f build_generic
mkdir build_generic
cd build_generic && cmake -G"Unix Makefiles" \
$(COMMON_DEFINITIONS) \
-DCMAKE_TOOLCHAIN_FILE=../toolchain/generic.cmake ..
cortex-m0:
rm -R -f build_cortex-m0
mkdir build_cortex-m0
cd build_cortex-m0 && cmake -G"Unix Makefiles" \
$(COMMON_DEFINITIONS) \
-DCMAKE_TOOLCHAIN_FILE=../toolchain/cortex-m0.cmake ..
cortex-m3:
rm -R -f build_cortex-m3
mkdir build_cortex-m3
cd build_cortex-m3 && cmake -G"Unix Makefiles" \
$(COMMON_DEFINITIONS) \
-DCMAKE_TOOLCHAIN_FILE=../toolchain/cortex-m3.cmake ..
cortex-m4:
rm -R -f build_cortex-m4
mkdir build_cortex-m4
cd build_cortex-m4 && cmake -G"Unix Makefiles" \
$(COMMON_DEFINITIONS) \
-DCMAKE_TOOLCHAIN_FILE=../toolchain/cortex-m4.cmake ..
xcode:
rm -R -f xcode
mkdir xcode
cd xcode && cmake -G"Xcode" \
$(COMMON_DEFINITIONS) ..
eclipse:
rm -R -f build
mkdir build
cd build && cmake -G"Eclipse CDT4 - Unix Makefiles" \
$(COMMON_DEFINITIONS) ..
visual:
rm -R -f visualstudio
mkdir visualstudio
cd visualstudio && cmake -G”Visual Studio 10 Win64" \
$(COMMON_DEFINITIONS) ..
lib_only:
rm -R -f build_lib_only
mkdir build_lib_only
cd build_lib_only && cmake $(COMMON_DEFINITIONS) -DLIB_ONLY=TRUE ..
doc:
rm -R -f doc
mkdir doc
doxygen DoxyFile
all: generic cortex-m0 cortex-m3 cortex-m4 lib_only doc
clean:
rm -R -f build_*
rm -R -f ext_images
unpack_images:
rm -R -f ext_images
7z x ext_images.7z