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/svp/svp.o ../../Pico/carthw/svp/Memory.o ../../Pico/carthw/svp/ssp16.o
\r
80 ifeq "$(asm_render)" "1"
\r
81 DEFINC += -D_ASM_DRAW_C
\r
82 OBJS += ../../Pico/draw_asm.o ../../Pico/draw2_asm.o
\r
84 ifeq "$(asm_memory)" "1"
\r
85 DEFINC += -D_ASM_MEMORY_C
\r
86 OBJS += ../../Pico/memory_asm.o
\r
88 ifeq "$(asm_ym2612)" "1"
\r
89 DEFINC += -D_ASM_YM2612_C
\r
90 OBJS += ../../Pico/sound/ym2612_asm.o
\r
92 ifeq "$(asm_misc)" "1"
\r
93 DEFINC += -D_ASM_MISC_C
\r
94 OBJS += ../../Pico/misc_asm.o
\r
95 OBJS += ../../Pico/cd/misc_asm.o
\r
97 ifeq "$(asm_cdpico)" "1"
\r
98 DEFINC += -D_ASM_CD_PICO_C
\r
99 OBJS += ../../Pico/cd/pico_asm.o
\r
101 ifeq "$(asm_cdmemory)" "1"
\r
102 DEFINC += -D_ASM_CD_MEMORY_C
\r
103 OBJS += ../../Pico/cd/memory_asm.o
\r
107 ifneq "$(amalgamate)" "1"
\r
108 OBJS += ../../Pico/sound/sound.o
\r
110 OBJS += ../../Pico/sound/mix_asm.o
\r
111 OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o
\r
113 OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \
\r
114 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o
\r
116 OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
\r
118 ifeq "$(debug_cyclone)" "1"
\r
119 OBJS += ../../Pico/_cyclone_debug.o ../../cpu/musashi/m68kdasm.o
\r
122 ifeq "$(use_musashi)" "1"
\r
123 DEFINC += -DEMU_M68K
\r
124 OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
\r
126 ifeq "$(use_cyclone)" "1"
\r
127 DEFINC += -DEMU_C68K
\r
128 OBJS += ../../cpu/Cyclone/proj/Cyclone.o
\r
132 DEFINC += -D_USE_MZ80
\r
133 OBJS += ../../cpu/mz80/mz80.o
\r
135 DEFINC += -D_USE_DRZ80
\r
136 OBJS += ../../cpu/DrZ80/drz80.o
\r
142 PicoDrive.gpe : $(OBJS) ../common/helix/helix_mp3.a
\r
144 $(GCC) -o $@ $(COPT) $^ -lm -lpng -Wl,-Map=PicoDrive.map
\r
150 @cp -v PicoDrive.gpe /mnt/gp2x/mnt/sd/emus/PicoDrive/
\r
152 # @cmd //C copy PicoDrive.gpe \\\\10.0.1.2\\gp2x\\mnt\\sd\\games\\PicoDrive\\
\r
157 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
160 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
162 ../../Pico/draw_asm.o : ../../Pico/Draw.s
\r
164 $(AS) $(ASOPT) $< -o $@
\r
165 ../../Pico/draw2_asm.o : ../../Pico/Draw2.s
\r
167 $(AS) $(ASOPT) $< -o $@
\r
168 ../../Pico/memory_asm.o : ../../Pico/Memory.s
\r
170 $(AS) $(ASOPT) $< -o $@
\r
171 ../../Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s
\r
173 $(AS) $(ASOPT) $< -o $@
\r
174 ../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s
\r
176 $(AS) $(ASOPT) $< -o $@
\r
177 ../../Pico/misc_asm.o : ../../Pico/Misc.s
\r
179 $(AS) $(ASOPT) $< -o $@
\r
180 ../../Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s
\r
182 $(AS) $(ASOPT) $< -o $@
\r
183 ../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s
\r
185 $(AS) $(ASOPT) $< -o $@
\r
186 ../../Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s
\r
188 $(AS) $(ASOPT) $< -o $@
\r
191 ../../cpu/Cyclone/proj/Cyclone.s :
\r
192 @echo building Cyclone...
\r
193 @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h
\r
195 ../../cpu/musashi/m68kops.c :
\r
196 @make -C ../../cpu/musashi
\r
200 ../common/helix/helix_mp3.a:
\r
201 make -C ../common/helix
\r
203 readme.txt: ../../tools/textfilter ../base_readme.txt
\r
204 ../../tools/textfilter ../base_readme.txt $@ GP2X
\r
206 ../../tools/textfilter: ../../tools/textfilter.c
\r
207 make -C ../../tools/ textfilter
\r
212 $(RM) PicoDrive.gpe
\r
215 # @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean
\r
219 find ../.. -name '*.gcno' -delete
\r
220 find ../.. -name '*.gcda' -delete
\r
222 # ----------- release -----------
\r
223 ifneq ($(findstring rel,$(MAKECMDGOALS)),)
\r
229 rel: PicoDrive.gpe code940/pico940_v2.bin readme.txt PicoDrive.man.txt PicoDrive.png
\r
230 zip -9 -j ../../PicoDrive_$(VER).zip $^ mmuhack.o
\r
231 zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt
\r
233 code940/code940.bin:
\r