2 # you may or may not need to change this
\r
3 #devkit_path = x:/stuff/dev/devkitgp2x/
\r
4 export CROSS = arm-linux-
\r
5 #CROSS = $(devkit_path)bin/arm-linux-
\r
22 ifeq "$(debug_cyclone)" "1"
\r
26 ifeq "$(use_musashi)" "1"
\r
34 DEFINC = -I../.. -I. -DARM -D__GP2X__ # -DBENCHMARK
\r
35 COPT_COMMON = -static -Wall -Winline
\r
37 COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math
\r
39 COPT_COMMON += -ggdb
\r
41 ifeq "$(profile)" "1"
\r
42 COPT_COMMON += -fprofile-generate
\r
44 ifeq "$(profile)" "2"
\r
45 COPT_COMMON += -fprofile-use
\r
47 COPT = $(COPT_COMMON) -mtune=arm920t
\r
48 ASOPT = -mcpu=arm920t -mfloat-abi=soft
\r
50 STRIP = $(CROSS)strip
\r
53 OBJCOPY = $(CROSS)objcopy
\r
56 OBJS += main.o menu.o gp2x.o usbjoy.o emu.o squidgehack.o cpuctrl.o
\r
61 OBJS += ../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
65 ifeq "$(amalgamate)" "1"
\r
66 OBJS += ../../PicoAll.o
\r
68 OBJS += ../../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
72 OBJS += ../../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
77 OBJS += ../../Pico/Pico/Pico.o ../../Pico/Pico/Memory.o ../../Pico/Pico/xpcm.o
\r
79 OBJS += ../../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
83 ifeq "$(asm_render)" "1"
\r
84 DEFINC += -D_ASM_DRAW_C
\r
85 OBJS += ../../Pico/draw_asm.o ../../Pico/draw2_asm.o
\r
87 ifeq "$(asm_memory)" "1"
\r
88 DEFINC += -D_ASM_MEMORY_C
\r
89 OBJS += ../../Pico/memory_asm.o
\r
91 ifeq "$(asm_ym2612)" "1"
\r
92 DEFINC += -D_ASM_YM2612_C
\r
93 OBJS += ../../Pico/sound/ym2612_asm.o
\r
95 ifeq "$(asm_misc)" "1"
\r
96 DEFINC += -D_ASM_MISC_C
\r
97 OBJS += ../../Pico/misc_asm.o
\r
98 OBJS += ../../Pico/cd/misc_asm.o
\r
100 ifeq "$(asm_cdpico)" "1"
\r
101 DEFINC += -D_ASM_CD_PICO_C
\r
102 OBJS += ../../Pico/cd/pico_asm.o
\r
104 ifeq "$(asm_cdmemory)" "1"
\r
105 DEFINC += -D_ASM_CD_MEMORY_C
\r
106 OBJS += ../../Pico/cd/memory_asm.o
\r
110 ifneq "$(amalgamate)" "1"
\r
111 OBJS += ../../Pico/sound/sound.o
\r
113 OBJS += ../../Pico/sound/mix_asm.o
\r
114 OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o
\r
116 OBJS += ../../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
119 OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
\r
121 ifeq "$(debug_cyclone)" "1"
\r
122 OBJS += ../../Pico/Debug.o ../../cpu/musashi/m68kdasm.o
\r
125 ifeq "$(use_musashi)" "1"
\r
126 DEFINC += -DEMU_M68K
\r
127 OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
\r
129 ifeq "$(use_cyclone)" "1"
\r
130 DEFINC += -DEMU_C68K
\r
131 OBJS += ../../cpu/Cyclone/proj/Cyclone.o ../../cpu/Cyclone/tools/idle.o
\r
135 DEFINC += -D_USE_MZ80
\r
136 OBJS += ../../cpu/mz80/mz80.o
\r
138 DEFINC += -D_USE_DRZ80
\r
139 OBJS += ../../cpu/DrZ80/drz80.o
\r
145 PicoDrive.gpe : $(OBJS) ../common/helix/helix_mp3.a
\r
147 $(GCC) -o $@ $(COPT) $^ -lm -lpng -Wl,-Map=PicoDrive.map
\r
153 @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/emus/PicoDrive/
\r
155 # @cmd //C copy PicoDrive.gpe \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\
\r
160 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
163 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
166 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
168 ../../Pico/carthw/svp/compiler.o : ../../Pico/carthw/svp/ssp16.o ../../Pico/carthw/svp/gen_arm.c
\r
170 ../../Pico/draw_asm.o : ../../Pico/Draw.s
\r
172 $(AS) $(ASOPT) $< -o $@
\r
173 ../../Pico/draw2_asm.o : ../../Pico/Draw2.s
\r
175 $(AS) $(ASOPT) $< -o $@
\r
176 ../../Pico/memory_asm.o : ../../Pico/Memory.s
\r
178 $(AS) $(ASOPT) $< -o $@
\r
179 ../../Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s
\r
181 $(AS) $(ASOPT) $< -o $@
\r
182 ../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s
\r
184 $(AS) $(ASOPT) $< -o $@
\r
185 ../../Pico/misc_asm.o : ../../Pico/Misc.s
\r
187 $(AS) $(ASOPT) $< -o $@
\r
188 ../../Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s
\r
190 $(AS) $(ASOPT) $< -o $@
\r
191 ../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s
\r
193 $(AS) $(ASOPT) $< -o $@
\r
194 ../../Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s
\r
196 $(AS) $(ASOPT) $< -o $@
\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
203 ../../cpu/musashi/m68kops.c :
\r
204 @make -C ../../cpu/musashi
\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
210 ../common/helix/helix_mp3.a:
\r
211 make -C ../common/helix
\r
213 readme.txt: ../../tools/textfilter ../base_readme.txt
\r
214 ../../tools/textfilter ../base_readme.txt $@ GP2X
\r
216 ../../tools/textfilter: ../../tools/textfilter.c
\r
217 make -C ../../tools/ textfilter
\r
222 $(RM) PicoDrive.gpe
\r
225 # @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean
\r
229 find ../.. -name '*.gcno' -delete
\r
230 find ../.. -name '*.gcda' -delete
\r
232 # ----------- release -----------
\r
233 ifneq ($(findstring rel,$(MAKECMDGOALS)),)
\r
239 rel: 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
247 code940/code940.bin:
\r