added cpu c core (currently for use in 386 builds)
[drnoksnes] / Makefile
index dd3143a..b9f5d10 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -4,6 +4,7 @@ CPPFLAGS := -I. $(shell sdl-config --cflags) $(shell pkg-config --cflags x11 xsp
 LDLIBS := -lz $(shell sdl-config --libs) $(shell pkg-config --libs x11 xsp) -lpopt -lhgw
 
 # Default CFLAGS for building in N8x0
+ARCH ?= arm
 CFLAGS ?= -DMAEMO -DMAEMO_VERSION=4 -march=armv6j -mtune=arm1136jf-s -mfpu=vfp -mfloat-abi=softfp -O2 -g -Wall -static-libgcc
 ASFLAGS ?= -march=armv6j -mfpu=vfp -mfloat-abi=softfp -g
 CXXFLAGS ?= $(CFLAGS)
@@ -12,14 +13,38 @@ GAME_VERSION ?= $(shell head -n 1 debian/changelog | sed 's/[^0-9.-]//g')-git
 export GAME_VERSION
 export DESTDIR
 
+# Configuration settings
+CONF_BUILD_ASM_CPU=0
+CONF_BUILD_ASM_SPC700=0
+
+ifeq ($(ARCH),arm)
+       CONF_BUILD_ASM_CPU=1
+       CONF_BUILD_ASM_SPC700=1
+       CONF_BUILD_ROUTINES=misc_armel
+else ifeq ($(ARCH),intel)
+       CONF_BUILD_ROUTINES=misc_i386
+endif
+
 # SNES stuff
 OBJS = 2xsaiwin.o apu.o c4.o c4emu.o cheats.o cheats2.o clip.o cpu.o cpuexec.o data.o
 OBJS += dma.o dsp1.o fxemu.o fxinst.o gfx.o globals.o loadzip.o memmap.o netplay.o ppu.o
 OBJS += sdd1.o sdd1emu.o snapshot.o soundux.o spc700.o srtc.o tile.o
-# ASM CPU Core, ripped from Yoyo's OpenSnes9X
-OBJS += os9x_asm_cpu.o os9x_65c816.o spc700a.o
-# and some asm from LJP...
-OBJS += m3d_func.o misc.o
+
+ifeq ($(CONF_BUILD_ASM_CPU), 1)
+       # ASM CPU Core from yoyofr's OpenSnes9X
+       OBJS += os9x_asm_cpu.o os9x_65c816.o
+       CPPFLAGS += -DCONF_BUILD_ASM_CPU=1
+else
+       OBJS += cpuops.o
+endif
+
+ifeq ($(CONF_BUILD_ASM_SPC700), 1)
+       OBJS += spc700a.o
+       CPPFLAGS += -DCONF_BUILD_ASM_CPU=1
+endif
+
+OBJS += $(CONF_BUILD_ROUTINES).o
+
 # from open-whatever sdk
 OBJS += unzip.o ioapi.o
 # my extensions to snes9x (speedhacks support)
@@ -63,3 +88,4 @@ gui_clean:
        $(MAKE) -C gui clean
        
 .PHONY: all clean remake deps install gui gui_clean
+