drc: support ms ABI
[picodrive.git] / Makefile
index 588475b..2620a70 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,15 +1,15 @@
 TARGET ?= PicoDrive
-CFLAGS += -Wall -ggdb -falign-functions=2
+CFLAGS += -Wall -g
 CFLAGS += -I.
 ifndef DEBUG
 CFLAGS += -O3 -DNDEBUG
 endif
-#CFLAGS += -DEVT_LOG
-#CFLAGS += -DDRC_CMP
-#cpu_cmp = 1
-#drc_debug = 7
-#profile = 1
 
+# This is actually needed, bevieve me.
+# If you really have to disable this, set NO_ALIGN_FUNCTIONS elsewhere.
+ifndef NO_ALIGN_FUNCTIONS
+CFLAGS += -falign-functions=2
+endif
 
 all: config.mak target_
 
@@ -44,15 +44,13 @@ asm_mix ?= 1
 else # if not arm
 use_fame ?= 1
 use_cz80 ?= 1
+ifneq (,$(findstring 86,$(ARCH)))
+use_sh2drc ?= 1
+endif
 endif
 
 -include Makefile.local
 
-ifneq "$(use_cyclone)" "1"
-# due to CPU stop flag access
-asm_cdmemory = 0
-endif
-
 ifeq "$(PLATFORM)" "opendingux"
 opk: $(TARGET).opk
 
@@ -71,7 +69,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
@@ -116,7 +120,7 @@ USE_FRONTEND = 1
 PLATFORM_MP3 = 1
 endif
 ifeq "$(PLATFORM)" "libretro"
-OBJS += platform/libretro.o 
+OBJS += platform/libretro/libretro.o
 endif
 
 ifeq "$(USE_FRONTEND)" "1"
@@ -186,7 +190,11 @@ clean:
        $(RM) -r .opk_data
 
 $(TARGET): $(OBJS)
+ifeq ($(STATIC_LINKING), 1)
+       $(AR) rcs $@ $^
+else
        $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) $(LDLIBS)
+endif
 
 pprof: platform/linux/pprof.c
        $(CC) -O2 -ggdb -DPPROF -DPPROF_TOOL -I../../ -I. $^ -o $@
@@ -222,8 +230,9 @@ pico/carthw_cfg.c: pico/carthw.cfg
        tools/make_carthw_c $< $@
 
 # random deps
-pico/carthw/svp/compiler.o : cpu/drc/emit_$(ARCH).c
-cpu/sh2/compiler.o : cpu/drc/emit_$(ARCH).c
+pico/carthw/svp/compiler.o : cpu/drc/emit_arm.c
+cpu/sh2/compiler.o : cpu/drc/emit_arm.c
+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