stmhal: For non-debug compile, enable CC/LD opt to remove dead code.

Saves over 35k ROM due to elimination of unused HAL functions.  All
tests pass.

Addresses issue #702.
pull/803/head
Damien George 2014-08-16 13:37:05 +01:00
rodzic c84aa41990
commit 244476e3e6
1 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -42,20 +42,21 @@ INC += -I$(CC3K_DIR)
CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
CFLAGS = $(INC) -Wall -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
CFLAGS += -Iboards/$(BOARD)
#Debugging/Optimization
LDFLAGS = -nostdlib -T stm32f405.ld -Map=$(@:.elf=.map) --cref
LIBS =
# Debugging/Optimization
ifeq ($(DEBUG), 1)
CFLAGS += -g -DPENDSV_DEBUG
COPT = -O0
else
CFLAGS += -fdata-sections -ffunction-sections
COPT += -Os -DNDEBUG
LDFLAGS += --gc-sections
endif
LDFLAGS = -nostdlib -T stm32f405.ld -Map=$(@:.elf=.map) --cref
LIBS =
# uncomment this if you want libgcc
#LIBS += $(shell $(CC) -print-libgcc-file-name)