Merge pull request #40 from fetzerch/debug
[picodrive.git] / Makefile
index eb5dc0a..a62d9b1 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,19 +1,26 @@
 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
 #drc_debug = 7
 #profile = 1
 
-ifneq ($(platform),emscripten)
+ifeq ($(WANT_GDB),1)
 CFLAGS += ggdb -falign-functions=2
 endif