diff options
Diffstat (limited to 'demos/AVR/RT-ARDUINOUNO/Makefile')
-rw-r--r-- | demos/AVR/RT-ARDUINOUNO/Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/demos/AVR/RT-ARDUINOUNO/Makefile b/demos/AVR/RT-ARDUINOUNO/Makefile index fbd670520..95d2db104 100644 --- a/demos/AVR/RT-ARDUINOUNO/Makefile +++ b/demos/AVR/RT-ARDUINOUNO/Makefile @@ -151,6 +151,8 @@ CFLAGS += -Wa,-adhlns=$(<:%.c=$(OBJDIR)/%.lst) CFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
CFLAGS += $(CSTANDARD)
#CFLAGS += -mrelax
+CFLAGS += -fdata-sections
+CFLAGS += -ffunction-sections
#---------------- Compiler Options C++ ----------------
# -g*: generate debugging information
@@ -177,6 +179,8 @@ CFLAGS += -Wundef CPPFLAGS += -Wa,-adhlns=$(<:%.cpp=$(OBJDIR)/%.lst)
CPPFLAGS += $(patsubst %,-I%,$(EXTRAINCDIRS))
#CPPFLAGS += $(CSTANDARD)
+CPPFLAGS += -fdata-sections
+CPPFLAGS += -ffunction-sections
#---------------- Assembler Options ----------------
# -Wa,...: tell GCC to pass this to the assembler.
@@ -236,7 +240,7 @@ EXTMEMOPTS = # -Wl,...: tell GCC to pass this to linker.
# -Map: create map file
# --cref: add cross reference to map file
-LDFLAGS = -Wl,-Map=$(TARGET).map,--cref
+LDFLAGS = -Wl,-Map=$(TARGET).map,--cref,--gc-sections
LDFLAGS += $(EXTMEMOPTS)
LDFLAGS += $(patsubst %,-L%,$(EXTRALIBDIRS))
LDFLAGS += $(PRINTF_LIB) $(SCANF_LIB) $(MATH_LIB)
|