File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,20 +42,21 @@ INC += -I$(CC3K_DIR)
4242
4343CFLAGS_CORTEX_M4 = -mthumb -mtune=cortex-m4 -mabi=aapcs-linux -mcpu=cortex-m4 -mfpu=fpv4-sp-d16 -mfloat-abi=hard -fsingle-precision-constant -Wdouble-promotion
4444CFLAGS = $(INC ) -Wall -Werror -ansi -std=gnu99 -nostdlib $(CFLAGS_CORTEX_M4 ) $(COPT )
45-
4645CFLAGS += -Iboards/$(BOARD )
4746
48- # Debugging/Optimization
47+ LDFLAGS = -nostdlib -T stm32f405.ld -Map=$(@:.elf=.map ) --cref
48+ LIBS =
49+
50+ # Debugging/Optimization
4951ifeq ($(DEBUG ) , 1)
5052CFLAGS += -g -DPENDSV_DEBUG
5153COPT = -O0
5254else
55+ CFLAGS += -fdata-sections -ffunction-sections
5356COPT += -Os -DNDEBUG
57+ LDFLAGS += --gc-sections
5458endif
5559
56- LDFLAGS = -nostdlib -T stm32f405.ld -Map=$(@:.elf=.map ) --cref
57- LIBS =
58-
5960# uncomment this if you want libgcc
6061# LIBS += $(shell $(CC) -print-libgcc-file-name)
6162
You can’t perform that action at this time.
0 commit comments