Subversion Repositories ChibiGauge

Rev

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