[Cryptech-Commits] [sw/stm32] 05/05: Change default gcc optimization level to -Og.

git at cryptech.is git at cryptech.is
Fri Sep 16 19:52:57 UTC 2016


This is an automated email from the git hooks/post-receive script.

sra at hactrn.net pushed a commit to branch ksng
in repository sw/stm32.

commit fb931dbd29d899a7e9523ee1ea6e11d263b9ad7e
Author: Rob Austein <sra at hactrn.net>
AuthorDate: Fri Sep 16 15:48:37 2016 -0400

    Change default gcc optimization level to -Og.
---
 Makefile | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 577ce53..12ae4ef 100644
--- a/Makefile
+++ b/Makefile
@@ -85,8 +85,19 @@ export OBJCOPY=$(PREFIX)objcopy
 export OBJDUMP=$(PREFIX)objdump
 export SIZE=$(PREFIX)size
 
+# The Alpha is a development platform, so set GCC optimization to a
+# level suitable for debugging.  Recent versions of GCC have a special
+# optimization setting -Og for exactly this purpose, so we use it, along
+# with the flag to enable gdb symbols.
+#
+# If you really want optimization without debugging support, try -O2 or
+# (maybe) -O3.
+
+#STM32_CFLAGS_OPTIMIZATION ?= -O2
+STM32_CFLAGS_OPTIMIZATION ?= -ggdb -Og
+
 # whew, that's a lot of cflags
-CFLAGS  = -ggdb -O2 -Wall -Warray-bounds #-Wextra
+CFLAGS  = $(STM32_CFLAGS_OPTIMIZATION) -Wall -Warray-bounds #-Wextra
 CFLAGS += -mcpu=cortex-m4 -mthumb -mlittle-endian -mthumb-interwork
 CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16
 CFLAGS += -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DSTM32F429xx
@@ -159,15 +170,16 @@ bootloader: $(BOARD_OBJS) $(LIBS) $(LIBHAL_BLD)/libhal.a .FORCE
 
 clean:
 	rm -f $(BOARD_OBJS)
+	$(MAKE) -C $(LIBHAL_BLD) clean
 	$(MAKE) -C projects/board-test clean
 	$(MAKE) -C projects/cli-test clean
 	$(MAKE) -C projects/rtos-test clean
 	$(MAKE) -C projects/libhal-test clean
 	$(MAKE) -C projects/hsm clean
+	$(MAKE) -C projects/bootloader clean
 
 distclean: clean
 	$(MAKE) -C $(MBED_DIR) clean
 	$(MAKE) -C $(RTOS_DIR) clean
-	$(MAKE) -C $(LIBHAL_BLD) clean
 	$(MAKE) -C $(LIBTFM_BLD) clean
 	$(MAKE) -C $(LIBCLI_BLD) clean



More information about the Commits mailing list