File tree 1 file changed +5
-7
lines changed 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,21 @@ DFU = ../tools/dfu.py
22
22
PYDFU = ../tools/pydfu.py
23
23
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
24
24
CFLAGS = $(INC ) -Wall -Werror -std=c99 -nostdlib $(CFLAGS_CORTEX_M4 ) $(COPT )
25
+ LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@ .map --cref --gc-sections
25
26
else
27
+ LD = gcc
26
28
CFLAGS = -m32 $(INC ) -Wall -Werror -std=c99 $(COPT )
29
+ LDFLAGS = -m32 -Wl,-Map=$@ .map,--cref -Wl,--gc-sections
27
30
endif
28
31
29
- # Debugging/ Optimization
32
+ # Tune for Debugging or Optimization
30
33
ifeq ($(DEBUG ) , 1)
31
34
CFLAGS += -O0 -ggdb
32
35
else
33
36
CFLAGS += -Os -DNDEBUG
37
+ CFLAGS += -fdata-sections -ffunction-sections
34
38
endif
35
39
36
- ifeq ($(CROSS ) , 1)
37
- LDFLAGS = -nostdlib -T stm32f405.ld -Map=$@ .map --cref
38
- else
39
- LD = gcc
40
- LDFLAGS = -m32 -Wl,-Map=$@ .map,--cref
41
- endif
42
40
LIBS =
43
41
44
42
SRC_C = \
You can’t perform that action at this time.
0 commit comments