Don't include dead code when linking program (saves 48kB)
authorPaul Cercueil <paul@crapouillou.net>
Mon, 30 Sep 2013 12:29:24 +0000 (09:29 -0300)
committernotaz <notasas@gmail.com>
Thu, 10 Oct 2013 00:02:41 +0000 (03:02 +0300)
Makefile

index 0df793e..c199b85 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,8 @@ TARGET ?= PicoDrive
 CFLAGS += -Wall -ggdb -falign-functions=2
 CFLAGS += -I.
 ifndef DEBUG
-CFLAGS += -O2 -DNDEBUG
+CFLAGS += -O2 -DNDEBUG -ffunction-sections
+LDFLAGS += -Wl,--gc-sections
 endif
 #CFLAGS += -DEVT_LOG
 #CFLAGS += -DDRC_CMP