Merge pull request #83 from orbea/debug
[picodrive.git] / Makefile
index 997609d..2903a68 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,8 @@
 TARGET ?= PicoDrive
+DEBUG ?= 0
 CFLAGS += -Wall -g
 CFLAGS += -I.
-ifndef DEBUG
+ifeq "$(DEBUG)" "0"
 CFLAGS += -O3 -DNDEBUG
 endif
 
@@ -69,7 +70,13 @@ endif
 ifeq ("$(PLATFORM)",$(filter "$(PLATFORM)","rpi1" "rpi2"))
 CFLAGS += -DHAVE_GLES -DRASPBERRY
 CFLAGS += -I/opt/vc/include/ -I/opt/vc/include/interface/vcos/pthreads/ -I/opt/vc/include/interface/vmcs_host/linux/
-LDFLAGS += -ldl -lbcm_host -L/opt/vc/lib -lEGL -lGLESv2
+LDFLAGS += -ldl -lbcm_host -L/opt/vc/lib
+# Stupid renaming occured in latest raspbian...
+ifneq (,$(wildcard /opt/vc/lib/libbrcmGLESv2.so))
+LDFLAGS += -lbrcmEGL -lbrcmGLESv2
+else
+LDFLAGS += -lEGL -lGLESv2
+endif
 OBJS += platform/linux/emu.o platform/linux/blit.o # FIXME
 OBJS += platform/common/plat_sdl.o
 OBJS += platform/libpicofe/plat_sdl.o platform/libpicofe/in_sdl.o
@@ -216,7 +223,7 @@ pico/cd/gfx_cd.o: CFLAGS += -fno-strict-aliasing
 # on x86, this is reduced by ~300MB when debug info is off (but not on ARM)
 # not using O3 and -fno-expensive-optimizations seems to also help, but you may
 # want to remove this stuff for better performance if your compiler can handle it
-ifndef DEBUG
+ifeq "$(DEBUG)" "0"
 cpu/fame/famec.o: CFLAGS += -g0 -O2 -fno-expensive-optimizations
 endif
 
@@ -230,4 +237,5 @@ cpu/sh2/compiler.o : cpu/drc/emit_x86.c
 cpu/sh2/mame/sh2pico.o : cpu/sh2/mame/sh2.c
 pico/pico.o pico/cd/mcd.o pico/32x/32x.o : pico/pico_cmn.c pico/pico_int.h
 pico/memory.o pico/cd/memory.o pico/32x/memory.o : pico/pico_int.h pico/memory.h
+# pico/cart.o : pico/carthw_cfg.c
 cpu/fame/famec.o: cpu/fame/famec.c cpu/fame/famec_opcodes.h