From e6888bd2519778900c2d88d4a03d910b7f55da42 Mon Sep 17 00:00:00 2001 From: Silver Kits Date: Fri, 21 Oct 2016 13:40:53 +0300 Subject: [PATCH] Add LTO and unused data/functions optimisations suggested by Arti --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index fa74ada..b0f89d5 100644 --- a/Makefile +++ b/Makefile @@ -43,13 +43,18 @@ CFLAGS = -Wall \ -Werror \ -Wfatal-errors \ -Os \ + -flto \ + -fdata-sections \ + -ffunction-sections \ -mmcu=$(BOARD) \ -DF_CPU=16000000UL \ -DGIT_DESCR=\"$(shell git describe --abbrev=6 --dirty --always --tags --long)\" \ -std=c11 # Linker flags -LDFLAGS = -mmcu=$(BOARD) +LDFLAGS = -mmcu=$(BOARD) \ + -flto \ + -Wl,-gc-sections OBJCOPYARGS = -O ihex \ -R .eeprom