aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-02-14 06:54:06 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-02-14 06:54:06 +0000
commitd70f848b0867fa5f7748a242d06e95d140fd7736 (patch)
tree62301dce5d17f8f2f113c8c796f3251f1a26bf4f /demos
parent1a18435fcb67ceb72b22ce19aa667f67703c0f3f (diff)
downloadChibiOS-d70f848b0867fa5f7748a242d06e95d140fd7736.tar.gz
ChibiOS-d70f848b0867fa5f7748a242d06e95d140fd7736.tar.bz2
ChibiOS-d70f848b0867fa5f7748a242d06e95d140fd7736.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@759 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'demos')
-rw-r--r--demos/ARMCM3-STM32F103-GCC/Makefile57
1 files changed, 33 insertions, 24 deletions
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
@@ -13,6 +13,29 @@
#
##############################################################################################
+# 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