Statistics
| Branch: | Tag: | Revision:

amiro-os / devices / DiWheelDrive / Makefile @ b24df8ad

History | View | Annotate | Download (7.349 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 05d54823 galberding
  USE_OPT = -O1 -fomit-frame-pointer -falign-functions=16 -DCHPRINTF_USE_FLOAT=1 -fstack-usage -DSERIAL_BUFFERS_SIZE=64 
9 58fe0e0b Thomas Schöpping
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 = DiWheelDrive
69
70
# Imported source files and paths
71
CHIBIOS = ../../../ChibiOS
72
AMIRO = ../..
73
include $(AMIRO)/boards/DiWheelDrive/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
include $(AMIRO)/hal/platforms/STM32/platform.mk
80
include $(AMIRO)/hal/hal.mk
81
82
# Define linker script file here
83
LDSCRIPT= $(BOARDLD)/STM32F103xE.ld
84
85
# C sources that can be compiled in ARM or THUMB mode depending on the global
86
# setting.
87
CSRC = $(PORTSRC) \
88
       $(KERNSRC) \
89
       $(HALSRC) \
90
       $(PLATFORMSRC) \
91
       $(BOARDSRC) \
92
       $(CHIBIOS)/os/various/evtimer.c \
93
       $(CHIBIOS)/os/various/syscalls.c \
94
       $(CHIBIOS)/os/various/chprintf.c \
95
       $(CHIBIOS)/os/various/shell.c \
96
       $(CHIBIOS)/os/various/memstreams.c \
97
       $(AMIRO)/stubs.c \
98
       $(AMIRO)/components/Debug.c \
99
100
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
101
# setting.
102
CPPSRC = $(CHCPPSRC) \
103
         $(AMIRO)/components/bus/spi/HWSPIDriver.cpp \
104
         $(AMIRO)/components/bus/i2c/HWI2CDriver.cpp \
105
         $(AMIRO)/components/bus/i2c/I2CMultiplexer.cpp \
106
         $(AMIRO)/components/bus/i2c/VI2CDriver.cpp \
107
         $(AMIRO)/components/proximity/vcnl4020.cpp \
108
         $(AMIRO)/components/magneto/hmc5883l.cpp \
109
         $(AMIRO)/components/accel/lis331dlh.cpp \
110
         $(AMIRO)/components/gyro/l3g4200d.cpp \
111
         $(AMIRO)/components/power/ina219.cpp \
112
         $(AMIRO)/components/eeprom/eeprom.cpp \
113
         $(AMIRO)/components/eeprom/at24.cpp \
114
         $(AMIRO)/components/FileSystemInputOutput/FileSystemInputOutputBase.cpp \
115
         $(AMIRO)/components/FileSystemInputOutput/FSIODiWheelDrive.cpp \
116
         $(AMIRO)/components/MotorIncrements.cpp \
117
         $(AMIRO)/components/MotorControl.cpp \
118
         $(AMIRO)/components/DistControl.cpp \
119
         $(AMIRO)/components/Odometry.cpp \
120
         $(AMIRO)/components/ControllerAreaNetworkRx.cpp \
121
         $(AMIRO)/components/ControllerAreaNetworkTx.cpp \
122
         $(AMIRO)/components/Color.cpp \
123
         $(AMIRO)/components/serial_reset/serial_can_mux.cpp \
124
         DiWheelDrive.cpp \
125
         userthread.cpp \
126 05d54823 galberding
         linefollow.cpp \
127 58fe0e0b Thomas Schöpping
         main.cpp \
128
         exti.cpp
129
130
# C sources to be compiled in ARM mode regardless of the global setting.
131
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
132
#       option that results in lower performance and larger code size.
133
ACSRC =
134
135
# C++ sources to be compiled in ARM mode regardless of the global setting.
136
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
137
#       option that results in lower performance and larger code size.
138
ACPPSRC =
139
140
# C sources to be compiled in THUMB 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
TCSRC =
144
145
# C sources to be compiled in THUMB 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
TCPPSRC =
149
150
# List ASM source files here
151
ASMSRC = $(PORTASM)
152
153
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
154
         $(HALINC) $(PLATFORMINC) $(BOARDINC) \
155
         $(CHCPPINC) \
156
         $(CHIBIOS)/os/various \
157
         $(AMIRO) \
158
         $(AMIRO)/include
159
160
#
161
# Project, sources and paths
162
##############################################################################
163
164
##############################################################################
165
# Compiler settings
166
#
167
168
MCU  = cortex-m3
169
170
#TRGT = arm-elf-
171
TRGT = arm-none-eabi-
172
CC   = $(TRGT)gcc
173
CPPC = $(TRGT)g++
174
# Enable loading with g++ only if you need C++ runtime support.
175
# NOTE: You can use C++ even without C++ support if you are careful. C++
176
#       runtime support makes code size explode.
177
#LD   = $(TRGT)gcc
178
LD   = $(TRGT)g++
179
CP   = $(TRGT)objcopy
180
AS   = $(TRGT)gcc -x assembler-with-cpp
181
OD   = $(TRGT)objdump
182
SZ   = $(TRGT)size
183
HEX  = $(CP) -O ihex
184
BIN  = $(CP) -O binary
185
SREC = $(CP) -O srec --srec-len=248
186
187
# ARM-specific options here
188
AOPT =
189
190
# THUMB-specific options here
191
TOPT = -mthumb -DTHUMB
192
193
# Define C warning options here
194
CWARN = -Wall -Wextra -Wstrict-prototypes
195
196
# Define C++ warning options here
197
CPPWARN = -Wall -Wextra
198
199
#
200
# Compiler settings
201
##############################################################################
202
203
##############################################################################
204
# Start of default section
205
#
206
207
# List all default C defines here, like -D_DEBUG=1
208
DDEFS =
209
210
# List all default ASM defines here, like -D_DEBUG=1
211
DADEFS =
212
213
# List all default directories to look for include files here
214
DINCDIR =
215
216
# List the default directory to look for the libraries here
217
DLIBDIR =
218
219
# List all default libraries here
220
DLIBS =
221
222
#
223
# End of default section
224
##############################################################################
225
226
##############################################################################
227
# Start of user section
228
#
229
230
# List all user C define here, like -D_DEBUG=1
231
UDEFS =
232
233
# Define ASM defines here
234
UADEFS =
235
236
# List all user directories here
237
UINCDIR =
238
239
# List the user directory to look for the libraries here
240
ULIBDIR =
241
242
# List all user libraries here
243
ULIBS =
244
245
#
246
# End of user defines
247
##############################################################################
248
249
ifeq ($(USE_FWLIB),yes)
250
  include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
251
  CSRC += $(STM32SRC)
252
  INCDIR += $(STM32INC)
253
  USE_OPT += -DUSE_STDPERIPH_DRIVER
254
endif
255
256
RULESPATH = $(CHIBIOS)/os/ports/GCC/ARMCMx
257
include $(RULESPATH)/rules.mk
258
259
include $(AMIRO)/ports/rules.mk
260
include $(AMIRO)/devices/flash.mk