720ee7f6 |
1 | |
2 | # settings |
31d5892a |
3 | use_musashi = 1 |
4 | #use_fame = 1 |
a52e1f62 |
5 | #use_mz80 = 1 |
2b90fc61 |
6 | |
720ee7f6 |
7 | # profile = 1 |
8 | |
9 | |
15b55b4e |
10 | DEFINC = -I../.. -I. -D__GP2X__ -D_UNZIP_SUPPORT -DIO_STATS # -DBENCHMARK |
720ee7f6 |
11 | GCC = gcc |
12 | STRIP = strip |
13 | AS = gcc |
14 | |
15 | ifeq "$(profile)" "1" |
5ecedd0c |
16 | COPT_COMMON = -s -O3 -ftracer -fstrength-reduce -Wall -funroll-loops -fomit-frame-pointer -fstrict-aliasing -ffast-math -fprofile-generate |
17 | COPT = $(COPT_COMMON) |
720ee7f6 |
18 | else |
19 | COPT = -ggdb -Wall -fno-strict-aliasing # -pg -O3 -ftracer -fstrength-reduce -funroll-loops -fomit-frame-pointer -ffast-math |
20 | COPT_COMMON = $(COPT) |
21 | endif |
22 | |
23 | # gtk |
24 | COPT += `pkg-config --cflags gtk+-2.0` |
25 | LDFLAGS += `pkg-config --libs gtk+-2.0` |
26 | COPT += `pkg-config --cflags gthread-2.0` |
27 | LDFLAGS += `pkg-config --libs gthread-2.0` |
28 | |
29 | # frontend |
93c0d147 |
30 | OBJS += platform/gp2x/main.o platform/gp2x/menu.o platform/gp2x/emu.o platform/gp2x/usbjoy.o blit.o \ |
15b55b4e |
31 | gp2x.o 940ctl_ym2612.o log_io.o |
c7a4ff64 |
32 | |
33 | # common |
0ae25549 |
34 | OBJS += platform/common/emu.o platform/common/menu.o platform/common/config.o platform/common/fonts.o \ |
93c0d147 |
35 | platform/common/readpng.o platform/common/mp3_helix.o |
c7a4ff64 |
36 | |
720ee7f6 |
37 | # Pico |
93c0d147 |
38 | OBJS += Pico/Area.o Pico/Cart.o Pico/Memory.o Pico/Misc.o Pico/Pico.o Pico/Sek.o \ |
39 | Pico/VideoPort.o Pico/Draw2.o Pico/Draw.o Pico/Patch.o |
720ee7f6 |
40 | # Pico - CD |
93c0d147 |
41 | OBJS += Pico/cd/Pico.o Pico/cd/Memory.o Pico/cd/Sek.o Pico/cd/LC89510.o \ |
9fe01b96 |
42 | Pico/cd/cd_sys.o Pico/cd/cd_file.o Pico/cd/cue.o Pico/cd/gfx_cd.o \ |
93c0d147 |
43 | Pico/cd/Area.o Pico/cd/Misc.o Pico/cd/pcm.o Pico/cd/buffering.o |
9fe01b96 |
44 | # Pico - Pico |
46c03dc8 |
45 | OBJS += Pico/Pico/Pico.o Pico/Pico/Memory.o Pico/Pico/xpcm.o |
720ee7f6 |
46 | # Pico - sound |
93c0d147 |
47 | OBJS += Pico/sound/sound.o Pico/sound/sn76496.o Pico/sound/ym2612.o Pico/sound/mix.o |
385a157e |
48 | # Pico - carthw |
12e9e5cf |
49 | OBJS += Pico/carthw/carthw.o Pico/carthw/svp/svp.o Pico/carthw/svp/Memory.o \ |
50 | Pico/carthw/svp/ssp16.o Pico/carthw/svp/compiler.o |
720ee7f6 |
51 | # zlib |
93c0d147 |
52 | OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \ |
6d741b32 |
53 | zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o zlib/uncompr.o |
720ee7f6 |
54 | # unzip |
93c0d147 |
55 | OBJS += unzip/unzip.o unzip/unzip_stream.o |
720ee7f6 |
56 | # CPU cores |
a52e1f62 |
57 | ifeq "$(use_musashi)" "1" |
720ee7f6 |
58 | DEFINC += -DEMU_M68K |
93c0d147 |
59 | OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o |
faffbf2d |
60 | endif |
61 | ifeq "$(use_fame)" "1" |
a52e1f62 |
62 | DEFINC += -DEMU_F68K |
93c0d147 |
63 | OBJS += cpu/fame/famec.o |
2b90fc61 |
64 | endif |
a52e1f62 |
65 | # z80 |
66 | ifeq "$(use_mz80)" "1" |
faffbf2d |
67 | DEFINC += -D_USE_MZ80 |
93c0d147 |
68 | OBJS += cpu/mz80/mz80.o |
a52e1f62 |
69 | else |
faffbf2d |
70 | DEFINC += -D_USE_CZ80 |
93c0d147 |
71 | OBJS += cpu/cz80/cz80.o |
a52e1f62 |
72 | endif |
faffbf2d |
73 | # misc |
74 | ifeq "$(use_fame)" "1" |
75 | ifeq "$(use_musashi)" "1" |
93c0d147 |
76 | OBJS += Pico/Debug.o |
77 | OBJS += cpu/musashi/m68kdasm.o |
faffbf2d |
78 | endif |
79 | endif |
720ee7f6 |
80 | |
93c0d147 |
81 | vpath %.c = ../.. |
9fe01b96 |
82 | DIRS = platform platform/gp2x platform/common Pico Pico/cd Pico/Pico Pico/sound Pico/carthw/svp \ |
385a157e |
83 | zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80 |
720ee7f6 |
84 | |
93c0d147 |
85 | all: mkdirs PicoDrive |
720ee7f6 |
86 | clean: tidy |
87 | @$(RM) PicoDrive |
88 | tidy: |
93c0d147 |
89 | $(RM) $(OBJS) |
90 | rm -rf $(DIRS) |
720ee7f6 |
91 | @make -C ../../cpu/mz80/ clean |
703e4c7b |
92 | @make -C ../common/helix/ X86=1 clean |
720ee7f6 |
93 | |
703e4c7b |
94 | PicoDrive : $(OBJS) ../common/helix/helix_mp3_x86.a |
faffbf2d |
95 | @echo ">>>" $@ |
96 | $(GCC) $(COPT) $^ $(LDFLAGS) -lm -lpng -Wl,-Map=PicoDrive.map -o $@ |
720ee7f6 |
97 | |
93c0d147 |
98 | mkdirs: |
99 | mkdir -p $(DIRS) |
720ee7f6 |
100 | |
b3818d1e |
101 | Pico/carthw/svp/compiler.o : ../../Pico/carthw/svp/gen_arm.c |
4306047f |
102 | Pico/Pico.o Pico/cd/Pico.o : ../../Pico/PicoFrameHints.c ../../Pico/PicoInt.h |
7481dd3a |
103 | Pico/Memory.o Pico/cd/Memory.o : ../../Pico/MemoryCmn.c ../../Pico/PicoInt.h |
bcf6c349 |
104 | |
dc1782ad |
105 | ../../cpu/musashi/m68kops.c : |
106 | @make -C ../../cpu/musashi |
107 | |
93c0d147 |
108 | cpu/mz80/mz80.o : ../../cpu/mz80/mz80.asm |
720ee7f6 |
109 | @echo $@ |
110 | @nasm -f elf $< -o $@ |
111 | |
112 | ../../cpu/mz80/mz80.asm : |
113 | @make -C ../../cpu/mz80/ |
114 | |
703e4c7b |
115 | ../common/helix/helix_mp3_x86.a: |
116 | @make -C ../common/helix/ X86=1 clean all |
d9a18943 |
117 | |
720ee7f6 |
118 | .c.o: |
faffbf2d |
119 | @echo ">>>" $< |
120 | $(GCC) $(COPT) $(DEFINC) -c $< -o $@ |
720ee7f6 |
121 | .s.o: |
faffbf2d |
122 | @echo ">>>" $< |
123 | $(GCC) $(COPT) $(DEFINC) -c $< -o $@ |
720ee7f6 |
124 | |
125 | |
93c0d147 |
126 | Pico/sound/ym2612.o : ../../Pico/sound/ym2612.c |
faffbf2d |
127 | @echo ">>>" $@ |
128 | $(GCC) $(COPT_COMMON) $(DEFINC) -c $< -o $@ |
129 | |
93c0d147 |
130 | cpu/fame/famec.o : ../../cpu/fame/famec.c ../../cpu/fame/famec_opcodes.h |
faffbf2d |
131 | @echo ">>>" $< |
132 | $(GCC) $(COPT) $(DEFINC) -Wno-unused -c $< -o $@ |
720ee7f6 |
133 | |
2b90fc61 |
134 | |