diff options
Diffstat (limited to 'demos/ARMCM3-STM32F103-GCC/Makefile')
-rw-r--r-- | demos/ARMCM3-STM32F103-GCC/Makefile | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/demos/ARMCM3-STM32F103-GCC/Makefile b/demos/ARMCM3-STM32F103-GCC/Makefile index a669ad3d5..c476d8cda 100644 --- a/demos/ARMCM3-STM32F103-GCC/Makefile +++ b/demos/ARMCM3-STM32F103-GCC/Makefile @@ -31,6 +31,10 @@ MCU = cortex-m3 # Enable this if you want the linker to remove unused code and data
LINK_GC = yes
+# Enable this if you really want to use the STM FWLib. ChibiOS/RT does not
+# require it and does not support the library except for this Makefile option.
+USE_FWLIB = no
+
# List all default C defines here, like -D_DEBUG=1
DDEFS =
@@ -69,6 +73,9 @@ UADEFS = # Imported source files
include ../../src/kernel.mk
include ../../test/test.mk
+ifeq ($(USE_FWLIB),yes)
+include ./stm32lib/stm32lib.mk
+endif
# List ARM-mode C source files here
SRC = ../../ports/ARMCM3/chcore.c ../../ports/ARMCM3/nvic.c \
@@ -78,6 +85,10 @@ SRC = ../../ports/ARMCM3/chcore.c ../../ports/ARMCM3/nvic.c \ ../../src/lib/evtimer.c \
board.c main.c
+ifeq ($(USE_FWLIB),yes)
+SRC += ${STM32SRC}
+endif
+
# List ASM source files here
ASMSRC = ../../ports/ARMCM3/crt0.s ../../ports/ARMCM3-STM32F103/vectors.s
@@ -97,10 +108,18 @@ ULIBS = # chconf.h.
# NOTE: -falign-functions=16 may improve the performance, not always, but
# increases the code size.
+# NOTE: Add -fno-strict-aliasing if you are tired to see all the warnings
+# generated by the STM FWLib, this option increases code size too.
OPT = -O2 -ggdb -fomit-frame-pointer -mabi=apcs-gnu
#OPT += -ffixed-r7
OPT += -falign-functions=16
+ifeq ($(USE_FWLIB),yes)
+# The thing generates a lot of aliasing warnings, this disables an optimization
+# and the warning disappears, the code is a bit larger however.
+OPT += -fno-strict-aliasing
+endif
+
# Define warning options here
WARN = -Wall -Wstrict-prototypes
|