--- /dev/null
+# === CPU cores ===
+# --- M68k ---
+ifeq "$(use_musashi)" "1"
+DEFINES += EMU_M68K
+OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
+#OBJS += cpu/musashi/m68kdasm.o
+endif
+ifeq "$(use_cyclone)" "1"
+DEFINES += EMU_C68K
+OBJS += pico/m68kif_cyclone.o cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o
+endif
+ifeq "$(use_fame)" "1"
+DEFINES += EMU_F68K
+OBJS += cpu/fame/famec.o
+endif
+
+# --- Z80 ---
+ifeq "$(use_mz80)" "1"
+DEFINES += _USE_MZ80
+OBJS += cpu/mz80/mz80.o
+endif
+#
+ifeq "$(use_drz80)" "1"
+DEFINES += _USE_DRZ80
+OBJS += cpu/DrZ80/drz80.o
+endif
+#
+ifeq "$(use_cz80)" "1"
+DEFINES += _USE_CZ80
+OBJS += cpu/cz80/cz80.o
+endif
+
+# --- SH2 ---
+OBJS += cpu/sh2/sh2.o
+OBJS += cpu/drc/cmn.o
+#
+ifeq "$(use_sh2drc)" "1"
+DEFINES += DRC_SH2
+OBJS += cpu/sh2/compiler.o
+OBJS += cpu/sh2/stub_$(ARCH).o
+ifdef drc_debug
+DEFINES += DRC_DEBUG=$(drc_debug)
+OBJS += cpu/sh2/mame/sh2dasm.o
+OBJS += platform/linux/host_dasm.o
+LDFLAGS += -lbfd -lopcodes -liberty
+endif
+ifeq "$(drc_debug_interp)" "1"
+DEFINES += DRC_DEBUG_INTERP
+use_sh2mame = 1
+endif
+endif
+#
+ifeq "$(use_sh2mame)" "1"
+OBJS += cpu/sh2/mame/sh2pico.o
+endif
+
+
+# random deps
+pico/carthw/svp/compiler.o : ../../cpu/drc/emit_$(ARCH).c
+cpu/sh2/compiler.o : ../../cpu/drc/emit_$(ARCH).c
+cpu/sh2/mame/sh2pico.o : ../../cpu/sh2/mame/sh2.c
+pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
+pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
+
+../../cpu/musashi/m68kops.c :
+ @make -C ../../cpu/musashi
+
+../../cpu/mz80/mz80.asm :
+ @make -C ../../cpu/mz80/
+
+cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
+ @echo ">>>" $<
+ $(CC) $(CFLAGS) -Wno-unused -c $< -o $@
+
+../../cpu/Cyclone/proj/Cyclone.s:
+ @echo building Cyclone...
+ @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h
+
mkdirs:
mkdir -p $(DIRS)
-# some deps
-pico/carthw/svp/compiler.o : ../../pico/carthw/svp/ssp16.o ../../cpu/drc/emit_arm.c
-cpu/sh2/compiler.o : ../../cpu/drc/emit_arm.c
-pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
-pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
-
-# build Cyclone
-../../cpu/Cyclone/proj/Cyclone.s:
- @echo building Cyclone...
- @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h
-
-../../cpu/musashi/m68kops.c :
- @make -C ../../cpu/musashi
-
# build helix libs
../common/helix/$(CROSS)helix-mp3.a:
make -C ../common/helix clean all
-export CROSS = arm-linux-\r
+CROSS ?= arm-linux-\r
\r
# settings\r
-#mz80 = 1\r
-#debug_cyclone = 1\r
+use_cyclone = 1\r
+#use_musashi = 1\r
+use_drz80 = 1\r
+use_sh2drc = 1\r
+#use_sh2mame = 1\r
+\r
asm_memory = 1\r
asm_render = 1\r
asm_ym2612 = 1\r
asm_cdmemory = 1\r
amalgamate = 0\r
#profile = 1\r
-#use_musashi = 1\r
-use_sh2drc = 1\r
#drc_debug = 3\r
\r
-include Makefile.local\r
# due to CPU stop flag acces\r
asm_cdpico = 0\r
asm_cdmemory = 0\r
-else\r
-use_cyclone = 1\r
endif\r
\r
+ARCH = arm\r
DEFINES += ARM __GP2X__ IN_GP2X IN_EVDEV # BENCHMARK\r
CFLAGS += -Wall -Winline -I../.. -I.\r
ifeq ($(DEBUG),)\r
# zlib\r
OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r
zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o\r
-# debug\r
-ifeq "$(debug_cyclone)" "1"\r
-OBJS += pico/DebugCPU.o cpu/musashi/m68kdasm.o\r
-endif\r
-# CPU cores\r
-ifeq "$(use_musashi)" "1"\r
-DEFINES += EMU_M68K\r
-OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r
-endif\r
-ifeq "$(use_cyclone)" "1"\r
-DEFINES += EMU_C68K\r
-OBJS += pico/m68kif_cyclone.o cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r
-endif\r
-ifeq "$(mz80)" "1"\r
-DEFINES += _USE_MZ80\r
-OBJS += cpu/mz80/mz80.o\r
-else\r
-DEFINES += _USE_DRZ80\r
-OBJS += cpu/DrZ80/drz80.o\r
-endif\r
-OBJS += cpu/sh2/sh2.o\r
-ifeq "$(use_sh2drc)" "1"\r
-DEFINES += DRC_SH2 DRC_TMP\r
-OBJS += cpu/sh2/mame/sh2pico.o\r
-OBJS += cpu/sh2/compiler.o\r
-OBJS += cpu/sh2/stub_arm.o\r
-ifdef drc_debug\r
-DEFINES += DRC_DEBUG=$(drc_debug)\r
-OBJS += cpu/sh2/mame/sh2dasm.o\r
-OBJS += platform/linux/host_dasm.o\r
-LDFLAGS += -lbfd -lopcodes -liberty\r
-endif\r
-else\r
-OBJS += cpu/sh2/mame/sh2pico.o\r
-endif\r
-OBJS += cpu/drc/cmn.o\r
\r
CFLAGS += $(addprefix -D,$(DEFINES))\r
\r
\r
all: mkdirs PicoDrive\r
\r
+include ../common/common.mak\r
include ../common/common_arm.mak\r
include ../common/revision.mak\r
\r
# settings
use_musashi = 1
#use_fame = 1
-#use_mz80 = 1
+use_cz80 = 1
use_sh2drc = 1
+#use_sh2mame = 1
+
#drc_debug = 3
+#drc_debug_interp = 1
#profile = 1
#fake_in_gp2x = 1
zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
# unzip
OBJS += unzip/unzip.o unzip/unzip_stream.o
-# CPU cores
-ifeq "$(use_musashi)" "1"
-DEFINES += EMU_M68K
-OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
-#OBJS += cpu/musashi/m68kdasm.o
-endif
-ifeq "$(use_fame)" "1"
-DEFINES += EMU_F68K
-OBJS += cpu/fame/famec.o
-endif
-# z80
-ifeq "$(use_mz80)" "1"
-DEFINES += _USE_MZ80
-OBJS += cpu/mz80/mz80.o
-else
-DEFINES += _USE_CZ80
-OBJS += cpu/cz80/cz80.o
-endif
-# sh2
-OBJS += cpu/sh2/sh2.o
-ifeq "$(use_sh2drc)" "1"
-DEFINES += DRC_SH2 DRC_TMP
-OBJS += cpu/sh2/mame/sh2pico.o
-OBJS += cpu/sh2/compiler.o
-OBJS += cpu/sh2/stub_$(ARCH).o
-ifdef drc_debug
-DEFINES += DRC_DEBUG=$(drc_debug)
-OBJS += cpu/sh2/mame/sh2dasm.o
-OBJS += host_dasm.o
-LDFLAGS += -lbfd -lopcodes -liberty
-endif
-else
-OBJS += cpu/sh2/mame/sh2pico.o
-endif
-OBJS += cpu/drc/cmn.o
-# misc
-ifeq "$(use_fame)" "1"
-ifeq "$(use_musashi)" "1"
-OBJS += pico/debugCPU.o
-endif
-endif
CFLAGS += $(addprefix -D,$(DEFINES))
vpath %.S = ../..
vpath %.asm = ../..
-DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
+DIRS = platform/linux platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
pico/32x zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80 cpu/sh2/mame cpu/drc
all: mkdirs PicoDrive
+
+include ../common/common.mak
+
clean: tidy
@$(RM) PicoDrive
tidy:
include ../common/revision.mak
-pico/carthw/svp/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/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
-pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
-
-../../cpu/musashi/m68kops.c :
- @make -C ../../cpu/musashi
-
-cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm
- @echo $@
- @nasm -f elf $< -o $@
-
-../../cpu/mz80/mz80.asm :
- @make -C ../../cpu/mz80/
-
.c.o:
@echo ">>>" $<
$(CC) $(CFLAGS) -c $< -o $@
@echo ">>>" $<
nasm -f elf $< -o $@
-
-cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
- @echo ">>>" $<
- $(CC) $(CFLAGS) -Wno-unused -c $< -o $@
-