another try to reduce compiler problems with fame
[picodrive.git] / Makefile
index 0df793e..8e2feee 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -2,7 +2,10 @@ TARGET ?= PicoDrive
 CFLAGS += -Wall -ggdb -falign-functions=2
 CFLAGS += -I.
 ifndef DEBUG
-CFLAGS += -O2 -DNDEBUG
+CFLAGS += -O2 -DNDEBUG -ffunction-sections
+ifeq ($(findstring clang,$(CC)),)
+LDFLAGS += -Wl,--gc-sections
+endif
 endif
 #CFLAGS += -DEVT_LOG
 #CFLAGS += -DDRC_CMP
@@ -194,6 +197,10 @@ pico/cd/pcm.o: CFLAGS += -fno-strict-aliasing
 pico/cd/LC89510.o: CFLAGS += -fno-strict-aliasing
 pico/cd/gfx_cd.o: CFLAGS += -fno-strict-aliasing
 
+# fame needs ~2GB of RAM to compile on gcc 4.8
+# on x86, this is reduced by ~300MB when debug info is off (but not on ARM)
+cpu/fame/famec.o: CFLAGS += -g0
+
 # random deps
 pico/carthw/svp/compiler.o : cpu/drc/emit_$(ARCH).c
 cpu/sh2/compiler.o : cpu/drc/emit_$(ARCH).c