From 1b7a9f8f89efe841fecae18d542723e422c45a3c Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Tue, 29 Dec 2015 00:28:30 +0100 Subject: Enable makefile optimisations --- src/fsm/Makefile | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/fsm') diff --git a/src/fsm/Makefile b/src/fsm/Makefile index 8a6e463..6891076 100644 --- a/src/fsm/Makefile +++ b/src/fsm/Makefile @@ -36,13 +36,15 @@ DEFS=-DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DARM_MATH_CM4 -D__FPU_PRESENT=1 CFLAGS =-Wall -ggdb -std=c99 -c $(MCFLAGS) $(DEFS) $(INCLUDES) # LINKER FLAGS LDSCRIPT= bsp/stm32_flash.ld -LDFLAGS =-T $(LDSCRIPT) --specs=nosys.specs $(MCFLAGS) +LDFLAGS =-T $(LDSCRIPT) --specs=nosys.specs $(MCFLAGS) -Wl,-Map=$(BINDIR)/outp.map ### # Optimizations -OPT?='O1 O2 O3 O4 O6 O7' # O5 disabled by default, because it breaks code +OPT?='O2 O3 O6' +# O1 and O4 are irrelevant +# O5 breaks FreeRTOS somehow +# I'm not trusting O7 -ifneq ($(findstring release-memopt,$(MAKECMDGOALS)),) ifneq ($(filter O1,$(OPT)),) CXXFLAGS+=-fno-exceptions # Uncomment to disable exception handling DEFS+=-DNO_EXCEPTIONS # The source code has to comply with this rule @@ -78,18 +80,15 @@ endif ifneq ($(findstring O7,$(OPT)),) LDFLAGS+=--specs=nano.specs # Use size optimized newlib endif -endif ### # Build Rules -.PHONY: all release release-memopt debug clean +.PHONY: all release debug clean all: release release: $(BINDIR)/$(BINHEX) -release-memopt: release - debug: CFLAGS+=-g debug: LDFLAGS+=-g debug: release -- cgit v1.2.3