From d70f848b0867fa5f7748a242d06e95d140fd7736 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 14 Feb 2009 06:54:06 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@759 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- demos/ARMCM3-STM32F103-GCC/Makefile | 57 +++++++++++++++++++++---------------- 1 file changed, 33 insertions(+), 24 deletions(-) (limited to 'demos') diff --git a/demos/ARMCM3-STM32F103-GCC/Makefile b/demos/ARMCM3-STM32F103-GCC/Makefile index c476d8cda..12a819086 100644 --- a/demos/ARMCM3-STM32F103-GCC/Makefile +++ b/demos/ARMCM3-STM32F103-GCC/Makefile @@ -12,6 +12,29 @@ # To rebuild project do "make clean" and "make all". # +############################################################################################## +# OS, compiler and demo options + +# Compiler options here +OPT = -O2 -ggdb -fomit-frame-pointer -mabi=apcs-gnu -falign-functions=16 + +# 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 + +# Enable register caching optimization. This option greatly improves both +# code size and execution speed but is incompatible with libraries compiled +# without the very same options. The register R7 becomes a global variable +# and MUST NOT be used anywhere in the code. +USE_CURRP_CACHING = no + +# +# End of OS and demo options +############################################################################################## + ############################################################################################## # Start of default section # @@ -28,13 +51,6 @@ BIN = $(CP) -O binary 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 = @@ -103,23 +119,6 @@ ULIBDIR = # List all user libraries here ULIBS = -# Common options here -# NOTE: -ffixed-r7 is only needed if you enabled CH_CURRP_REGISTER_CACHE in -# 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 @@ -127,6 +126,16 @@ WARN = -Wall -Wstrict-prototypes # End of user defines ############################################################################################## +ifeq ($(USE_CURRP_CACHING),yes) +OPT += -ffixed-r7 -DCH_CURRP_REGISTER_CACHE='"r7"' +endif + +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 + ifeq ($(LINK_GC),yes) OPT += -ffunction-sections -fdata-sections endif -- cgit v1.2.3