From: Christian Fetzer Date: Mon, 5 Dec 2016 22:12:44 +0000 (+0100) Subject: Fix compilation with DEBUG flag X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=779d96d907ecbd5fce8a9b7c1a7f0cf172bc5c0d;p=picodrive.git Fix compilation with DEBUG flag - Use DEBUG flag similar to other libretro cores (DEBUG=0 disables, DEBUG=1 enables the debug build) - Optimize with -O2 for debugging because the core won't work otherwise - Always strip sections to prevent undefined symbol errors --- diff --git a/Makefile b/Makefile index 9b364dd9..a62d9b11 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,19 @@ TARGET ?= PicoDrive +DEBUG = 0 CFLAGS += -Wall CFLAGS += -I. -DINLINE=inline -ifndef DEBUG +ifeq ($(DEBUG),0) ifeq ($(platform), vita) CFLAGS += -O3 -DNDEBUG else CFLAGS += -O2 -DNDEBUG -ffunction-sections endif +else +CFLAGS += -g -O2 +endif ifneq ($(APPLE),1) LDFLAGS += -Wl,--gc-sections endif -endif #CFLAGS += -DEVT_LOG #CFLAGS += -DDRC_CMP #cpu_cmp = 1