720ee7f6 |
1 | # settings |
31d5892a |
2 | use_musashi = 1 |
3 | #use_fame = 1 |
a52e1f62 |
4 | #use_mz80 = 1 |
24b24674 |
5 | #profile = 1 |
73a85369 |
6 | #fake_in_gp2x = 1 |
720ee7f6 |
7 | |
73a85369 |
8 | -include Makefile.local |
720ee7f6 |
9 | |
10 | ifeq "$(profile)" "1" |
73a85369 |
11 | CFLAGS += -O3 -Wall |
12 | CFLAGS += -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math |
13 | CFLAGS += -fprofile-generate |
720ee7f6 |
14 | else |
73a85369 |
15 | CFLAGS = -ggdb -Wall |
720ee7f6 |
16 | endif |
046c4540 |
17 | DEFINES = _UNZIP_SUPPORT IO_STATS IN_EVDEV |
73a85369 |
18 | CFLAGS += -I../.. -I. |
720ee7f6 |
19 | |
20 | # gtk |
73a85369 |
21 | CFLAGS += `pkg-config --cflags gtk+-2.0` |
720ee7f6 |
22 | LDFLAGS += `pkg-config --libs gtk+-2.0` |
73a85369 |
23 | CFLAGS += `pkg-config --cflags gthread-2.0` |
720ee7f6 |
24 | LDFLAGS += `pkg-config --libs gthread-2.0` |
25 | |
26 | # frontend |
046c4540 |
27 | OBJS += platform/gp2x/emu.o blit.o in_evdev.o plat.o sndout_oss.o gp2x.o log_io.o |
c7a4ff64 |
28 | |
29 | # common |
046c4540 |
30 | OBJS += platform/common/main.o platform/common/emu.o platform/common/menu.o \ |
31 | platform/common/config.o platform/common/fonts.o platform/common/readpng.o \ |
32 | platform/common/input.o |
c7a4ff64 |
33 | |
73a85369 |
34 | ifeq "$(fake_in_gp2x)" "1" |
35 | DEFINES += IN_GP2X FAKE_IN_GP2X |
36 | OBJS += platform/gp2x/in_gp2x.o |
37 | endif |
38 | |
720ee7f6 |
39 | # Pico |
f11bad75 |
40 | OBJS += pico/area.o pico/cart.o pico/memory.o pico/misc.o pico/pico.o pico/sek.o \ |
c248cc08 |
41 | pico/videoport.o pico/draw2.o pico/draw.o pico/z80if.o pico/patch.o pico/debug.o |
720ee7f6 |
42 | # Pico - CD |
f11bad75 |
43 | OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \ |
046c4540 |
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 |
9fe01b96 |
46 | # Pico - Pico |
f11bad75 |
47 | OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o |
720ee7f6 |
48 | # Pico - sound |
f11bad75 |
49 | OBJS += pico/sound/sound.o pico/sound/sn76496.o pico/sound/ym2612.o pico/sound/mix.o |
385a157e |
50 | # Pico - carthw |
f11bad75 |
51 | OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \ |
046c4540 |
52 | pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o |
720ee7f6 |
53 | # zlib |
93c0d147 |
54 | OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ |
6d741b32 |
55 | zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o |
720ee7f6 |
56 | # unzip |
93c0d147 |
57 | OBJS += unzip/unzip.o unzip/unzip_stream.o |
720ee7f6 |
58 | # CPU cores |
a52e1f62 |
59 | ifeq "$(use_musashi)" "1" |
73a85369 |
60 | DEFINES += EMU_M68K |
93c0d147 |
61 | OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o |
157a266e |
62 | OBJS += cpu/musashi/m68kdasm.o |
faffbf2d |
63 | endif |
64 | ifeq "$(use_fame)" "1" |
73a85369 |
65 | DEFINES += EMU_F68K |
93c0d147 |
66 | OBJS += cpu/fame/famec.o |
2b90fc61 |
67 | endif |
a52e1f62 |
68 | # z80 |
69 | ifeq "$(use_mz80)" "1" |
73a85369 |
70 | DEFINES += _USE_MZ80 |
93c0d147 |
71 | OBJS += cpu/mz80/mz80.o |
a52e1f62 |
72 | else |
73a85369 |
73 | DEFINES += _USE_CZ80 |
93c0d147 |
74 | OBJS += cpu/cz80/cz80.o |
a52e1f62 |
75 | endif |
faffbf2d |
76 | # misc |
77 | ifeq "$(use_fame)" "1" |
78 | ifeq "$(use_musashi)" "1" |
f11bad75 |
79 | OBJS += pico/debugCPU.o |
faffbf2d |
80 | endif |
81 | endif |
720ee7f6 |
82 | |
73a85369 |
83 | CFLAGS += $(addprefix -D,$(DEFINES)) |
84 | |
93c0d147 |
85 | vpath %.c = ../.. |
73a85369 |
86 | |
f11bad75 |
87 | DIRS = platform platform/gp2x platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \ |
385a157e |
88 | zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80 |
720ee7f6 |
89 | |
93c0d147 |
90 | all: mkdirs PicoDrive |
720ee7f6 |
91 | clean: tidy |
92 | @$(RM) PicoDrive |
93 | tidy: |
93c0d147 |
94 | $(RM) $(OBJS) |
95 | rm -rf $(DIRS) |
720ee7f6 |
96 | @make -C ../../cpu/mz80/ clean |
703e4c7b |
97 | @make -C ../common/helix/ X86=1 clean |
720ee7f6 |
98 | |
703e4c7b |
99 | PicoDrive : $(OBJS) ../common/helix/helix_mp3_x86.a |
faffbf2d |
100 | @echo ">>>" $@ |
73a85369 |
101 | $(CC) $(CFLAGS) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@ |
720ee7f6 |
102 | |
93c0d147 |
103 | mkdirs: |
104 | mkdir -p $(DIRS) |
720ee7f6 |
105 | |
f11bad75 |
106 | pico/carthw/svp/compiler.o : ../../pico/carthw/svp/gen_arm.c |
107 | pico/pico.o pico/cd/pico.o : ../../pico/pico_cmn.c ../../pico/pico_int.h |
108 | pico/memory.o pico/cd/memory.o : ../../pico/memory_cmn.c ../../pico/pico_int.h |
5354c909 |
109 | platform/common/menu.o : revision.h |
110 | |
111 | revision.h: |
112 | @echo "#define REVISION \"`svn info | grep Revision | cut -c 11-`\"" > /tmp/r.tmp |
113 | @diff -q $@ /tmp/r.tmp > /dev/null 2>&1 || mv -f /tmp/r.tmp $@ |
bcf6c349 |
114 | |
dc1782ad |
115 | ../../cpu/musashi/m68kops.c : |
116 | @make -C ../../cpu/musashi |
117 | |
93c0d147 |
118 | cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm |
720ee7f6 |
119 | @echo $@ |
120 | @nasm -f elf $< -o $@ |
121 | |
122 | ../../cpu/mz80/mz80.asm : |
123 | @make -C ../../cpu/mz80/ |
124 | |
703e4c7b |
125 | ../common/helix/helix_mp3_x86.a: |
126 | @make -C ../common/helix/ X86=1 clean all |
d9a18943 |
127 | |
720ee7f6 |
128 | .c.o: |
faffbf2d |
129 | @echo ">>>" $< |
73a85369 |
130 | $(CC) $(CFLAGS) -c $< -o $@ |
720ee7f6 |
131 | .s.o: |
faffbf2d |
132 | @echo ">>>" $< |
73a85369 |
133 | $(CC) $(CFLAGS) -c $< -o $@ |
720ee7f6 |
134 | |
135 | |
73a85369 |
136 | #pico/sound/ym2612.o : ../../pico/sound/ym2612.c |
137 | # @echo ">>>" $@ |
138 | # $(CC) $(CFLAGS) -c $< -o $@ |
faffbf2d |
139 | |
93c0d147 |
140 | cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h |
faffbf2d |
141 | @echo ">>>" $< |
73a85369 |
142 | $(CC) $(CFLAGS) -Wno-unused -c $< -o $@ |
2b90fc61 |
143 | |