6 ifneq ($(ENABLE_DEBUG),)
10 ##############################################################################
11 # Build global options
12 # NOTE: Can be overridden externally.
15 # Compiler options here.
17 USE_OPT = -O2 -ggdb -fomit-frame-pointer -falign-functions=16
20 # C++ specific options here (added to USE_OPT).
22 USE_CPPOPT = -fno-rtti
25 # Enable this if you want the linker to remove unused code and data
26 ifeq ($(USE_LINK_GC),)
30 # If enabled, this option allows to compile the application in THUMB mode.
35 # Enable register caching optimization (read documentation).
36 ifeq ($(USE_CURRP_CACHING),)
37 USE_CURRP_CACHING = no
41 # Build global options
42 ##############################################################################
44 ##############################################################################
45 # Architecture or project specific options
48 # Enable this if you really want to use the STM FWLib.
54 # Architecture or project specific options
55 ##############################################################################
57 ##############################################################################
58 # Project, sources and paths
61 # Define project name here
64 # Define linker script file here
67 # Imported source files
68 CHIBIOS = ../ChibiOS_2.0.8
69 include $(CHIBIOS)/os/hal/platforms/STM32/platform.mk
70 include $(CHIBIOS)/os/hal/hal.mk
71 include $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F10x/port.mk
72 include $(CHIBIOS)/os/kernel/kernel.mk
75 ifneq ($(ENABLE_VCOMPORT),)
79 # C sources that can be compiled in ARM or THUMB mode depending on the global
86 ../boards/common/hw_config.c \
87 $(BOARD_DIR)/board.c \
88 $(CHIBIOS)/os/various/evtimer.c \
89 $(CHIBIOS)/os/various/syscalls.c \
93 usb_desc.c usb_prop.c \
94 usb-icc.c openpgp.c ac.c openpgp-do.c flash.c hardclock.c \
97 ifneq ($(ENABLE_DEBUG),)
101 ifneq ($(ENABLE_PINPAD),)
102 CSRC += pin-$(ENABLE_PINPAD).c
105 ifeq ($(ENABLE_PINPAD),dnd)
109 # List ASM source files here
110 ASMSRC = $(PORTASM) \
111 $(CHIBIOS)/os/ports/GCC/ARMCMx/STM32F10x/vectors.s
113 INCDIR = $(CRYPTINCDIR) \
114 $(PORTINC) $(KERNINC) $(TESTINC) \
115 $(HALINC) $(PLATFORMINC) ../boards/common $(BOARD_DIR) \
116 $(CHIBIOS)/os/various
119 # Project, sources and paths
120 ##############################################################################
122 ##############################################################################
129 TRGT = arm-none-eabi-
132 # Enable loading with g++ only if you need C++ runtime support.
133 # NOTE: You can use C++ even without C++ support if you are careful. C++
134 # runtime support makes code size explode.
138 AS = $(TRGT)gcc -x assembler-with-cpp
141 BIN = $(CP) -O binary
143 # ARM-specific options here
146 # THUMB-specific options here
147 TOPT = -mthumb -DTHUMB
149 # Define C warning options here
150 CWARN = -Wall -Wextra -Wstrict-prototypes
152 # Define C++ warning options here
153 CPPWARN = -Wall -Wextra
157 ##############################################################################
159 ##############################################################################
160 # Start of default section
163 # List all default C defines here, like -D_DEBUG=1
164 DDEFS = -DCORTEX_USE_BASEPRI=TRUE
166 # List all default ASM defines here, like -D_DEBUG=1
169 # List all default directories to look for include files here
172 # List the default directory to look for the libraries here
175 # List all default libraries here
179 # End of default section
180 ##############################################################################
182 ##############################################################################
183 # Start of user section
186 # List all user C define here, like -D_DEBUG=1
189 # Define ASM defines here
192 # List all user directories here
195 # List the user directory to look for the libraries here
198 # List all user libraries here
202 # End of user defines
203 ##############################################################################
205 ifeq ($(USE_FWLIB),yes)
206 include $(CHIBIOS)/ext/stm32lib/stm32lib.mk
208 INCDIR += $(STM32INC)
209 USE_OPT += -DUSE_STDPERIPH_DRIVER
212 include $(CHIBIOS)/os/ports/GCC/ARM/rules.mk
213 MCFLAGS= -mcpu=$(MCU) -mfix-cortex-m3-ldrd
216 -rm -f Makefile gnuk.ld config.h *.inc