Statistics
| Branch: | Tag: | Revision:

amiro-os / devices / DiWheelDrive / Makefile @ 6ad5c364

History | View | Annotate | Download (7.368 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 b3d6a364 galberding
  USE_OPT = -O2 -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 e1f1c4b5 galberding
				 amiro_map.cpp \
128 58fe0e0b Thomas Schöpping
         main.cpp \
129
         exti.cpp
130
131
# C sources to be compiled in ARM mode regardless of the global setting.
132
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
133
#       option that results in lower performance and larger code size.
134
ACSRC =
135
136
# C++ sources to be compiled in ARM mode regardless of the global setting.
137
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
138
#       option that results in lower performance and larger code size.
139
ACPPSRC =
140
141
# C sources to be compiled in THUMB mode regardless of the global setting.
142
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
143
#       option that results in lower performance and larger code size.
144
TCSRC =
145
146
# C sources to be compiled in THUMB mode regardless of the global setting.
147
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
148
#       option that results in lower performance and larger code size.
149
TCPPSRC =
150
151
# List ASM source files here
152
ASMSRC = $(PORTASM)
153
154
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
155
         $(HALINC) $(PLATFORMINC) $(BOARDINC) \
156
         $(CHCPPINC) \
157
         $(CHIBIOS)/os/various \
158
         $(AMIRO) \
159
         $(AMIRO)/include
160
161
#
162
# Project, sources and paths
163
##############################################################################
164
165
##############################################################################
166
# Compiler settings
167
#
168
169
MCU  = cortex-m3
170
171
#TRGT = arm-elf-
172
TRGT = arm-none-eabi-
173
CC   = $(TRGT)gcc
174
CPPC = $(TRGT)g++
175
# Enable loading with g++ only if you need C++ runtime support.
176
# NOTE: You can use C++ even without C++ support if you are careful. C++
177
#       runtime support makes code size explode.
178
#LD   = $(TRGT)gcc
179
LD   = $(TRGT)g++
180
CP   = $(TRGT)objcopy
181
AS   = $(TRGT)gcc -x assembler-with-cpp
182
OD   = $(TRGT)objdump
183
SZ   = $(TRGT)size
184
HEX  = $(CP) -O ihex
185
BIN  = $(CP) -O binary
186
SREC = $(CP) -O srec --srec-len=248
187
188
# ARM-specific options here
189
AOPT =
190
191
# THUMB-specific options here
192
TOPT = -mthumb -DTHUMB
193
194
# Define C warning options here
195
CWARN = -Wall -Wextra -Wstrict-prototypes
196
197
# Define C++ warning options here
198
CPPWARN = -Wall -Wextra
199
200
#
201
# Compiler settings
202
##############################################################################
203
204
##############################################################################
205
# Start of default section
206
#
207
208
# List all default C defines here, like -D_DEBUG=1
209
DDEFS =
210
211
# List all default ASM defines here, like -D_DEBUG=1
212
DADEFS =
213
214
# List all default directories to look for include files here
215
DINCDIR =
216
217
# List the default directory to look for the libraries here
218
DLIBDIR =
219
220
# List all default libraries here
221
DLIBS =
222
223
#
224
# End of default section
225
##############################################################################
226
227
##############################################################################
228
# Start of user section
229
#
230
231
# List all user C define here, like -D_DEBUG=1
232
UDEFS =
233
234
# Define ASM defines here
235
UADEFS =
236
237
# List all user directories here
238
UINCDIR =
239
240
# List the user directory to look for the libraries here
241
ULIBDIR =
242
243
# List all user libraries here
244
ULIBS =
245
246
#
247
# End of user defines
248
##############################################################################
249
250
ifeq ($(USE_FWLIB),yes)
251
  include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
252
  CSRC += $(STM32SRC)
253
  INCDIR += $(STM32INC)
254
  USE_OPT += -DUSE_STDPERIPH_DRIVER
255
endif
256
257
RULESPATH = $(CHIBIOS)/os/ports/GCC/ARMCMx
258
include $(RULESPATH)/rules.mk
259
260
include $(AMIRO)/ports/rules.mk
261
include $(AMIRO)/devices/flash.mk