cc68a136 |
1 | # settings |
d26dc685 |
2 | use_musashi = 1 |
3 | #use_fame = 1 |
80db4442 |
4 | #use_mz80 = 1 |
1fb0dd88 |
5 | #profile = 1 |
19e1d027 |
6 | #fake_in_gp2x = 1 |
cc68a136 |
7 | |
19e1d027 |
8 | -include Makefile.local |
cc68a136 |
9 | |
10 | ifeq "$(profile)" "1" |
19e1d027 |
11 | CFLAGS += -O3 -Wall |
12 | CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math |
13 | CFLAGS += -fprofile-generate |
cc68a136 |
14 | else |
19e1d027 |
15 | CFLAGS = -ggdb -Wall |
cc68a136 |
16 | endif |
19e1d027 |
17 | DEFINES = __GP2X__ _UNZIP_SUPPORT IO_STATS IN_EVDEV |
18 | CFLAGS += -I../.. -I. |
cc68a136 |
19 | |
20 | # gtk |
19e1d027 |
21 | CFLAGS += `pkg-config --cflags gtk+-2.0` |
cc68a136 |
22 | LDFLAGS += `pkg-config --libs gtk+-2.0` |
19e1d027 |
23 | CFLAGS += `pkg-config --cflags gthread-2.0` |
cc68a136 |
24 | LDFLAGS += `pkg-config --libs gthread-2.0` |
25 | |
26 | # frontend |
1fb0dd88 |
27 | OBJS += platform/gp2x/main.o platform/gp2x/emu.o platform/gp2x/plat.o usbjoy.o blit.o \ |
713c9224 |
28 | in_evdev.o plat.o sndout_oss.o gp2x.o 940ctl_ym2612.o log_io.o |
e5f426aa |
29 | |
30 | # common |
58c86d00 |
31 | OBJS += platform/common/emu.o platform/common/menu.o platform/common/config.o platform/common/fonts.o \ |
7e4c661a |
32 | platform/common/readpng.o platform/common/input.o platform/common/mp3_helix.o |
e5f426aa |
33 | |
19e1d027 |
34 | ifeq "$(fake_in_gp2x)" "1" |
35 | DEFINES += IN_GP2X FAKE_IN_GP2X |
36 | OBJS += platform/gp2x/in_gp2x.o |
37 | endif |
38 | |
cc68a136 |
39 | # Pico |
efcba75f |
40 | OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o \ |
41 | pico/videoport.o pico/draw2.o pico/draw.o pico/patch.o pico/debug.o |
cc68a136 |
42 | # Pico - CD |
efcba75f |
43 | OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \ |
44 | pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \ |
45 | pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.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 \ |
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 |
03e4f2a3 |
62 | endif |
63 | ifeq "$(use_fame)" "1" |
19e1d027 |
64 | DEFINES += EMU_F68K |
2445b7cb |
65 | OBJS += cpu/fame/famec.o |
70357ce5 |
66 | endif |
80db4442 |
67 | # z80 |
68 | ifeq "$(use_mz80)" "1" |
19e1d027 |
69 | DEFINES += _USE_MZ80 |
2445b7cb |
70 | OBJS += cpu/mz80/mz80.o |
80db4442 |
71 | else |
19e1d027 |
72 | DEFINES += _USE_CZ80 |
2445b7cb |
73 | OBJS += cpu/cz80/cz80.o |
80db4442 |
74 | endif |
03e4f2a3 |
75 | # misc |
76 | ifeq "$(use_fame)" "1" |
77 | ifeq "$(use_musashi)" "1" |
efcba75f |
78 | OBJS += pico/debugCPU.o |
2445b7cb |
79 | OBJS += cpu/musashi/m68kdasm.o |
03e4f2a3 |
80 | endif |
81 | endif |
efcba75f |
82 | OBJS += cpu/musashi/m68kdasm.o |
cc68a136 |
83 | |
19e1d027 |
84 | CFLAGS += $(addprefix -D,$(DEFINES)) |
85 | |
2445b7cb |
86 | vpath %.c = ../.. |
19e1d027 |
87 | |
efcba75f |
88 | DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \ |
f53f286a |
89 | zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80 |
cc68a136 |
90 | |
2445b7cb |
91 | all: mkdirs PicoDrive |
cc68a136 |
92 | clean: tidy |
93 | @$(RM) PicoDrive |
94 | tidy: |
2445b7cb |
95 | $(RM) $(OBJS) |
96 | rm -rf $(DIRS) |
cc68a136 |
97 | @make -C ../../cpu/mz80/ clean |
7d4906bf |
98 | @make -C ../common/helix/ X86=1 clean |
cc68a136 |
99 | |
7d4906bf |
100 | PicoDrive : $(OBJS) ../common/helix/helix_mp3_x86.a |
03e4f2a3 |
101 | @echo ">>>" $@ |
19e1d027 |
102 | $(CC) $(CFLAGS) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@ |
cc68a136 |
103 | |
2445b7cb |
104 | mkdirs: |
105 | mkdir -p $(DIRS) |
cc68a136 |
106 | |
efcba75f |
107 | pico/carthw/svp/compiler.o : ../../pico/carthw/svp/gen_arm.c |
108 | pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h |
109 | pico/memory.o pico/cd/memory.o : ../../pico/memory_cmn.c ../../pico/pico_int.h |
14565041 |
110 | |
e5503e2f |
111 | ../../cpu/musashi/m68kops.c : |
112 | @make -C ../../cpu/musashi |
113 | |
2445b7cb |
114 | cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm |
cc68a136 |
115 | @echo $@ |
116 | @nasm -f elf $< -o $@ |
117 | |
118 | ../../cpu/mz80/mz80.asm : |
119 | @make -C ../../cpu/mz80/ |
120 | |
7d4906bf |
121 | ../common/helix/helix_mp3_x86.a: |
122 | @make -C ../common/helix/ X86=1 clean all |
01bc6b19 |
123 | |
cc68a136 |
124 | .c.o: |
03e4f2a3 |
125 | @echo ">>>" $< |
19e1d027 |
126 | $(CC) $(CFLAGS) -c $< -o $@ |
cc68a136 |
127 | .s.o: |
03e4f2a3 |
128 | @echo ">>>" $< |
19e1d027 |
129 | $(CC) $(CFLAGS) -c $< -o $@ |
cc68a136 |
130 | |
131 | |
19e1d027 |
132 | #pico/sound/ym2612.o : ../../pico/sound/ym2612.c |
133 | # @echo ">>>" $@ |
134 | # $(CC) $(CFLAGS) -c $< -o $@ |
03e4f2a3 |
135 | |
2445b7cb |
136 | cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h |
03e4f2a3 |
137 | @echo ">>>" $< |
19e1d027 |
138 | $(CC) $(CFLAGS) -Wno-unused -c $< -o $@ |
70357ce5 |
139 | |