amiro-os / devices / LightRing / Makefile @ ba75ee1d
History | View | Annotate | Download (6.827 KB)
1 | 58fe0e0b | Thomas Schöpping | ############################################################################## |
---|---|---|---|
2 | # Build global options |
||
3 | # NOTE: Can be overridden externally. |
||
4 | # |
||
5 | |||
6 | # Compiler options here. |
||
7 | ifeq ($(USE_OPT),) |
||
8 | USE_OPT = -O2 -fomit-frame-pointer -falign-functions=16 -DCHPRINTF_USE_FLOAT=1 -fstack-usage -DSERIAL_BUFFERS_SIZE=64 |
||
9 | endif |
||
10 | |||
11 | # C specific options here (added to USE_OPT). |
||
12 | ifeq ($(USE_COPT),) |
||
13 | USE_COPT = |
||
14 | endif |
||
15 | |||
16 | # C++ specific options here (added to USE_OPT). |
||
17 | ifeq ($(USE_CPPOPT),) |
||
18 | USE_CPPOPT = -fno-rtti -fno-exceptions -std=c++11 -U__STRICT_ANSI__ |
||
19 | endif |
||
20 | |||
21 | # Enable this if you want the linker to remove unused code and data |
||
22 | ifeq ($(USE_LINK_GC),) |
||
23 | USE_LINK_GC = yes |
||
24 | endif |
||
25 | |||
26 | # Linker extra options here. |
||
27 | ifeq ($(USE_LDOPT),) |
||
28 | USE_LDOPT = |
||
29 | endif |
||
30 | |||
31 | # Enable this if you want link time optimizations (LTO) |
||
32 | ifeq ($(USE_LTO),) |
||
33 | USE_LTO = no |
||
34 | endif |
||
35 | |||
36 | # If enabled, this option allows to compile the application in THUMB mode. |
||
37 | ifeq ($(USE_THUMB),) |
||
38 | USE_THUMB = yes |
||
39 | endif |
||
40 | |||
41 | # Enable this if you want to see the full log while compiling. |
||
42 | ifeq ($(USE_VERBOSE_COMPILE),) |
||
43 | USE_VERBOSE_COMPILE = no |
||
44 | endif |
||
45 | |||
46 | # |
||
47 | # Build global options |
||
48 | ############################################################################## |
||
49 | |||
50 | ############################################################################## |
||
51 | # Architecture or project specific options |
||
52 | # |
||
53 | |||
54 | # Enable this if you really want to use the STM FWLib. |
||
55 | ifeq ($(USE_FWLIB),) |
||
56 | USE_FWLIB = no |
||
57 | endif |
||
58 | |||
59 | # |
||
60 | # Architecture or project specific options |
||
61 | ############################################################################## |
||
62 | |||
63 | ############################################################################## |
||
64 | # Project, sources and paths |
||
65 | # |
||
66 | |||
67 | # Define project name here |
||
68 | PROJECT = LightRing |
||
69 | |||
70 | # Imported source files and paths |
||
71 | CHIBIOS = ../../../ChibiOS |
||
72 | AMIRO = ../.. |
||
73 | include $(AMIRO)/boards/LightRing/board.mk |
||
74 | include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk |
||
75 | include $(CHIBIOS)/os/hal/hal.mk |
||
76 | include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F1xx/port.mk |
||
77 | include $(CHIBIOS)/os/kernel/kernel.mk |
||
78 | include $(CHIBIOS)/os/various/cpp_wrappers/kernel.mk |
||
79 | |||
80 | # Define linker script file here |
||
81 | LDSCRIPT= $(BOARDLD)/STM32F103xE.ld |
||
82 | |||
83 | # C sources that can be compiled in ARM or THUMB mode depending on the global |
||
84 | # setting. |
||
85 | CSRC = $(PORTSRC) \ |
||
86 | $(KERNSRC) \ |
||
87 | $(HALSRC) \ |
||
88 | $(PLATFORMSRC) \ |
||
89 | $(BOARDSRC) \ |
||
90 | $(CHIBIOS)/os/various/evtimer.c \ |
||
91 | $(CHIBIOS)/os/various/syscalls.c \ |
||
92 | $(CHIBIOS)/os/various/chprintf.c \ |
||
93 | $(CHIBIOS)/os/various/shell.c \ |
||
94 | $(CHIBIOS)/os/various/memstreams.c \ |
||
95 | $(AMIRO)/stubs.c \ |
||
96 | $(AMIRO)/components/Debug.c |
||
97 | |||
98 | # C++ sources that can be compiled in ARM or THUMB mode depending on the global |
||
99 | # setting. |
||
100 | CPPSRC = $(CHCPPSRC) \ |
||
101 | $(AMIRO)/components/Color.cpp \ |
||
102 | $(AMIRO)/components/bus/spi/HWSPIDriver.cpp \ |
||
103 | $(AMIRO)/components/bus/i2c/HWI2CDriver.cpp \ |
||
104 | $(AMIRO)/components/leds/tlc5947.cpp \ |
||
105 | $(AMIRO)/components/radio/a2500r24a.cpp \ |
||
106 | $(AMIRO)/components/eeprom/eeprom.cpp \ |
||
107 | $(AMIRO)/components/eeprom/at24.cpp \ |
||
108 | $(AMIRO)/components/FileSystemInputOutput/FileSystemInputOutputBase.cpp \ |
||
109 | $(AMIRO)/components/FileSystemInputOutput/FSIOLightRing.cpp \ |
||
110 | $(AMIRO)/components/ControllerAreaNetworkRx.cpp \ |
||
111 | $(AMIRO)/components/ControllerAreaNetworkTx.cpp \ |
||
112 | $(AMIRO)/components/Lidar.cpp \ |
||
113 | $(AMIRO)/components/serial_reset/serial_can_mux.cpp \ |
||
114 | LightRing.cpp \ |
||
115 | userthread.cpp \ |
||
116 | main.cpp \ |
||
117 | exti.cpp |
||
118 | |||
119 | # C sources to be compiled in ARM mode regardless of the global setting. |
||
120 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
||
121 | # option that results in lower performance and larger code size. |
||
122 | ACSRC = |
||
123 | |||
124 | # C++ sources to be compiled in ARM mode regardless of the global setting. |
||
125 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
||
126 | # option that results in lower performance and larger code size. |
||
127 | ACPPSRC = |
||
128 | |||
129 | # C sources to be compiled in THUMB mode regardless of the global setting. |
||
130 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
||
131 | # option that results in lower performance and larger code size. |
||
132 | TCSRC = |
||
133 | |||
134 | # C sources to be compiled in THUMB mode regardless of the global setting. |
||
135 | # NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
||
136 | # option that results in lower performance and larger code size. |
||
137 | TCPPSRC = |
||
138 | |||
139 | # List ASM source files here |
||
140 | ASMSRC = $(PORTASM) |
||
141 | |||
142 | INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ |
||
143 | $(HALINC) $(PLATFORMINC) $(BOARDINC) \ |
||
144 | $(CHCPPINC) \ |
||
145 | $(CHIBIOS)/os/various \ |
||
146 | $(AMIRO) \ |
||
147 | $(AMIRO)/include |
||
148 | |||
149 | # |
||
150 | # Project, sources and paths |
||
151 | ############################################################################## |
||
152 | |||
153 | ############################################################################## |
||
154 | # Compiler settings |
||
155 | # |
||
156 | |||
157 | MCU = cortex-m3 |
||
158 | |||
159 | #TRGT = arm-elf- |
||
160 | TRGT = arm-none-eabi- |
||
161 | CC = $(TRGT)gcc |
||
162 | CPPC = $(TRGT)g++ |
||
163 | # Enable loading with g++ only if you need C++ runtime support. |
||
164 | # NOTE: You can use C++ even without C++ support if you are careful. C++ |
||
165 | # runtime support makes code size explode. |
||
166 | #LD = $(TRGT)gcc |
||
167 | LD = $(TRGT)g++ |
||
168 | CP = $(TRGT)objcopy |
||
169 | AS = $(TRGT)gcc -x assembler-with-cpp |
||
170 | OD = $(TRGT)objdump |
||
171 | SZ = $(TRGT)size |
||
172 | HEX = $(CP) -O ihex |
||
173 | BIN = $(CP) -O binary |
||
174 | SREC = $(CP) -O srec --srec-len=248 |
||
175 | |||
176 | # ARM-specific options here |
||
177 | AOPT = |
||
178 | |||
179 | # THUMB-specific options here |
||
180 | TOPT = -mthumb -DTHUMB |
||
181 | |||
182 | # Define C warning options here |
||
183 | CWARN = -Wall -Wextra -Wstrict-prototypes |
||
184 | |||
185 | # Define C++ warning options here |
||
186 | CPPWARN = -Wall -Wextra |
||
187 | |||
188 | # |
||
189 | # Compiler settings |
||
190 | ############################################################################## |
||
191 | |||
192 | ############################################################################## |
||
193 | # Start of default section |
||
194 | # |
||
195 | |||
196 | # List all default C defines here, like -D_DEBUG=1 |
||
197 | DDEFS = |
||
198 | |||
199 | # List all default ASM defines here, like -D_DEBUG=1 |
||
200 | DADEFS = |
||
201 | |||
202 | # List all default directories to look for include files here |
||
203 | DINCDIR = |
||
204 | |||
205 | # List the default directory to look for the libraries here |
||
206 | DLIBDIR = |
||
207 | |||
208 | # List all default libraries here |
||
209 | DLIBS = |
||
210 | |||
211 | # |
||
212 | # End of default section |
||
213 | ############################################################################## |
||
214 | |||
215 | ############################################################################## |
||
216 | # Start of user section |
||
217 | # |
||
218 | |||
219 | # List all user C define here, like -D_DEBUG=1 |
||
220 | UDEFS = |
||
221 | |||
222 | # Define ASM defines here |
||
223 | UADEFS = |
||
224 | |||
225 | # List all user directories here |
||
226 | UINCDIR = |
||
227 | |||
228 | # List the user directory to look for the libraries here |
||
229 | ULIBDIR = |
||
230 | |||
231 | # List all user libraries here |
||
232 | ULIBS = |
||
233 | |||
234 | # |
||
235 | # End of user defines |
||
236 | ############################################################################## |
||
237 | |||
238 | ifeq ($(USE_FWLIB),yes) |
||
239 | include $(CHIBIOS)/ext/stm32lib/stm32lib.mk |
||
240 | CSRC += $(STM32SRC) |
||
241 | INCDIR += $(STM32INC) |
||
242 | USE_OPT += -DUSE_STDPERIPH_DRIVER |
||
243 | endif |
||
244 | |||
245 | RULESPATH = $(CHIBIOS)/os/ports/GCC/ARMCMx |
||
246 | include $(RULESPATH)/rules.mk |
||
247 | |||
248 | include $(AMIRO)/ports/rules.mk |
||
249 | include $(AMIRO)/devices/flash.mk |