Subversion Repositories chibiosIgnition

Rev

Rev 16 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 mjames 1
##############################################################################
2
# Build global options
3
# NOTE: Can be overridden externally.
4
#
5
 
22 mjames 6
 
2 mjames 7
# Compiler options here.
8
ifeq ($(USE_OPT),)
11 mjames 9
  USE_OPT = -O0 -g -ggdb -fomit-frame-pointer -falign-functions=16
2 mjames 10
endif
11
 
7 mjames 12
 
2 mjames 13
# C specific options here (added to USE_OPT).
14
ifeq ($(USE_COPT),)
7 mjames 15
  USE_COPT = 
2 mjames 16
endif
17
 
18
# C++ specific options here (added to USE_OPT).
19
ifeq ($(USE_CPPOPT),)
20
  USE_CPPOPT = -fno-rtti
21
endif
22
 
23
# Enable this if you want the linker to remove unused code and data
24
ifeq ($(USE_LINK_GC),)
25
  USE_LINK_GC = yes
26
endif
27
 
7 mjames 28
# Linker extra options here.
29
ifeq ($(USE_LDOPT),)
30
  USE_LDOPT = 
31
endif
32
 
33
# Enable this if you want link time optimizations (LTO)
34
ifeq ($(USE_LTO),)
35
  USE_LTO = yes
36
endif
37
 
2 mjames 38
# If enabled, this option allows to compile the application in THUMB mode.
39
ifeq ($(USE_THUMB),)
40
  USE_THUMB = yes
41
endif
42
 
43
# Enable this if you want to see the full log while compiling.
44
ifeq ($(USE_VERBOSE_COMPILE),)
45
  USE_VERBOSE_COMPILE = no
46
endif
47
 
7 mjames 48
# If enabled, this option makes the build process faster by not compiling
49
# modules not used in the current configuration.
50
ifeq ($(USE_SMART_BUILD),)
51
  USE_SMART_BUILD = yes
52
endif
53
 
54
 
2 mjames 55
#
56
# Build global options
57
##############################################################################
58
 
59
##############################################################################
60
# Architecture or project specific options
61
#
62
 
7 mjames 63
# Stack size to be allocated to the Cortex-M process stack. This stack is
64
# the stack used by the main() thread.
65
ifeq ($(USE_PROCESS_STACKSIZE),)
66
  USE_PROCESS_STACKSIZE = 0x400
67
endif
68
 
69
# Stack size to the allocated to the Cortex-M main/exceptions stack. This
70
# stack is used for processing interrupts and exceptions.
71
ifeq ($(USE_EXCEPTIONS_STACKSIZE),)
72
  USE_EXCEPTIONS_STACKSIZE = 0x400
73
endif
74
 
75
# Enables the use of FPU (no, softfp, hard).
76
ifeq ($(USE_FPU),)
77
  USE_FPU = no
78
endif
79
 
2 mjames 80
# Enable this if you really want to use the STM FWLib.
81
ifeq ($(USE_FWLIB),)
82
  USE_FWLIB = no
83
endif
84
 
85
#
86
# Architecture or project specific options
87
##############################################################################
88
 
89
##############################################################################
90
# Project, sources and paths
91
#
92
 
93
 
94
 
95
# Define project name here
96
PROJECT = ch
97
#define board
98
BOARD = ST_bluePillF103
99
 
7 mjames 100
CHIBIOS = ../ChibiOS
15 mjames 101
CHIBIOS_CONTRIB = ../ChibiOS/community
7 mjames 102
# Licensing files.
103
include $(CHIBIOS)/os/license/license.mk
104
# Startup files.
105
include $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC/mk/startup_stm32f1xx.mk
106
# HAL-OSAL files (optional).
15 mjames 107
include $(CHIBIOS_CONTRIB)/os/hal/hal.mk
108
include $(CHIBIOS_CONTRIB)/os/hal/ports/STM32/STM32F1xx/platform.mk
7 mjames 109
# board pinout file changed from chibiOS
110
include ./chibios/board/board.mk
111
include $(CHIBIOS)/os/hal/osal/rt/osal.mk
112
# RTOS files (optional).
113
include $(CHIBIOS)/os/rt/rt.mk
114
include $(CHIBIOS)/os/common/ports/ARMCMx/compilers/GCC/mk/port_v7m.mk
115
# Other files (optional).
116
include $(CHIBIOS)/test/lib/test.mk
117
include $(CHIBIOS)/test/rt/rt_test.mk
118
include $(CHIBIOS)/test/oslib/oslib_test.mk
119
include $(CHIBIOS)/os/hal/lib/streams/streams.mk
120
include $(CHIBIOS)/os/various/shell/shell.mk
2 mjames 121
 
122
# Define linker script file here
7 mjames 123
LDSCRIPT= $(STARTUPLD)/STM32F103xB.ld
2 mjames 124
 
3 mjames 125
SSD1306SRC  = SSD1306_lib/Font.c
126
SSD1306SRC += SSD1306_lib/SSD1306.c
2 mjames 127
 
