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