Subversion Repositories chibiosIgnition

Rev

Rev 5 | Rev 7 | Go to most recent revision | 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
 
6
# Compiler options here.
7
ifeq ($(USE_OPT),)
6 mjames 8
  USE_OPT = -Og -g -ggdb -fomit-frame-pointer -falign-functions=16
2 mjames 9
endif
10
 
11
# C specific options here (added to USE_OPT).
12
ifeq ($(USE_COPT),)
3 mjames 13
  USE_COPT =
2 mjames 14
endif
15
 
16
# C++ specific options here (added to USE_OPT).
17
ifeq ($(USE_CPPOPT),)
18
  USE_CPPOPT = -fno-rtti
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
# If enabled, this option allows to compile the application in THUMB mode.
27
ifeq ($(USE_THUMB),)
28
  USE_THUMB = yes
29
endif
30
 
31
# Enable this if you want to see the full log while compiling.
32
ifeq ($(USE_VERBOSE_COMPILE),)
33
  USE_VERBOSE_COMPILE = no
34
endif
35
 
36
#
37
# Build global options
38
##############################################################################
39
 
40
##############################################################################
41
# Architecture or project specific options
42
#
43
 
44
# Enable this if you really want to use the STM FWLib.
45
ifeq ($(USE_FWLIB),)
46
  USE_FWLIB = no
47
endif
48
 
49
#
50
# Architecture or project specific options
51
##############################################################################
52
 
53
##############################################################################
54
# Project, sources and paths
55
#
56
 
57
 
58
 
59
# Define project name here
60
PROJECT = ch
61
#define board
62
BOARD = ST_bluePillF103
63
 
64
# Imported source files and paths
65
CHIBIOS = ../chibios
66
include $(CHIBIOS)/boards/$(BOARD)/board.mk
67
include $(CHIBIOS)/os/hal/platforms/STM32F1xx/platform.mk
68
include $(CHIBIOS)/os/hal/hal.mk
69
include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F1xx/port.mk
70
include $(CHIBIOS)/os/kernel/kernel.mk
71
include $(CHIBIOS)/test/test.mk
72
#include $(CHIBIOS)/ext/fatfs/fatfs.mk
73
 
74
# Define linker script file here
75
LDSCRIPT= $(PORTLD)/STM32F103xB.ld
76
 
3 mjames 77
SSD1306SRC  = SSD1306_lib/Font.c
78
SSD1306SRC += SSD1306_lib/SSD1306.c
2 mjames 79
 
3 mjames 80
SSD1306INC =  SSD1306_lib
81
 
82
IGNSRC  = src/hardware.c
83
IGNSRC += src/spiInterface.c
84
IGNSRC += src/ap_math.c
6 mjames 85
IGNSRC += src/timer2.c
86
IGNSRC += src/useAdc.c
3 mjames 87
 
2 mjames 88
IGNINC = inc
89
 
90
# C sources that can be compiled in ARM or THUMB mode depending on the global
91
# setting.
92
CSRC = $(PORTSRC) \
93
       $(KERNSRC) \
94
       $(TESTSRC) \
95
       $(HALSRC) \
96
       $(PLATFORMSRC) \
97
       $(BOARDSRC) \
3 mjames 98
       $(SSD1306SRC) \
2 mjames 99
       $(CHIBIOS)/os/various/shell.c \
100
       $(CHIBIOS)/os/various/syscalls.c \
101
       $(CHIBIOS)/os/various/chprintf.c \
102
       $(IGNSRC) \
103
       main.c
104
 
105
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
106
# setting.
107
CPPSRC =
108
 
109
# C sources to be compiled in ARM mode regardless of the global setting.
110
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
111
#       option that results in lower performance and larger code size.
112
ACSRC =
113
 
114
# C++ sources to be compiled in ARM mode regardless of the global setting.
115
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
116
#       option that results in lower performance and larger code size.
117
ACPPSRC =
118
 
119
# C sources to be compiled in THUMB mode regardless of the global setting.
120
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
121
#       option that results in lower performance and larger code size.
122
TCSRC =
123
 
124
# C sources to be compiled in THUMB mode regardless of the global setting.
125
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
126
#       option that results in lower performance and larger code size.
127
TCPPSRC =
128
 
129
# List ASM source files here
130
ASMSRC = $(PORTASM)
131
 
132
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
133
         $(HALINC) $(PLATFORMINC) $(BOARDINC) \
3 mjames 134
         $(IGNINC) $(SSD1306INC) \
2 mjames 135
         $(CHIBIOS)/os/various
136
 
137
#
138
# Project, sources and paths
139
##############################################################################
140
 
141
##############################################################################
142
# Compiler settings
143
#
144
 
145
MCU  = cortex-m3
146
 
147
#TRGT = arm-elf-
148
TRGT = arm-none-eabi-
149
CC   = $(TRGT)gcc
150
CPPC = $(TRGT)g++
151
# Enable loading with g++ only if you need C++ runtime support.
152
# NOTE: You can use C++ even without C++ support if you are careful. C++
153
#       runtime support makes code size explode.
154
LD   = $(TRGT)gcc
155
#LD   = $(TRGT)g++
156
CP   = $(TRGT)objcopy
157
AS   = $(TRGT)gcc -x assembler-with-cpp
158
OD   = $(TRGT)objdump
159
HEX  = $(CP) -O ihex
160
BIN  = $(CP) -O binary
161
 
162
# ARM-specific options here
163
AOPT =
164
 
165
# THUMB-specific options here
166
TOPT = -mthumb -DTHUMB
167
 
168
# Define C warning options here
169
CWARN = -Wall -Wextra -Wstrict-prototypes
170
 
171
# Define C++ warning options here
172
CPPWARN = -Wall -Wextra
173
 
174
#
175
# Compiler settings
176
##############################################################################
177
 
178
##############################################################################
179
# Start of default section
180
#
181
 
182
# List all default C defines here, like -D_DEBUG=1
183
DDEFS = -DSTDOUT_SD=SD2 -DSTDIN_SD=SD2
184
 
185
# List all default ASM defines here, like -D_DEBUG=1
186
DADEFS =
187
 
188
# List all default directories to look for include files here
189
DINCDIR =
190
 
191
# List the default directory to look for the libraries here
192
DLIBDIR =
193
 
194
# List all default libraries here
195
DLIBS =
196
 
197
#
198
# End of default section
199
##############################################################################
200
 
201
##############################################################################
202
# Start of user section
203
#
204
 
205
# List all user C define here, like -D_DEBUG=1
206
UDEFS =
207
 
208
# Define ASM defines here
209
UADEFS =
210
 
211
# List all user directories here
212
UINCDIR =
213
 
214
# List the user directory to look for the libraries here
215
ULIBDIR =
216
 
217
# List all user libraries here
5 mjames 218
ULIBS = -lm
2 mjames 219
 
220
#
221
# End of user defines
222
##############################################################################
223
 
224
ifeq ($(USE_FWLIB),yes)
225
  include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
226
  CSRC += $(STM32SRC)
227
  INCDIR += $(STM32INC)
228
  USE_OPT += -DUSE_STDPERIPH_DRIVER
229
endif
230
 
231
include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk