diff options
Diffstat (limited to 'demos/AVR/RT-ARDUINOMEGA/Makefile')
-rw-r--r-- | demos/AVR/RT-ARDUINOMEGA/Makefile | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/demos/AVR/RT-ARDUINOMEGA/Makefile b/demos/AVR/RT-ARDUINOMEGA/Makefile index feae77037..0426c3a69 100644 --- a/demos/AVR/RT-ARDUINOMEGA/Makefile +++ b/demos/AVR/RT-ARDUINOMEGA/Makefile @@ -152,6 +152,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
@@ -178,6 +180,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.
@@ -237,7 +241,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)
|