amiro-os / devices / PowerManagement / Makefile @ 81b48c66
History | View | Annotate | Download (7.866 KB)
1 |
############################################################################## |
---|---|
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 |
# Enables the use of FPU on Cortex-M4. |
55 |
# Possible selections are: |
56 |
# no - no FPU is used (propably equals 'soft') |
57 |
# soft - does not use the FPU, thus all floating point operations are emulated |
58 |
# softfp - uses the FPU, but uses the integer registers only |
59 |
# hard - uses the FPU and passes data via the FPU registers |
60 |
ifeq ($(USE_FPU),) |
61 |
USE_FPU = hard |
62 |
endif |
63 |
|
64 |
# Enable this if you really want to use the STM FWLib. |
65 |
ifeq ($(USE_FWLIB),) |
66 |
USE_FWLIB = no |
67 |
endif |
68 |
|
69 |
# |
70 |
# Architecture or project specific options |
71 |
############################################################################## |
72 |
|
73 |
############################################################################## |
74 |
# Project, sources and paths |
75 |
# |
76 |
|
77 |
# Define project name here |
78 |
PROJECT = PowerManagement |
79 |
|
80 |
# Imported source files and paths |
81 |
CHIBIOS = ../../../ChibiOS |
82 |
AMIRO = ../.. |
83 |
include $(AMIRO)/boards/PowerManagement/board.mk |
84 |
include $(CHIBIOS)/os/hal/platforms/STM32F4xx/platform.mk |
85 |
include $(CHIBIOS)/os/hal/hal.mk |
86 |
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F4xx/port.mk |
87 |
include $(CHIBIOS)/os/kernel/kernel.mk |
88 |
include $(CHIBIOS)/os/various/cpp_wrappers/kernel.mk |
89 |
|
90 |
# Define linker script file here |
91 |
LDSCRIPT= $(BOARDLD)/STM32F405xG.ld |
92 |
|
93 |
# C sources that can be compiled in ARM or THUMB mode depending on the global |
94 |
# setting. |
95 |
CSRC = $(PORTSRC) \ |
96 |
$(KERNSRC) \ |
97 |
$(HALSRC) \ |
98 |
$(PLATFORMSRC) \ |
99 |
$(BOARDSRC) \ |
100 |
$(CHIBIOS)/os/various/evtimer.c \ |
101 |
$(CHIBIOS)/os/various/syscalls.c \ |
102 |
$(CHIBIOS)/os/various/chprintf.c \ |
103 |
$(CHIBIOS)/os/various/shell.c \ |
104 |
$(CHIBIOS)/os/various/memstreams.c \ |
105 |
$(AMIRO)/stubs.c \ |
106 |
$(AMIRO)/components/Debug.c |
107 |
|
108 |
# C++ sources that can be compiled in ARM or THUMB mode depending on the global |
109 |
# setting. |
110 |
CPPSRC = $(CHCPPSRC) \ |
111 |
$(AMIRO)/components/Color.cpp \ |
112 |
$(AMIRO)/components/ControllerAreaNetworkRx.cpp \ |
113 |
$(AMIRO)/components/ControllerAreaNetworkTx.cpp \ |
114 |
$(AMIRO)/components/bus/i2c/HWI2CDriver.cpp \ |
115 |
$(AMIRO)/components/bus/i2c/I2CMultiplexer.cpp \ |
116 |
$(AMIRO)/components/bus/i2c/VI2CDriver.cpp \ |
117 |
$(AMIRO)/components/proximity/vcnl4020.cpp \ |
118 |
$(AMIRO)/components/eeprom/eeprom.cpp \ |
119 |
$(AMIRO)/components/eeprom/at24.cpp \ |
120 |
$(AMIRO)/components/FileSystemInputOutput/FileSystemInputOutputBase.cpp \ |
121 |
$(AMIRO)/components/FileSystemInputOutput/FSIOPowerManagement.cpp \ |
122 |
$(AMIRO)/components/input/mpr121.cpp \ |
123 |
$(AMIRO)/components/power/adconverter.cpp \ |
124 |
$(AMIRO)/components/power/ina219.cpp \ |
125 |
$(AMIRO)/components/power/bq27500.cpp \ |
126 |
$(AMIRO)/components/bluetooth/bluetooth-descriptor.cpp \ |
127 |
$(AMIRO)/components/bluetooth/bluetooth-transport.cpp \ |
128 |
$(AMIRO)/components/bluetooth/bluetooth-connector.cpp \ |
129 |
$(AMIRO)/components/bluetooth/bluetooth-wiimote.cpp \ |
130 |
$(AMIRO)/components/bluetooth/bluetooth-serial.cpp \ |
131 |
$(AMIRO)/components/bluetooth/bluetooth-iwrap.cpp \ |
132 |
$(AMIRO)/components/bluetooth/bluetooth.cpp \ |
133 |
$(AMIRO)/components/serial_reset/iwrap_can_mux.cpp \ |
134 |
$(AMIRO)/components/serial_reset/serial_can_mux.cpp \ |
135 |
PowerManagement.cpp \ |
136 |
userthread.cpp \ |
137 |
main.cpp \ |
138 |
exti.cpp |
139 |
|
140 |
# C sources to be compiled in ARM mode regardless of the global setting. |
141 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
142 |
# option that results in lower performance and larger code size. |
143 |
ACSRC = |
144 |
|
145 |
# C++ sources to be compiled in ARM mode regardless of the global setting. |
146 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
147 |
# option that results in lower performance and larger code size. |
148 |
ACPPSRC = |
149 |
|
150 |
# C sources to be compiled in THUMB mode regardless of the global setting. |
151 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
152 |
# option that results in lower performance and larger code size. |
153 |
TCSRC = |
154 |
|
155 |
# C sources to be compiled in THUMB mode regardless of the global setting. |
156 |
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler |
157 |
# option that results in lower performance and larger code size. |
158 |
TCPPSRC = |
159 |
|
160 |
# List ASM source files here |
161 |
ASMSRC = $(PORTASM) |
162 |
|
163 |
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \ |
164 |
$(HALINC) $(PLATFORMINC) $(BOARDINC) \ |
165 |
$(CHCPPINC) \ |
166 |
$(CHIBIOS)/os/various \ |
167 |
$(AMIRO) \ |
168 |
$(AMIRO)/include |
169 |
|
170 |
# |
171 |
# Project, sources and paths |
172 |
############################################################################## |
173 |
|
174 |
############################################################################## |
175 |
# Compiler settings |
176 |
# |
177 |
|
178 |
MCU = cortex-m4 |
179 |
|
180 |
#TRGT = arm-elf- |
181 |
TRGT = arm-none-eabi- |
182 |
CC = $(TRGT)gcc |
183 |
CPPC = $(TRGT)g++ |
184 |
# Enable loading with g++ only if you need C++ runtime support. |
185 |
# NOTE: You can use C++ even without C++ support if you are careful. C++ |
186 |
# runtime support makes code size explode. |
187 |
#LD = $(TRGT)gcc |
188 |
LD = $(TRGT)g++ |
189 |
CP = $(TRGT)objcopy |
190 |
AS = $(TRGT)gcc -x assembler-with-cpp |
191 |
OD = $(TRGT)objdump |
192 |
SZ = $(TRGT)size |
193 |
HEX = $(CP) -O ihex |
194 |
BIN = $(CP) -O binary |
195 |
SREC = $(CP) -O srec --srec-len=248 |
196 |
|
197 |
# ARM-specific options here |
198 |
AOPT = |
199 |
|
200 |
# THUMB-specific options here |
201 |
TOPT = -mthumb -DTHUMB |
202 |
|
203 |
# Define C warning options here |
204 |
CWARN = -Wall -Wextra -Wstrict-prototypes |
205 |
|
206 |
# Define C++ warning options here |
207 |
CPPWARN = -Wall -Wextra |
208 |
|
209 |
# |
210 |
# Compiler settings |
211 |
############################################################################## |
212 |
|
213 |
############################################################################## |
214 |
# Start of default section |
215 |
# |
216 |
|
217 |
# List all default C defines here, like -D_DEBUG=1 |
218 |
DDEFS = |
219 |
|
220 |
# List all default ASM defines here, like -D_DEBUG=1 |
221 |
DADEFS = |
222 |
|
223 |
# List all default directories to look for include files here |
224 |
DINCDIR = |
225 |
|
226 |
# List the default directory to look for the libraries here |
227 |
DLIBDIR = |
228 |
|
229 |
# List all default libraries here |
230 |
DLIBS = |
231 |
|
232 |
# |
233 |
# End of default section |
234 |
############################################################################## |
235 |
|
236 |
############################################################################## |
237 |
# Start of user section |
238 |
# |
239 |
|
240 |
# List all user C define here, like -D_DEBUG=1 |
241 |
UDEFS = |
242 |
|
243 |
# Define ASM defines here |
244 |
UADEFS = |
245 |
|
246 |
# List all user directories here |
247 |
UINCDIR = |
248 |
|
249 |
# List the user directory to look for the libraries here |
250 |
ULIBDIR = |
251 |
|
252 |
# List all user libraries here |
253 |
ULIBS = |
254 |
|
255 |
# |
256 |
# End of user defines |
257 |
############################################################################## |
258 |
|
259 |
ifeq ($(USE_FWLIB),yes) |
260 |
include $(CHIBIOS)/ext/stm32lib/stm32lib.mk |
261 |
CSRC += $(STM32SRC) |
262 |
INCDIR += $(STM32INC) |
263 |
USE_OPT += -DUSE_STDPERIPH_DRIVER |
264 |
endif |
265 |
|
266 |
RULESPATH = $(CHIBIOS)/os/ports/GCC/ARMCMx |
267 |
include $(RULESPATH)/rules.mk |
268 |
|
269 |
include $(AMIRO)/ports/rules.mk |
270 |
include $(AMIRO)/devices/flash.mk |