Subversion Repositories chibiosIgnition

Rev

Rev 3 | 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),)
8
  USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
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
85
 
2 mjames 86
IGNINC = inc
87
 
88
# C sources that can be compiled in ARM or THUMB mode depending on the global
89
# setting.
90
CSRC = $(PORTSRC) \
91
       $(KERNSRC) \
92
       $(TESTSRC) \
93
       $(HALSRC) \
94
       $(PLATFORMSRC) \
95
       $(BOARDSRC) \
3 mjames 96
       $(SSD1306SRC) \
2 mjames 97
       $(CHIBIOS)/os/various/shell.c \
98
       $(CHIBIOS)/os/various/syscalls.c \
99
       $(CHIBIOS)/os/various/chprintf.c \
100
       $(IGNSRC) \
101
       main.c
102
 
103
# C++ sources that can be compiled in ARM or THUMB mode depending on the global
104
# setting.
105
CPPSRC =
106
 
107
# C sources to be compiled in ARM mode regardless of the global setting.
108
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
109
#       option that results in lower performance and larger code size.
110
ACSRC =
111
 
112
# C++ sources to be compiled in ARM mode regardless of the global setting.
113
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
114
#       option that results in lower performance and larger code size.
115
ACPPSRC =
116
 
117
# C sources to be compiled in THUMB mode regardless of the global setting.
118
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
119
#       option that results in lower performance and larger code size.
120
TCSRC =
121
 
122
# C sources to be compiled in THUMB mode regardless of the global setting.
123
# NOTE: Mixing ARM and THUMB mode enables the -mthumb-interwork compiler
124
#       option that results in lower performance and larger code size.
125
TCPPSRC =
126
 
127
# List ASM source files here
128
ASMSRC = $(PORTASM)
129
 
130
INCDIR = $(PORTINC) $(KERNINC) $(TESTINC) \
131
         $(HALINC) $(PLATFORMINC) $(BOARDINC) \
3 mjames 132
         $(IGNINC) $(SSD1306INC) \
2 mjames 133
         $(CHIBIOS)/os/various
134
 
135
#
136
# Project, sources and paths
137
##############################################################################
138
 
139
##############################################################################
140
# Compiler settings
141
#
142
 
143
MCU  = cortex-m3
144
 
145
#TRGT = arm-elf-
146
TRGT = arm-none-eabi-
147
CC   = $(TRGT)gcc
148
CPPC = $(TRGT)g++
149
# Enable loading with g++ only if you need C++ runtime support.
150
# NOTE: You can use C++ even without C++ support if you are careful. C++
151
#       runtime support makes code size explode.
152
LD   = $(TRGT)gcc
153
#LD   = $(TRGT)g++
154
CP   = $(TRGT)objcopy
155
AS   = $(TRGT)gcc -x assembler-with-cpp
156
OD   = $(TRGT)objdump
157
HEX  = $(CP) -O ihex
158
BIN  = $(CP) -O binary
159
 
160
# ARM-specific options here
161
AOPT =
162
 
163
# THUMB-specific options here
164
TOPT = -mthumb -DTHUMB
165
 
166
# Define C warning options here
167
CWARN = -Wall -Wextra -Wstrict-prototypes
168
 
169
# Define C++ warning options here
170
CPPWARN = -Wall -Wextra
171
 
172
#
173
# Compiler settings
174
##############################################################################
175
 
176
##############################################################################
177
# Start of default section
178
#
179
 
180
# List all default C defines here, like -D_DEBUG=1
181
DDEFS = -DSTDOUT_SD=SD2 -DSTDIN_SD=SD2
182
 
183
# List all default ASM defines here, like -D_DEBUG=1
184
DADEFS =
185
 
186
# List all default directories to look for include files here
187
DINCDIR =
188
 
189
# List the default directory to look for the libraries here
190
DLIBDIR =
191
 
192
# List all default libraries here
193
DLIBS =
194
 
195
#
196
# End of default section
197
##############################################################################
198
 
199
##############################################################################
200
# Start of user section
201
#
202
 
203
# List all user C define here, like -D_DEBUG=1
204
UDEFS =
205
 
206
# Define ASM defines here
207
UADEFS =
208
 
209
# List all user directories here
210
UINCDIR =
211
 
212
# List the user directory to look for the libraries here
213
ULIBDIR =
214
 
215
# List all user libraries here
216
ULIBS =
217
 
218
#
219
# End of user defines
220
##############################################################################
221
 
222
ifeq ($(USE_FWLIB),yes)
223
  include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
224
  CSRC += $(STM32SRC)
225
  INCDIR += $(STM32INC)
226
  USE_OPT += -DUSE_STDPERIPH_DRIVER
227
endif
228
 
229
include $(CHIBIOS)/os/ports/GCC/ARMCMx/rules.mk