10 -include Makefile.local
14 CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math
15 CFLAGS += -fprofile-generate
17 CFLAGS += -ggdb -Wall -falign-functions=2
19 DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV
21 LDFLAGS += -lX11 -lpthread
24 OBJS += platform/gp2x/emu.o blit.o in_evdev.o plat.o sndout_oss.o gp2x.o log_io.o
27 OBJS += platform/common/main.o platform/common/emu.o platform/common/menu.o \
28 platform/common/config.o platform/common/fonts.o platform/common/readpng.o \
29 platform/common/input.o
31 ifeq "$(fake_in_gp2x)" "1"
32 DEFINES += IN_GP2X FAKE_IN_GP2X
33 OBJS += platform/gp2x/in_gp2x.o
37 OBJS += pico/area.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o \
38 pico/videoport.o pico/draw2.o pico/draw.o pico/z80if.o pico/patch.o \
39 pico/mode4.o pico/sms.o pico/misc.o pico/eeprom.o pico/debug.o
41 OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \
42 pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \
43 pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o
45 OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o
47 OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o
49 OBJS += pico/sound/sound.o pico/sound/sn76496.o pico/sound/ym2612.o pico/sound/mix.o
51 OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \
52 pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o
54 OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
55 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
57 OBJS += unzip/unzip.o unzip/unzip_stream.o
59 ifeq "$(use_musashi)" "1"
61 OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
62 #OBJS += cpu/musashi/m68kdasm.o
64 ifeq "$(use_fame)" "1"
66 OBJS += cpu/fame/famec.o
69 ifeq "$(use_mz80)" "1"
71 OBJS += cpu/mz80/mz80.o
74 OBJS += cpu/cz80/cz80.o
78 ifeq "$(use_sh2drc)" "1"
79 DEFINES += DRC_SH2 DRC_TMP
80 OBJS += cpu/sh2/mame/sh2pico.o
81 OBJS += cpu/sh2/compiler.o
82 OBJS += cpu/sh2/stub_x86.o
83 ifeq "$(drc_debug)" "1"
85 OBJS += cpu/sh2/mame/sh2dasm.o
87 LDFLAGS += -lbfd -lopcodes
90 OBJS += cpu/sh2/mame/sh2pico.o
94 ifeq "$(use_fame)" "1"
95 ifeq "$(use_musashi)" "1"
96 OBJS += pico/debugCPU.o
100 CFLAGS += $(addprefix -D,$(DEFINES))
105 DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
106 pico/32x zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80 cpu/sh2/mame cpu/drc
108 all: mkdirs PicoDrive
114 @make -C ../../cpu/mz80/ clean
118 $(CC) $(CFLAGS) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@
123 include ../common/revision.mak
125 pico/carthw/svp/compiler.o : ../../pico/carthw/svp/gen_arm.c
126 pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
127 pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
129 ../../cpu/musashi/m68kops.c :
130 @make -C ../../cpu/musashi
132 cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm
134 @nasm -f elf $< -o $@
136 ../../cpu/mz80/mz80.asm :
137 @make -C ../../cpu/mz80/
141 $(CC) $(CFLAGS) -c $< -o $@
144 $(CC) $(CFLAGS) -c $< -o $@
150 cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
152 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@