cc68a136 |
1 | # settings |
d26dc685 |
2 | use_musashi = 1 |
3 | #use_fame = 1 |
80db4442 |
4 | #use_mz80 = 1 |
679af8a3 |
5 | use_sh2drc = 1 |
6 | drc_debug = 1 |
1fb0dd88 |
7 | #profile = 1 |
19e1d027 |
8 | #fake_in_gp2x = 1 |
cc68a136 |
9 | |
19e1d027 |
10 | -include Makefile.local |
cc68a136 |
11 | |
12 | ifeq "$(profile)" "1" |
19e1d027 |
13 | CFLAGS += -O3 -Wall |
14 | CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math |
15 | CFLAGS += -fprofile-generate |
cc68a136 |
16 | else |
be20816c |
17 | CFLAGS += -ggdb -Wall -falign-functions=2 |
cc68a136 |
18 | endif |
bcd94522 |
19 | DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV |
19e1d027 |
20 | CFLAGS += -I../.. -I. |
c3a82376 |
21 | LDFLAGS += -lX11 -lpthread |
cc68a136 |
22 | |
23 | # frontend |
bcd94522 |
24 | OBJS += platform/gp2x/emu.o blit.o in_evdev.o plat.o sndout_oss.o gp2x.o log_io.o |
e5f426aa |
25 | |
26 | # common |
bcd94522 |
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 |
e5f426aa |
30 | |
19e1d027 |
31 | ifeq "$(fake_in_gp2x)" "1" |
32 | DEFINES += IN_GP2X FAKE_IN_GP2X |
33 | OBJS += platform/gp2x/in_gp2x.o |
34 | endif |
35 | |
cc68a136 |
36 | # Pico |
45f2f245 |
37 | OBJS += 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 |
41 | OBJS += 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 |
45 | OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o |
9037e45d |
46 | # Pico - Pico |
efcba75f |
47 | OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o |
cc68a136 |
48 | # Pico - sound |
efcba75f |
49 | OBJS += pico/sound/sound.o pico/sound/sn76496.o pico/sound/ym2612.o pico/sound/mix.o |
f53f286a |
50 | # Pico - carthw |
efcba75f |
51 | OBJS += 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 |
54 | OBJS += 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 |
57 | OBJS += unzip/unzip.o unzip/unzip_stream.o |
cc68a136 |
58 | # CPU cores |
80db4442 |
59 | ifeq "$(use_musashi)" "1" |
19e1d027 |
60 | DEFINES += EMU_M68K |
2445b7cb |
61 | OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o |
45f2f245 |
62 | #OBJS += cpu/musashi/m68kdasm.o |
03e4f2a3 |
63 | endif |
64 | ifeq "$(use_fame)" "1" |
19e1d027 |
65 | DEFINES += EMU_F68K |
2445b7cb |
66 | OBJS += cpu/fame/famec.o |
70357ce5 |
67 | endif |
80db4442 |
68 | # z80 |
69 | ifeq "$(use_mz80)" "1" |
19e1d027 |
70 | DEFINES += _USE_MZ80 |
2445b7cb |
71 | OBJS += cpu/mz80/mz80.o |
80db4442 |
72 | else |
19e1d027 |
73 | DEFINES += _USE_CZ80 |
2445b7cb |
74 | OBJS += cpu/cz80/cz80.o |
80db4442 |
75 | endif |
acd35d4c |
76 | # sh2 |
41397701 |
77 | OBJS += cpu/sh2/sh2.o |
78 | ifeq "$(use_sh2drc)" "1" |
679af8a3 |
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" |
84 | DEFINES += DRC_DEBUG |
85 | OBJS += cpu/sh2/mame/sh2dasm.o |
86 | OBJS += host_dasm.o |
87 | LDFLAGS += -lbfd -lopcodes |
88 | endif |
41397701 |
89 | else |
90 | OBJS += cpu/sh2/mame/sh2pico.o |
91 | endif |
92 | OBJS += cpu/drc/cmn.o |
03e4f2a3 |
93 | # misc |
94 | ifeq "$(use_fame)" "1" |
95 | ifeq "$(use_musashi)" "1" |
efcba75f |
96 | OBJS += pico/debugCPU.o |
03e4f2a3 |
97 | endif |
98 | endif |
cc68a136 |
99 | |
19e1d027 |
100 | CFLAGS += $(addprefix -D,$(DEFINES)) |
101 | |
2445b7cb |
102 | vpath %.c = ../.. |
679af8a3 |
103 | vpath %.asm = ../.. |
19e1d027 |
104 | |
efcba75f |
105 | DIRS = 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 |
108 | all: mkdirs PicoDrive |
cc68a136 |
109 | clean: tidy |
110 | @$(RM) PicoDrive |
111 | tidy: |
2445b7cb |
112 | $(RM) $(OBJS) |
113 | rm -rf $(DIRS) |
cc68a136 |
114 | @make -C ../../cpu/mz80/ clean |
115 | |
94d2199e |
116 | PicoDrive : $(OBJS) |
03e4f2a3 |
117 | @echo ">>>" $@ |
19e1d027 |
118 | $(CC) $(CFLAGS) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@ |
cc68a136 |
119 | |
2445b7cb |
120 | mkdirs: |
87b0845f |
121 | @mkdir -p $(DIRS) |
122 | |
123 | include ../common/revision.mak |
cc68a136 |
124 | |
efcba75f |
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 |
af37bca8 |
127 | pico/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 |
132 | cpu/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 |
150 | cpu/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 | |