Revision 732a4657 modules/DiWheelDrive_1-1/Makefile
modules/DiWheelDrive_1-1/Makefile | ||
---|---|---|
43 | 43 |
USE_CPPOPT = -fno-rtti -std=c++17 |
44 | 44 |
endif |
45 | 45 |
|
46 |
# Enable this if you want the linker to remove unused code and data |
|
46 |
# Enable this if you want the linker to remove unused code and data.
|
|
47 | 47 |
ifeq ($(USE_LINK_GC),) |
48 | 48 |
USE_LINK_GC = yes |
49 | 49 |
endif |
... | ... | |
53 | 53 |
USE_LDOPT = |
54 | 54 |
endif |
55 | 55 |
|
56 |
# Enable this if you want link time optimizations (LTO) |
|
56 |
# Enable this if you want link time optimizations (LTO).
|
|
57 | 57 |
ifeq ($(USE_LTO),) |
58 | 58 |
USE_LTO = yes |
59 | 59 |
endif |
60 | 60 |
|
61 |
# If enabled, this option allows to compile the application in THUMB mode. |
|
62 |
ifeq ($(USE_THUMB),) |
|
63 |
USE_THUMB = yes |
|
64 |
endif |
|
65 |
|
|
66 | 61 |
# Enable this if you want to see the full log while compiling. |
67 | 62 |
ifeq ($(USE_VERBOSE_COMPILE),) |
68 | 63 |
USE_VERBOSE_COMPILE = no |
... | ... | |
94 | 89 |
USE_EXCEPTIONS_STACKSIZE = 0x400 |
95 | 90 |
endif |
96 | 91 |
|
97 |
# Enables the use of FPU on Cortex-M4.
|
|
92 |
# Enables the use of FPU. |
|
98 | 93 |
# Possible selections are: |
99 | 94 |
# no - no FPU is used (probably equals 'soft') |
100 | 95 |
# soft - does not use the FPU, thus all floating point operations are emulated |
... | ... | |
104 | 99 |
USE_FPU = no |
105 | 100 |
endif |
106 | 101 |
|
102 |
# FPU-related options. |
|
103 |
ifeq ($(USE_FPU_OPT),) |
|
104 |
USE_FPU_OPT = -mfloat-abi=$(USE_FPU) -mfpu=fpv4-sp-d16 |
|
105 |
endif |
|
106 |
|
|
107 | 107 |
# # |
108 | 108 |
# Architecture or project specific options # |
109 | 109 |
################################################################################ |
110 | 110 |
|
111 | 111 |
################################################################################ |
112 |
# Project, sources and paths #
|
|
112 |
# Project, target, sources and paths #
|
|
113 | 113 |
# # |
114 | 114 |
|
115 | 115 |
# Define project name here |
116 | 116 |
PROJECT := $(patsubst $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))..)/%,%,$(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))) |
117 | 117 |
|
118 |
# Imported source files and paths |
|
118 |
# Target settings. |
|
119 |
MCU = cortex-m3 |
|
120 |
|
|
121 |
# Imported source files and paths. |
|
119 | 122 |
include ../../kernel/kernel.mk |
120 |
CHIBIOS := $(AMIROOS_KERNEL) |
|
121 |
AMIROOS = ../.. |
|
122 |
# Licensing files |
|
123 |
CHIBIOS := $(AMIROOS_KERNEL) |
|
124 |
CONFDIR := . |
|
125 |
ifeq ($(BUILDDIR),) |
|
126 |
BUILDDIR := ./build |
|
127 |
endif |
|
128 |
DEPDIR := $(dir $(BUILDDIR)).dep |
|
129 |
AMIROOS := ../.. |
|
130 |
# Licensing files. |
|
123 | 131 |
include $(CHIBIOS)/os/license/license.mk |
124 |
# Startup files |
|
132 |
# Startup files.
|
|
125 | 133 |
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk |
126 |
# HAL-OSAL files |
|
134 |
# HAL-OSAL files (optional).
|
|
127 | 135 |
include $(CHIBIOS)/os/hal/hal.mk |
128 | 136 |
include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk |
129 | 137 |
include $(CHIBIOS)/os/hal/osal/rt/osal.mk |
130 |
# RTOS files |
|
138 |
# RTOS files (optional).
|
|
131 | 139 |
include $(CHIBIOS)/os/rt/rt.mk |
132 | 140 |
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk |
141 |
# Auto-build files in ./source recursively. |
|
142 |
include $(CHIBIOS)/tools/mk/autobuild.mk |
|
133 | 143 |
# Other files (optional). |
134 | 144 |
include $(CHIBIOS)/test/lib/test.mk |
135 | 145 |
include $(CHIBIOS)/test/rt/rt_test.mk |
... | ... | |
148 | 158 |
|
149 | 159 |
# C sources that can be compiled in ARM or THUMB mode depending on the global |
150 | 160 |
# setting. |
151 |
CSRC = $(LICSRC) \ |
|
152 |
$(STARTUPSRC) \ |
|
153 |
$(KERNSRC) \ |
|
154 |
$(PORTSRC) \ |
|
155 |
$(OSALSRC) \ |
|
156 |
$(HALSRC) \ |
|
157 |
$(PLATFORMSRC) \ |
|
158 |
$(MODULESCSRC) \ |
|
161 |
CSRC = $(ALLCSRC) \ |
|
159 | 162 |
$(TESTSRC) \ |
160 |
$(PERIPHERYLLDCSRC) \ |
|
161 |
$(AMIROOSCORECSRC) \ |
|
162 |
$(UNITTESTSCSRC) \ |
|
163 | 163 |
$(CHIBIOS)/os/various/evtimer.c \ |
164 | 164 |
$(CHIBIOS)/os/various/syscalls.c \ |
165 | 165 |
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \ |
166 | 166 |
board.c \ |
167 |
$(PERIPHERYLLDCSRC) \ |
|
168 |
$(UNITTESTSCSRC) \ |
|
169 |
$(AMIROOSCORECSRC) \ |
|
170 |
$(MODULESCSRC) \ |
|
167 | 171 |
module.c \ |
168 | 172 |
$(APPSCSRC) |
169 | 173 |
|
170 | 174 |
# C++ sources that can be compiled in ARM or THUMB mode depending on the global |
171 | 175 |
# setting. |
172 |
CPPSRC = $(AMIROOSCORECPPSRC) \
|
|
176 |
CPPSRC = $(ALLCPPSRC) \
|
|
173 | 177 |
$(CHIBIOS)/os/various/cpp_wrappers/syscalls_cpp.cpp \ |
178 |
$(AMIROOSCORECPPSRC) \ |
|
174 | 179 |
$(APPSCPPSRC) |
175 | 180 |
|
176 |
# C sources to be compiled in ARM mode regardless of the global setting. |
|
177 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
|
178 |
# option that results in lower performance and larger code size. |
|
179 |
ACSRC = $(APPSACSRC) |
|
180 |
|
|
181 |
# C++ sources to be compiled in ARM mode regardless of the global setting. |
|
182 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
|
183 |
# option that results in lower performance and larger code size. |
|
184 |
ACPPSRC = $(APPSACPPSRC) |
|
185 |
|
|
186 |
# C sources to be compiled in THUMB mode regardless of the global setting. |
|
187 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
|
188 |
# option that results in lower performance and larger code size. |
|
189 |
TCSRC = $(APPSTCSRC) |
|
190 |
|
|
191 |
# C sources to be compiled in THUMB mode regardless of the global setting. |
|
192 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
|
193 |
# option that results in lower performance and larger code size. |
|
194 |
TCPPSRC = $(APPSTCPPSRC) |
|
195 |
|
|
196 |
# List ASM source files here |
|
197 |
ASMSRC = $(APPSASMSRC) |
|
198 |
ASMXSRC = $(STARTUPASM) \ |
|
199 |
$(PORTASM) \ |
|
200 |
$(OSALASM) \ |
|
181 |
# List ASM source files here. |
|
182 |
ASMSRC = $(ALLASMSRC) \ |
|
183 |
$(APPSASMSRC) |
|
184 |
|
|
185 |
# List ASM with preprocessor source files here. |
|
186 |
ASMXSRC = $(ALLXASMSRC) \ |
|
201 | 187 |
$(APPSASMXSRC) |
202 | 188 |
|
203 |
INCDIR = $(LICINC) \ |
|
204 |
$(STARTUPINC) \ |
|
205 |
$(KERNINC) \ |
|
206 |
$(PORTINC) \ |
|
207 |
$(OSALINC) \ |
|
208 |
$(HALINC) \ |
|
209 |
$(PLATFORMINC) \ |
|
210 |
$(MODULESINC) \ |
|
189 |
# Inclusion directories. |
|
190 |
INCDIR = $(CONFDIR) \ |
|
191 |
$(ALLINC) \ |
|
211 | 192 |
$(TESTINC) \ |
212 |
$(BOOTLOADERINC) \ |
|
213 | 193 |
$(CHIBIOS)/os/hal/lib/streams \ |
194 |
$(BOOTLOADERINC) \ |
|
214 | 195 |
$(PERIPHERYLLDINC) \ |
215 | 196 |
$(AMIROOS) \ |
216 |
$(AMIROOSCOREINC) \ |
|
217 | 197 |
$(UNITTESTSINC) \ |
198 |
$(AMIROOSCOREINC) \ |
|
199 |
$(MODULESINC) \ |
|
218 | 200 |
$(APPSINC) |
219 | 201 |
|
220 |
# # |
|
221 |
# Project, sources and paths # |
|
222 |
################################################################################ |
|
202 |
# Define C warning options here. |
|
203 |
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes |
|
223 | 204 |
|
224 |
################################################################################ |
|
225 |
# Compiler settings # |
|
226 |
# NOTE: Some can be overridden externally. # |
|
227 |
# # |
|
205 |
# Define C++ warning options here. |
|
206 |
CPPWARN = -Wall -Wextra -Wundef |
|
228 | 207 |
|
229 |
MCU = cortex-m3 |
|
230 |
|
|
231 |
#TRGT = arm-elf- |
|
232 |
TRGT = arm-none-eabi- |
|
233 |
CC = $(TRGT)gcc |
|
234 |
CPPC = $(TRGT)g++ |
|
235 |
# Enable loading with g++ only if you need C++ runtime support. |
|
236 |
# NOTE: You can use C++ even without C++ support if you are careful. C++ |
|
237 |
# runtime support makes code size explode. |
|
238 |
LD = $(TRGT)gcc |
|
239 |
#LD = $(TRGT)g++ |
|
240 |
CP = $(TRGT)objcopy |
|
241 |
AS = $(TRGT)gcc -x assembler-with-cpp |
|
242 |
AR = $(TRGT)ar |
|
243 |
OD = $(TRGT)objdump |
|
244 |
SZ = $(TRGT)size |
|
245 |
HEX = $(CP) -O ihex |
|
246 |
BIN = $(CP) -O binary |
|
208 |
# Create an additional .srec image file. |
|
247 | 209 |
SREC = $(CP) -O srec --srec-len=248 |
248 | 210 |
|
249 |
# ARM-specific options here |
|
250 |
ifeq ($(AOPT),) |
|
251 |
AOPT = |
|
252 |
endif |
|
253 |
|
|
254 |
# THUMB-specific options here |
|
255 |
ifeq ($(TOPT),) |
|
256 |
TOPT = -mthumb -DTHUMB |
|
257 |
endif |
|
258 |
|
|
259 |
# Define C warning options here |
|
260 |
ifeq ($(CWARN),) |
|
261 |
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes |
|
262 |
endif |
|
263 |
|
|
264 |
# Define C++ warning options here |
|
265 |
ifeq ($(CPPWARN),) |
|
266 |
CPPWARN = -Wall -Wextra -Wundef |
|
267 |
endif |
|
268 |
|
|
269 | 211 |
# # |
270 |
# Compiler settings #
|
|
212 |
# Project, target, sources and paths #
|
|
271 | 213 |
################################################################################ |
272 | 214 |
|
273 | 215 |
################################################################################ |
... | ... | |
290 | 232 |
ULIBS += |
291 | 233 |
|
292 | 234 |
# # |
293 |
# End of user defines #
|
|
235 |
# End of user section #
|
|
294 | 236 |
################################################################################ |
295 | 237 |
|
296 | 238 |
################################################################################ |
297 |
# Start of targets section #
|
|
239 |
# Common rules #
|
|
298 | 240 |
# # |
299 | 241 |
|
300 |
# all and its dependencies |
|
301 |
ifeq ($(BUILDDIR),) |
|
302 |
BUILDDIR = ./build |
|
303 |
endif |
|
304 |
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC |
|
242 |
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk |
|
243 |
include $(RULESPATH)/arm-none-eabi.mk |
|
305 | 244 |
include $(RULESPATH)/rules.mk |
306 | 245 |
|
307 |
# flash |
|
308 |
include $(AMIROOS)/bootloader/bootloader.mk |
|
246 |
# # |
|
247 |
# Common rules # |
|
248 |
################################################################################ |
|
249 |
|
|
250 |
################################################################################ |
|
251 |
# Custom rules # |
|
252 |
# # |
|
253 |
|
|
309 | 254 |
FLASH_MODULES = $(PROJECT) |
310 | 255 |
FLASH_FILES = $(BUILDDIR)/$(PROJECT).$(FLASHTOOL_EXT) |
311 | 256 |
|
312 | 257 |
flash: $(FLASH_FILES) |
313 | 258 |
$(info ) |
314 |
ifeq ($(FLASHTOOL),SerialBoot) |
|
315 |
$(info Flashing ($(FLASHTOOL)):) |
|
316 |
$(FLASHTOOL_CMD) $(FLASHTOOL_ARGS) |
|
317 |
else |
|
318 |
$(info ERROR: unable to flash the module (SerialBoot unavailable)) |
|
319 |
endif |
|
259 |
ifeq ($(FLASHTOOL),SerialBoot)
|
|
260 |
$(info Flashing ($(FLASHTOOL)):)
|
|
261 |
$(FLASHTOOL_CMD) $(FLASHTOOL_ARGS)
|
|
262 |
else
|
|
263 |
$(info ERROR: unable to flash the module (SerialBoot unavailable))
|
|
264 |
endif
|
|
320 | 265 |
|
321 | 266 |
# # |
322 |
# End of targets section #
|
|
267 |
# Custom rules #
|
|
323 | 268 |
################################################################################ |
324 | 269 |
|
Also available in: Unified diff