sprite cache removed
[picodrive.git] / platform / gp2x / Makefile
... / ...
CommitLineData
1\r
2# you may or may not need to change this\r
3#devkit_path = x:/stuff/dev/devkitgp2x/\r
4export CROSS = arm-linux-\r
5#CROSS = $(devkit_path)bin/arm-linux-\r
6\r
7# settings\r
8#mz80 = 1\r
9#debug_cyclone = 1\r
10asm_memory = 1\r
11asm_render = 1\r
12asm_ym2612 = 1\r
13asm_misc = 1\r
14asm_cdpico = 1\r
15asm_cdmemory = 1\r
16amalgamate = 0\r
17#profile = 1\r
18#use_musashi = 1\r
19#up = 1\r
20\r
21\r
22ifeq "$(debug_cyclone)" "1"\r
23use_cyclone = 1\r
24use_musashi = 1\r
25endif\r
26ifeq "$(use_musashi)" "1"\r
27asm_cdpico = 0\r
28asm_memory = 0\r
29asm_cdmemory = 0\r
30else\r
31use_cyclone = 1\r
32endif\r
33\r
34DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK\r
35COPT_COMMON = -static -Wall -Winline\r
36ifeq ($(DEBUG),)\r
37COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
38else\r
39COPT_COMMON += -ggdb\r
40endif\r
41ifeq "$(profile)" "1"\r
42COPT_COMMON += -fprofile-generate\r
43endif\r
44ifeq "$(profile)" "2"\r
45COPT_COMMON += -fprofile-use\r
46endif\r
47COPT = $(COPT_COMMON) -mtune=arm920t\r
48ASOPT = -mcpu=arm920t -mfloat-abi=soft\r
49GCC = $(CROSS)gcc\r
50STRIP = $(CROSS)strip\r
51AS = $(CROSS)as\r
52LD = $(CROSS)ld\r
53OBJCOPY = $(CROSS)objcopy\r
54\r
55# frontend\r
56OBJS += main.o menu.o gp2x.o usbjoy.o emu.o squidgehack.o cpuctrl.o\r
57# 940 core control\r
58OBJS += 940ctl.o\r
59\r
60# common\r
61OBJS += ../common/emu.o ../common/menu.o ../common/fonts.o ../common/config.o ../common/arm_utils.o \\r
62 ../common/readpng.o ../common/mp3_helix.o\r
63\r
64# Pico\r
65ifeq "$(amalgamate)" "1"\r
66OBJS += ../../PicoAll.o\r
67else\r
68OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \\r
69 ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \\r
70 ../../Pico/Patch.o\r
71# Pico - CD\r
72OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r
73 ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/cue.o ../../Pico/cd/gfx_cd.o \\r
74 ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o\r
75endif\r
76# Pico - Pico\r
77OBJS += ../../Pico/Pico/Pico.o ../../Pico/Pico/Memory.o ../../Pico/Pico/xpcm.o\r
78# Pico - carthw\r
79OBJS += ../../Pico/carthw/carthw.o ../../Pico/carthw/svp/svp.o ../../Pico/carthw/svp/Memory.o \\r
80 ../../Pico/carthw/svp/ssp16.o ../../Pico/carthw/svp/compiler.o ../../Pico/carthw/svp/stub_arm.o\r
81\r
82# asm stuff\r
83ifeq "$(asm_render)" "1"\r
84DEFINC += -D_ASM_DRAW_C\r
85OBJS += ../../Pico/draw_asm.o ../../Pico/draw2_asm.o\r
86endif\r
87ifeq "$(asm_memory)" "1"\r
88DEFINC += -D_ASM_MEMORY_C\r
89OBJS += ../../Pico/memory_asm.o\r
90endif\r
91ifeq "$(asm_ym2612)" "1"\r
92DEFINC += -D_ASM_YM2612_C\r
93OBJS += ../../Pico/sound/ym2612_asm.o\r
94endif\r
95ifeq "$(asm_misc)" "1"\r
96DEFINC += -D_ASM_MISC_C\r
97OBJS += ../../Pico/misc_asm.o\r
98OBJS += ../../Pico/cd/misc_asm.o\r
99endif\r
100ifeq "$(asm_cdpico)" "1"\r
101DEFINC += -D_ASM_CD_PICO_C\r
102OBJS += ../../Pico/cd/pico_asm.o\r
103endif\r
104ifeq "$(asm_cdmemory)" "1"\r
105DEFINC += -D_ASM_CD_MEMORY_C\r
106OBJS += ../../Pico/cd/memory_asm.o\r
107endif\r
108\r
109# Pico - sound\r
110ifneq "$(amalgamate)" "1"\r
111OBJS += ../../Pico/sound/sound.o\r
112endif\r
113OBJS += ../../Pico/sound/mix_asm.o\r
114OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o\r
115# zlib\r
116OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \\r
117 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o\r
118# unzip\r
119OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o\r
120# debug\r
121ifeq "$(debug_cyclone)" "1"\r
122OBJS += ../../Pico/Debug.o ../../cpu/musashi/m68kdasm.o\r
123endif\r
124# CPU cores\r
125ifeq "$(use_musashi)" "1"\r
126DEFINC += -DEMU_M68K\r
127OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o\r
128endif\r
129ifeq "$(use_cyclone)" "1"\r
130DEFINC += -DEMU_C68K\r
131OBJS += ../../cpu/Cyclone/proj/Cyclone.o ../../cpu/Cyclone/tools/idle.o\r
132endif\r
133# drz80/mz80\r
134ifeq "$(mz80)" "1"\r
135DEFINC += -D_USE_MZ80\r
136OBJS += ../../cpu/mz80/mz80.o\r
137else\r
138DEFINC += -D_USE_DRZ80\r
139OBJS += ../../cpu/DrZ80/drz80.o\r
140endif\r
141\r
142\r
143all: PicoDrive.gpe\r
144\r
145PicoDrive.gpe : $(OBJS) ../common/helix/helix_mp3.a\r
146 @echo ">>>" $@\r
147 $(GCC) -o $@ $(COPT) $^ -lm -lpng -Wl,-Map=PicoDrive.map\r
148ifeq ($(DEBUG),)\r
149 $(STRIP) $@\r
150endif\r
151\r
152up: PicoDrive.gpe\r
153 @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/emus/PicoDrive/\r
154\r
155# @cmd //C copy PicoDrive.gpe \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\\r
156\r
157\r
158.c.o:\r
159 @echo ">>>" $<\r
160 $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
161.s.o:\r
162 @echo ">>>" $<\r
163 $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
164.S.o:\r
165 @echo ">>>" $<\r
166 $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
167\r
168../../Pico/carthw/svp/compiler.o : ../../Pico/carthw/svp/ssp16.o ../../Pico/carthw/svp/gen_arm.c\r
169\r
170../../Pico/draw_asm.o : ../../Pico/Draw.s\r
171 @echo ">>>" $<\r
172 $(AS) $(ASOPT) $< -o $@\r
173../../Pico/draw2_asm.o : ../../Pico/Draw2.s\r
174 @echo ">>>" $<\r
175 $(AS) $(ASOPT) $< -o $@\r
176../../Pico/memory_asm.o : ../../Pico/Memory.s\r
177 @echo ">>>" $<\r
178 $(AS) $(ASOPT) $< -o $@\r
179../../Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s\r
180 @echo ">>>" $<\r
181 $(AS) $(ASOPT) $< -o $@\r
182../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s\r
183 @echo ">>>" $<\r
184 $(AS) $(ASOPT) $< -o $@\r
185../../Pico/misc_asm.o : ../../Pico/Misc.s\r
186 @echo ">>>" $<\r
187 $(AS) $(ASOPT) $< -o $@\r
188../../Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s\r
189 @echo ">>>" $<\r
190 $(AS) $(ASOPT) $< -o $@\r
191../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s\r
192 @echo ">>>" $<\r
193 $(AS) $(ASOPT) $< -o $@\r
194../../Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s\r
195 @echo ">>>" $<\r
196 $(AS) $(ASOPT) $< -o $@\r
197\r
198# build Cyclone\r
199../../cpu/Cyclone/proj/Cyclone.s :\r
200 @echo building Cyclone...\r
201 @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h\r
202\r
203../../cpu/musashi/m68kops.c :\r
204 @make -C ../../cpu/musashi\r
205\r
206../../Pico/Pico.o : ../../Pico/PicoFrameHints.c ../../Pico/PicoInt.h\r
207../../Pico/Memory.o Pico/cd/Memory.o : ../../Pico/MemoryCmn.c ../../Pico/PicoInt.h\r
208\r
209# build helix libs\r
210../common/helix/helix_mp3.a:\r
211 make -C ../common/helix\r
212\r
213readme.txt: ../../tools/textfilter ../base_readme.txt\r
214 ../../tools/textfilter ../base_readme.txt $@ GP2X\r
215\r
216../../tools/textfilter: ../../tools/textfilter.c\r
217 make -C ../../tools/ textfilter\r
218\r
219\r
220# cleanup\r
221clean: tidy\r
222 $(RM) PicoDrive.gpe\r
223tidy:\r
224 $(RM) $(OBJS)\r
225# @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean\r
226\r
227\r
228clean_prof:\r
229 find ../.. -name '*.gcno' -delete\r
230 find ../.. -name '*.gcda' -delete\r
231\r
232# ----------- release -----------\r
233ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
234ifeq ($(VER),)\r
235$(error need VER)\r
236endif\r
237endif\r
238\r
239rel: PicoDrive.gpe code940/pico940_v2.bin readme.txt PicoDrive.man.txt PicoDrive.png ../game_def.cfg\r
240 zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o\r
241 zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r
242 mkdir bin_to_cso_mp3\r
243 cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/\r
244 zip -9 -r ../../PicoDrive_$(VER).zip bin_to_cso_mp3\r
245 rm -rf bin_to_cso_mp3\r
246\r
247code940/code940.bin:\r
248 make -C code940/\r
249\r