amiro-os / os / modules / LightRing_1-0 / Makefile @ bdf72fa0
History | View | Annotate | Download (10.693 KB)
1 |
################################################################################ |
---|---|
2 |
# AMiRo-OS is an operating system designed for the Autonomous Mini Robot # |
3 |
# (AMiRo) platform. # |
4 |
# Copyright (C) 2016..2018 Thomas Schöpping et al. # |
5 |
# # |
6 |
# This program is free software: you can redistribute it and/or modify # |
7 |
# it under the terms of the GNU General Public License as published by # |
8 |
# the Free Software Foundation, either version 3 of the License, or # |
9 |
# (at your option) any later version. # |
10 |
# # |
11 |
# This program is distributed in the hope that it will be useful, # |
12 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of # |
13 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # |
14 |
# GNU General Public License for more details. # |
15 |
# # |
16 |
# You should have received a copy of the GNU General Public License # |
17 |
# along with this program. If not, see <http://www.gnu.org/licenses/>. # |
18 |
# # |
19 |
# This research/work was supported by the Cluster of Excellence Cognitive # |
20 |
# Interaction Technology 'CITEC' (EXC 277) at Bielefeld University, which is # |
21 |
# funded by the German Research Foundation (DFG). # |
22 |
################################################################################ |
23 |
|
24 |
|
25 |
|
26 |
################################################################################ |
27 |
# Build global options # |
28 |
# NOTE: Can be overridden externally. # |
29 |
# # |
30 |
|
31 |
# Compiler options here. |
32 |
ifeq ($(USE_OPT),) |
33 |
USE_OPT = -O2 -fomit-frame-pointer -falign-functions=16 -fstack-usage |
34 |
endif |
35 |
|
36 |
# C specific options here (added to USE_OPT). |
37 |
ifeq ($(USE_COPT),) |
38 |
USE_COPT = -std=c99 |
39 |
endif |
40 |
|
41 |
# C++ specific options here (added to USE_OPT). |
42 |
ifeq ($(USE_CPPOPT),) |
43 |
USE_CPPOPT = -fno-rtti -std=c++14 |
44 |
endif |
45 |
|
46 |
# Enable this if you want the linker to remove unused code and data |
47 |
ifeq ($(USE_LINK_GC),) |
48 |
USE_LINK_GC = yes |
49 |
endif |
50 |
|
51 |
# Linker extra options here. |
52 |
ifeq ($(USE_LDOPT),) |
53 |
USE_LDOPT = |
54 |
endif |
55 |
|
56 |
# Enable this if you want link time optimizations (LTO) |
57 |
ifeq ($(USE_LTO),) |
58 |
USE_LTO = yes |
59 |
endif |
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 |
# Enable this if you want to see the full log while compiling. |
67 |
ifeq ($(USE_VERBOSE_COMPILE),) |
68 |
USE_VERBOSE_COMPILE = no |
69 |
endif |
70 |
|
71 |
# If enabled, this option makes the build process faster by not compiling |
72 |
# modules not used in the current configuration. |
73 |
ifeq ($(USE_SMART_BUILD),) |
74 |
USE_SMART_BUILD = yes |
75 |
endif |
76 |
|
77 |
# # |
78 |
# Build global options # |
79 |
################################################################################ |
80 |
|
81 |
################################################################################ |
82 |
# Architecture or project specific options # |
83 |
# # |
84 |
|
85 |
# Stack size to be allocated to the Cortex-M process stack. This stack is |
86 |
# the stack used by the main() thread. |
87 |
ifneq ($(MAIN_STACKSIZE_LIGHTRING),) |
88 |
USE_PROCESS_STACKSIZE = $(MAIN_STACKSIZE_LIGHTRING) |
89 |
endif |
90 |
ifeq ($(USE_PROCESS_STACKSIZE),) |
91 |
USE_PROCESS_STACKSIZE = 0x400 |
92 |
endif |
93 |
|
94 |
# Stack size to the allocated to the Cortex-M main/exceptions stack. This |
95 |
# stack is used for processing interrupts and exceptions. |
96 |
ifneq ($(EXCEPTIONS_STACKSIZE_LIGHTRING),) |
97 |
USE_PROCESS_STACKSIZE = $(EXCEPTIONS_STACKSIZE_LIGHTRING) |
98 |
endif |
99 |
ifeq ($(USE_EXCEPTIONS_STACKSIZE),) |
100 |
USE_EXCEPTIONS_STACKSIZE = 0x400 |
101 |
endif |
102 |
|
103 |
# Enables the use of FPU on Cortex-M4. |
104 |
# Possible selections are: |
105 |
# no - no FPU is used (propably equals 'soft') |
106 |
# soft - does not use the FPU, thus all floating point operations are emulated |
107 |
# softfp - uses the FPU, but uses the integer registers only |
108 |
# hard - uses the FPU and passes data via the FPU registers |
109 |
ifeq ($(USE_FPU),) |
110 |
USE_FPU = no |
111 |
endif |
112 |
|
113 |
# # |
114 |
# Architecture or project specific options # |
115 |
################################################################################ |
116 |
|
117 |
################################################################################ |
118 |
# Project, sources and paths # |
119 |
# # |
120 |
|
121 |
# Define project name here |
122 |
PROJECT := $(patsubst $(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST))))..)/%,%,$(abspath $(dir $(abspath $(lastword $(MAKEFILE_LIST)))))) |
123 |
|
124 |
# Imported source files and paths |
125 |
include ../../../kernel/kernel.mk |
126 |
CHIBIOS := $(AMIROOS_KERNEL) |
127 |
AMIROOS = ../.. |
128 |
# Startup files |
129 |
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk |
130 |
# HAL-OSAL files |
131 |
include $(CHIBIOS)/os/hal/hal.mk |
132 |
include $(AMIROOS)/hal/hal.mk |
133 |
include $(CHIBIOS)/os/hal/ports/STM32/STM32F1xx/platform.mk |
134 |
include $(AMIROOS)/hal/ports/STM32/platform.mk |
135 |
include ./board.mk |
136 |
include $(CHIBIOS)/os/hal/osal/rt/osal.mk |
137 |
# RTOS files |
138 |
include $(CHIBIOS)/os/rt/rt.mk |
139 |
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk |
140 |
# Other files (optional). |
141 |
include $(CHIBIOS)/test/rt/test.mk |
142 |
# AMiRo-BLT files |
143 |
include ../../../bootloader/bootloader.mk |
144 |
# AMiRo-LLD files |
145 |
include ../../../periphery-lld/periphery-lld.mk |
146 |
# AMiRo-OS files |
147 |
include $(AMIROOS)/modules/modules.mk |
148 |
include $(AMIROOS)/core/core.mk |
149 |
include $(AMIROOS)/unittests/unittests.mk |
150 |
|
151 |
# Define linker script file here |
152 |
LDSCRIPT= $(BOARDLD)/STM32F103xE.ld |
153 |
|
154 |
# C sources that can be compiled in ARM or THUMB mode depending on the global |
155 |
# setting. |
156 |
CSRC = $(STARTUPSRC) \ |
157 |
$(KERNSRC) \ |
158 |
$(PORTSRC) \ |
159 |
$(OSALSRC) \ |
160 |
$(HALSRC) \ |
161 |
$(PLATFORMSRC) \ |
162 |
$(BOARDSRC) \ |
163 |
$(MODULESCSRC) \ |
164 |
$(TESTSRC) \ |
165 |
$(PERIPHERYLLDCSRC) \ |
166 |
$(AMIROOSCORECSRC) \ |
167 |
$(UNITTESTSCSRC) \ |
168 |
$(CHIBIOS)/os/various/evtimer.c \ |
169 |
$(CHIBIOS)/os/various/syscalls.c \ |
170 |
$(CHIBIOS)/os/hal/lib/streams/chprintf.c \ |
171 |
module.c \ |
172 |
$(APPSCSRC_LIGHTRING) |
173 |
|
174 |
# C++ sources that can be compiled in ARM or THUMB mode depending on the global |
175 |
# setting. |
176 |
CPPSRC = $(APPSCPPSRC_LIGHTRING) |
177 |
|
178 |
# C sources to be compiled in ARM mode regardless of the global setting. |
179 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
180 |
# option that results in lower performance and larger code size. |
181 |
ACSRC = |
182 |
|
183 |
# C++ sources to be compiled in ARM mode regardless of the global setting. |
184 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
185 |
# option that results in lower performance and larger code size. |
186 |
ACPPSRC = |
187 |
|
188 |
# C sources to be compiled in THUMB mode regardless of the global setting. |
189 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
190 |
# option that results in lower performance and larger code size. |
191 |
TCSRC = |
192 |
|
193 |
# C sources to be compiled in THUMB mode regardless of the global setting. |
194 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
195 |
# option that results in lower performance and larger code size. |
196 |
TCPPSRC = |
197 |
|
198 |
# List ASM source files here |
199 |
ASMSRC = |
200 |
ASMXSRC = $(STARTUPASM) \ |
201 |
$(PORTASM) \ |
202 |
$(OSALASM) |
203 |
|
204 |
INCDIR = $(CHIBIOS)/os/license \ |
205 |
$(STARTUPINC) \ |
206 |
$(KERNINC) \ |
207 |
$(PORTINC) \ |
208 |
$(OSALINC) \ |
209 |
$(HALINC) \ |
210 |
$(PLATFORMINC) \ |
211 |
$(BOARDINC) \ |
212 |
$(MODULESINC) \ |
213 |
$(TESTINC) \ |
214 |
$(BOOTLOADERINC) \ |
215 |
$(CHIBIOS)/os/hal/lib/streams \ |
216 |
$(CHIBIOS)/os/various \ |
217 |
$(PERIPHERYLLDINC) \ |
218 |
$(AMIROOS) \ |
219 |
$(AMIROOSCOREINC) \ |
220 |
$(UNITTESTSINC) \ |
221 |
$(APPSINC_LIGHTRING) |
222 |
|
223 |
# # |
224 |
# Project, sources and paths # |
225 |
################################################################################ |
226 |
|
227 |
################################################################################ |
228 |
# Compiler settings # |
229 |
# NOTE: Some can be overridden externally. # |
230 |
# # |
231 |
|
232 |
MCU = cortex-m3 |
233 |
|
234 |
#TRGT = arm-elf- |
235 |
TRGT = arm-none-eabi- |
236 |
CC = $(TRGT)gcc |
237 |
CPPC = $(TRGT)g++ |
238 |
# Enable loading with g++ only if you need C++ runtime support. |
239 |
# NOTE: You can use C++ even without C++ support if you are careful. C++ |
240 |
# runtime support makes code size explode. |
241 |
LD = $(TRGT)gcc |
242 |
#LD = $(TRGT)g++ |
243 |
CP = $(TRGT)objcopy |
244 |
AS = $(TRGT)gcc -x assembler-with-cpp |
245 |
AR = $(TRGT)ar |
246 |
OD = $(TRGT)objdump |
247 |
SZ = $(TRGT)size |
248 |
HEX = $(CP) -O ihex |
249 |
BIN = $(CP) -O binary |
250 |
SREC = $(CP) -O srec --srec-len=248 |
251 |
|
252 |
# ARM-specific options here |
253 |
ifeq ($(AOPT),) |
254 |
AOPT = |
255 |
endif |
256 |
|
257 |
# THUMB-specific options here |
258 |
ifeq ($(TOPT),) |
259 |
TOPT = -mthumb -DTHUMB |
260 |
endif |
261 |
|
262 |
# Define C warning options here |
263 |
ifeq ($(CWARN),) |
264 |
CWARN = -Wall -Wextra -Wundef -Wstrict-prototypes |
265 |
endif |
266 |
|
267 |
# Define C++ warning options here |
268 |
ifeq ($(CPPWARN),) |
269 |
CPPWARN = -Wall -Wextra -Wundef |
270 |
endif |
271 |
|
272 |
# # |
273 |
# Compiler settings # |
274 |
################################################################################ |
275 |
|
276 |
################################################################################ |
277 |
# Start of user section # |
278 |
# # |
279 |
|
280 |
# List all user C define here, like -D_DEBUG=1 |
281 |
UDEFS += |
282 |
|
283 |
# Define ASM defines here |
284 |
UADEFS += |
285 |
|
286 |
# List all user directories here |
287 |
UINCDIR += |
288 |
|
289 |
# List the user directory to look for the libraries here |
290 |
ULIBDIR += |
291 |
|
292 |
# List all user libraries here |
293 |
ULIBS += |
294 |
|
295 |
# # |
296 |
# End of user defines # |
297 |
################################################################################ |
298 |
|
299 |
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC |
300 |
include $(RULESPATH)/rules.mk |
301 |
|
302 |
include $(AMIROOS)/modules/flash.mk |