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/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/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/carthw/carthw.o ../../Pico/carthw/svp/svp.o ../../Pico/carthw/svp/Memory.o \
\r
78 ../../Pico/carthw/svp/ssp16.o ../../Pico/carthw/svp/compiler.o ../../Pico/carthw/svp/stub_arm.o
\r
81 ifeq "$(asm_render)" "1"
\r
82 DEFINC += -D_ASM_DRAW_C
\r
83 OBJS += ../../Pico/draw_asm.o ../../Pico/draw2_asm.o
\r
85 ifeq "$(asm_memory)" "1"
\r
86 DEFINC += -D_ASM_MEMORY_C
\r
87 OBJS += ../../Pico/memory_asm.o
\r
89 ifeq "$(asm_ym2612)" "1"
\r
90 DEFINC += -D_ASM_YM2612_C
\r
91 OBJS += ../../Pico/sound/ym2612_asm.o
\r
93 ifeq "$(asm_misc)" "1"
\r
94 DEFINC += -D_ASM_MISC_C
\r
95 OBJS += ../../Pico/misc_asm.o
\r
96 OBJS += ../../Pico/cd/misc_asm.o
\r
98 ifeq "$(asm_cdpico)" "1"
\r
99 DEFINC += -D_ASM_CD_PICO_C
\r
100 OBJS += ../../Pico/cd/pico_asm.o
\r
102 ifeq "$(asm_cdmemory)" "1"
\r
103 DEFINC += -D_ASM_CD_MEMORY_C
\r
104 OBJS += ../../Pico/cd/memory_asm.o
\r
108 ifneq "$(amalgamate)" "1"
\r
109 OBJS += ../../Pico/sound/sound.o
\r
111 OBJS += ../../Pico/sound/mix_asm.o
\r
112 OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o
\r
114 OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \
\r
115 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o
\r
117 OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
\r
119 ifeq "$(debug_cyclone)" "1"
\r
120 OBJS += ../../Pico/_cyclone_debug.o ../../cpu/musashi/m68kdasm.o
\r
123 ifeq "$(use_musashi)" "1"
\r
124 DEFINC += -DEMU_M68K
\r
125 OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
\r
127 ifeq "$(use_cyclone)" "1"
\r
128 DEFINC += -DEMU_C68K
\r
129 OBJS += ../../cpu/Cyclone/proj/Cyclone.o
\r
133 DEFINC += -D_USE_MZ80
\r
134 OBJS += ../../cpu/mz80/mz80.o
\r
136 DEFINC += -D_USE_DRZ80
\r
137 OBJS += ../../cpu/DrZ80/drz80.o
\r
143 PicoDrive.gpe : $(OBJS) ../common/helix/helix_mp3.a
\r
145 $(GCC) -o $@ $(COPT) $^ -lm -lpng -Wl,-Map=PicoDrive.map
\r
151 @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/emus/PicoDrive/
\r
153 # @cmd //C copy PicoDrive.gpe \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\
\r
158 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
161 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
164 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
166 ../../Pico/carthw/svp/compiler.o : ../../Pico/carthw/svp/ssp16.o ../../Pico/carthw/svp/gen_arm.c
\r
168 ../../Pico/draw_asm.o : ../../Pico/Draw.s
\r
170 $(AS) $(ASOPT) $< -o $@
\r
171 ../../Pico/draw2_asm.o : ../../Pico/Draw2.s
\r
173 $(AS) $(ASOPT) $< -o $@
\r
174 ../../Pico/memory_asm.o : ../../Pico/Memory.s
\r
176 $(AS) $(ASOPT) $< -o $@
\r
177 ../../Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s
\r
179 $(AS) $(ASOPT) $< -o $@
\r
180 ../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s
\r
182 $(AS) $(ASOPT) $< -o $@
\r
183 ../../Pico/misc_asm.o : ../../Pico/Misc.s
\r
185 $(AS) $(ASOPT) $< -o $@
\r
186 ../../Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s
\r
188 $(AS) $(ASOPT) $< -o $@
\r
189 ../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s
\r
191 $(AS) $(ASOPT) $< -o $@
\r
192 ../../Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s
\r
194 $(AS) $(ASOPT) $< -o $@
\r
197 ../../cpu/Cyclone/proj/Cyclone.s :
\r
198 @echo building Cyclone...
\r
199 @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h
\r
201 ../../cpu/musashi/m68kops.c :
\r
202 @make -C ../../cpu/musashi
\r
206 ../common/helix/helix_mp3.a:
\r
207 make -C ../common/helix
\r
209 readme.txt: ../../tools/textfilter ../base_readme.txt
\r
210 ../../tools/textfilter ../base_readme.txt $@ GP2X
\r
212 ../../tools/textfilter: ../../tools/textfilter.c
\r
213 make -C ../../tools/ textfilter
\r
218 $(RM) PicoDrive.gpe
\r
221 # @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean
\r
225 find ../.. -name '*.gcno' -delete
\r
226 find ../.. -name '*.gcda' -delete
\r
228 # ----------- release -----------
\r
229 ifneq ($(findstring rel,$(MAKECMDGOALS)),)
\r
235 rel: PicoDrive.gpe code940/pico940_v2.bin readme.txt PicoDrive.man.txt PicoDrive.png
\r
236 zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o
\r
237 zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt
\r
239 code940/code940.bin:
\r