From 89b7339775f5b3d8d4afe88d5e95bdb0f82e4f30 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Wed, 19 Oct 2016 22:27:25 +0200 Subject: [PATCH] Enable Link Time Optimization and function garbage collection --- Makefile | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index fa74ada..dfd83ba 100644 --- a/Makefile +++ b/Makefile @@ -46,10 +46,14 @@ CFLAGS = -Wall \ -mmcu=$(BOARD) \ -DF_CPU=16000000UL \ -DGIT_DESCR=\"$(shell git describe --abbrev=6 --dirty --always --tags --long)\" \ - -std=c11 + -std=c11 \ + -flto \ + -fdata-sections -ffunction-sections # Linker flags -LDFLAGS = -mmcu=$(BOARD) +LDFLAGS = -mmcu=$(BOARD) \ + -flto \ + -Wl,-gc-sections OBJCOPYARGS = -O ihex \ -R .eeprom