rm unused file
[picodrive.git] / platform / linux / Makefile
CommitLineData
cc68a136 1# settings
d26dc685 2use_musashi = 1
3#use_fame = 1
80db4442 4#use_mz80 = 1
679af8a3 5use_sh2drc = 1
6drc_debug = 1
1fb0dd88 7#profile = 1
19e1d027 8#fake_in_gp2x = 1
cc68a136 9
19e1d027 10-include Makefile.local
cc68a136 11
12ifeq "$(profile)" "1"
19e1d027 13CFLAGS += -O3 -Wall
14CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math
15CFLAGS += -fprofile-generate
cc68a136 16else
be20816c 17CFLAGS += -ggdb -Wall -falign-functions=2
cc68a136 18endif
bcd94522 19DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV
19e1d027 20CFLAGS += -I../.. -I.
c3a82376 21LDFLAGS += -lX11 -lpthread
cc68a136 22
23# frontend
bcd94522 24OBJS += platform/gp2x/emu.o blit.o in_evdev.o plat.o sndout_oss.o gp2x.o log_io.o
e5f426aa 25
26# common
bcd94522 27OBJS += 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
e5f426aa 30
19e1d027 31ifeq "$(fake_in_gp2x)" "1"
32DEFINES += IN_GP2X FAKE_IN_GP2X
33OBJS += platform/gp2x/in_gp2x.o
34endif
35
cc68a136 36# Pico
45f2f245 37OBJS += pico/area.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o \
3e49ffd0 38 pico/videoport.o pico/draw2.o pico/draw.o pico/z80if.o pico/patch.o \
45f2f245 39 pico/mode4.o pico/sms.o pico/misc.o pico/eeprom.o pico/debug.o
cc68a136 40# Pico - CD
efcba75f 41OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \
bcd94522 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
be2c4208 44# Pico - 32X
db1d3564 45OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o
9037e45d 46# Pico - Pico
efcba75f 47OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o
cc68a136 48# Pico - sound
efcba75f 49OBJS += pico/sound/sound.o pico/sound/sn76496.o pico/sound/ym2612.o pico/sound/mix.o
f53f286a 50# Pico - carthw
efcba75f 51OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \
bcd94522 52 pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o
cc68a136 53# zlib
2445b7cb 54OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
71de3cd9 55 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o
cc68a136 56# unzip
2445b7cb 57OBJS += unzip/unzip.o unzip/unzip_stream.o
cc68a136 58# CPU cores
80db4442 59ifeq "$(use_musashi)" "1"
19e1d027 60DEFINES += EMU_M68K
2445b7cb 61OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
45f2f245 62#OBJS += cpu/musashi/m68kdasm.o
03e4f2a3 63endif
64ifeq "$(use_fame)" "1"
19e1d027 65DEFINES += EMU_F68K
2445b7cb 66OBJS += cpu/fame/famec.o
70357ce5 67endif
80db4442 68# z80
69ifeq "$(use_mz80)" "1"
19e1d027 70DEFINES += _USE_MZ80
2445b7cb 71OBJS += cpu/mz80/mz80.o
80db4442 72else
19e1d027 73DEFINES += _USE_CZ80
2445b7cb 74OBJS += cpu/cz80/cz80.o
80db4442 75endif
acd35d4c 76# sh2
41397701 77OBJS += cpu/sh2/sh2.o
78ifeq "$(use_sh2drc)" "1"
679af8a3 79DEFINES += DRC_SH2 DRC_TMP
80OBJS += cpu/sh2/mame/sh2pico.o
81OBJS += cpu/sh2/compiler.o
82OBJS += cpu/sh2/stub_x86.o
83ifeq "$(drc_debug)" "1"
84DEFINES += DRC_DEBUG
85OBJS += cpu/sh2/mame/sh2dasm.o
86OBJS += host_dasm.o
87LDFLAGS += -lbfd -lopcodes
88endif
41397701 89else
90OBJS += cpu/sh2/mame/sh2pico.o
91endif
92OBJS += cpu/drc/cmn.o
03e4f2a3 93# misc
94ifeq "$(use_fame)" "1"
95ifeq "$(use_musashi)" "1"
efcba75f 96OBJS += pico/debugCPU.o
03e4f2a3 97endif
98endif
cc68a136 99
19e1d027 100CFLAGS += $(addprefix -D,$(DEFINES))
101
2445b7cb 102vpath %.c = ../..
679af8a3 103vpath %.asm = ../..
19e1d027 104
efcba75f 105DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \
41397701 106 pico/32x zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80 cpu/sh2/mame cpu/drc
cc68a136 107
2445b7cb 108all: mkdirs PicoDrive
cc68a136 109clean: tidy
110 @$(RM) PicoDrive
111tidy:
2445b7cb 112 $(RM) $(OBJS)
113 rm -rf $(DIRS)
cc68a136 114 @make -C ../../cpu/mz80/ clean
115
94d2199e 116PicoDrive : $(OBJS)
03e4f2a3 117 @echo ">>>" $@
19e1d027 118 $(CC) $(CFLAGS) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@
cc68a136 119
2445b7cb 120mkdirs:
87b0845f 121 @mkdir -p $(DIRS)
122
123include ../common/revision.mak
cc68a136 124
efcba75f 125pico/carthw/svp/compiler.o : ../../pico/carthw/svp/gen_arm.c
126pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h
af37bca8 127pico/memory.o pico/cd/memory.o : ../../pico/pico_int.h ../../pico/memory.h
14565041 128
e5503e2f 129../../cpu/musashi/m68kops.c :
130 @make -C ../../cpu/musashi
131
2445b7cb 132cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm
cc68a136 133 @echo $@
134 @nasm -f elf $< -o $@
135
136../../cpu/mz80/mz80.asm :
137 @make -C ../../cpu/mz80/
138
139.c.o:
03e4f2a3 140 @echo ">>>" $<
19e1d027 141 $(CC) $(CFLAGS) -c $< -o $@
cc68a136 142.s.o:
03e4f2a3 143 @echo ">>>" $<
19e1d027 144 $(CC) $(CFLAGS) -c $< -o $@
679af8a3 145%.o : %.asm
146 @echo ">>>" $<
147 nasm -f elf $< -o $@
cc68a136 148
149
2445b7cb 150cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h
03e4f2a3 151 @echo ">>>" $<
19e1d027 152 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@
70357ce5 153