minimal/Makefile: Enable gc-sections to remove unused code.
This commit is contained in:
parent
205c368fa1
commit
a6bec53177
@ -22,23 +22,21 @@ DFU = ../tools/dfu.py
|
|||||||
PYDFU = ../tools/pydfu.py
|
PYDFU = ../tools/pydfu.py
|
||||||
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_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 -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
|
CFLAGS = $(INC) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4) $(COPT)
|
||||||
|
LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref --gc-sections
|
||||||
else
|
else
|
||||||
|
LD = gcc
|
||||||
CFLAGS = -m32 $(INC) -Wall -Werror -std=c99 $(COPT)
|
CFLAGS = -m32 $(INC) -Wall -Werror -std=c99 $(COPT)
|
||||||
|
LDFLAGS = -m32 -Wl,-Map=$@.map,--cref -Wl,--gc-sections
|
||||||
endif
|
endif
|
||||||
|
|
||||||
#Debugging/Optimization
|
# Tune for Debugging or Optimization
|
||||||
ifeq ($(DEBUG), 1)
|
ifeq ($(DEBUG), 1)
|
||||||
CFLAGS += -O0 -ggdb
|
CFLAGS += -O0 -ggdb
|
||||||
else
|
else
|
||||||
CFLAGS += -Os -DNDEBUG
|
CFLAGS += -Os -DNDEBUG
|
||||||
|
CFLAGS += -fdata-sections -ffunction-sections
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CROSS), 1)
|
|
||||||
LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@.map --cref
|
|
||||||
else
|
|
||||||
LD = gcc
|
|
||||||
LDFLAGS = -m32 -Wl,-Map=$@.map,--cref
|
|
||||||
endif
|
|
||||||
LIBS =
|
LIBS =
|
||||||
|
|
||||||
SRC_C = \
|
SRC_C = \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user