3 mjames 128
SSD1306INC =  SSD1306_lib
129
 
130
IGNSRC  = src/hardware.c
131
IGNSRC += src/spiInterface.c
132
IGNSRC += src/ap_math.c
6 mjames 133
IGNSRC += src/timer2.c
134
IGNSRC += src/useAdc.c
3 mjames 135
 
2 mjames 136
IGNINC = inc
137
 
138
# C sources that can be compiled in ARM or THUMB mode depending on the global
139
# setting.
7 mjames 140
CSRC = $(ALLCSRC) \
141
       $(IGNSRC) \
3 mjames 142
       $(SSD1306SRC) \
7 mjames 143
       usbcfg.c \
16 mjames 144
       shellCmds.c \
2 mjames 145
       main.c
146
 
147
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
148
# setting.
7 mjames 149
CPPSRC = $(ALLCPPSRC)
2 mjames 150
 
151
# C sources to be compiled in ARM mode regardless of the global setting.
152
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
153
#       option that results in lower performance and larger code size.
154
ACSRC =
155
 
156
# C++ sources to be compiled in ARM mode regardless of the global setting.
157
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
158
#       option that results in lower performance and larger code size.
159
ACPPSRC =
160
 
161
# C sources to be compiled in THUMB mode regardless of the global setting.
162
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
163
#       option that results in lower performance and larger code size.
164
TCSRC =
165
 
166
# C sources to be compiled in THUMB mode regardless of the global setting.
167
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
168
#       option that results in lower performance and larger code size.
169
TCPPSRC =
170
 
171
# List ASM source files here
7 mjames 172
ASMSRC = $(ALLASMSRC)
173
ASMXSRC = $(ALLXASMSRC)
2 mjames 174
 
7 mjames 175
 
176
INCDIR = $(ALLINC) \
177
         $(IGNINC) \
178
         $(SSD1306INC) \
2 mjames 179
         $(CHIBIOS)/os/various
180
 
181
#
182
# Project, sources and paths
183
##############################################################################
184
 
185
##############################################################################
186
# Compiler settings
22 mjames 187
# hello
2 mjames 188
 
189
MCU  = cortex-m3
190
 
22 mjames 191
TRGT := arm-none-eabi-
2 mjames 192
CC   = $(TRGT)gcc
193
CPPC = $(TRGT)g++
194
# Enable loading with g++ only if you need C++ runtime support.
195
# NOTE: You can use C++ even without C++ support if you are careful. C++
196
#       runtime support makes code size explode.
197
LD   = $(TRGT)gcc
198
#LD   = $(TRGT)g++
199
CP   = $(TRGT)objcopy
200
AS   = $(TRGT)gcc -x assembler-with-cpp
201
OD   = $(TRGT)objdump
202
HEX  = $(CP) -O ihex
203
BIN  = $(CP) -O binary
22 mjames 204
SZ   = echo
2 mjames 205
 
206
# ARM-specific options here
207
AOPT =
208
 
209
# THUMB-specific options here
210
TOPT = -mthumb -DTHUMB
211
 
212
# Define C warning options here
213
CWARN = -Wall -Wextra -Wstrict-prototypes
214
 
215
# Define C++ warning options here
216
CPPWARN = -Wall -Wextra
217
 
218
#
219
# Compiler settings
220
##############################################################################
221
 
222
##############################################################################
223
# Start of default section
224
#
225
 
226
# List all default C defines here, like -D_DEBUG=1
227
DDEFS = -DSTDOUT_SD=SD2 -DSTDIN_SD=SD2
228
 
229
# List all default ASM defines here, like -D_DEBUG=1
230
DADEFS =
231
 
232
# List all default directories to look for include files here
233
DINCDIR =
234
 
235
# List the default directory to look for the libraries here
236
DLIBDIR =
237
 
238
# List all default libraries here
239
DLIBS =
240
 
241
#
242
# End of default section
243
##############################################################################
244
 
245
##############################################################################
246
# Start of user section
247
#
248
 
249
# List all user C define here, like -D_DEBUG=1
250
UDEFS =
251
 
252
# Define ASM defines here
253
UADEFS =
254
 
255
# List all user directories here
256
UINCDIR =
257
 
258
# List the user directory to look for the libraries here
259
ULIBDIR =
260
 
261
# List all user libraries here
5 mjames 262
ULIBS = -lm
2 mjames 263
 
264
#
265
# End of user defines
266
##############################################################################
267
 
268
ifeq ($(USE_FWLIB),yes)
269
  include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
270
  CSRC += $(STM32SRC)
271
  INCDIR += $(STM32INC)
272
  USE_OPT += -DUSE_STDPERIPH_DRIVER
273
endif
274
 
7 mjames 275
 
276
##############################################################################
277
 
278
RULESPATH = $(CHIBIOS)/os/common/startup/ARMCMx/compilers/GCC
279
include $(RULESPATH)/rules.mk
13 mjames 280