1 export CROSS = arm-none-linux-gnueabi-
\r
18 ifeq "$(debug_cyclone)" "1"
\r
22 ifeq "$(use_musashi)" "1"
\r
30 DEFINC = -I../.. -I. -DARM -DPANDORA
\r
31 COPT_COMMON = -static -Wall -Winline
\r
33 COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math
\r
35 COPT_COMMON += -ggdb
\r
37 ifeq "$(profile)" "1"
\r
38 COPT_COMMON += -fprofile-generate
\r
40 ifeq "$(profile)" "2"
\r
41 COPT_COMMON += -fprofile-use
\r
43 COPT = $(COPT_COMMON)
\r
46 STRIP = $(CROSS)strip
\r
49 OBJCOPY = $(CROSS)objcopy
\r
52 OBJS += pandora.o main.o platform/gp2x/menu.o platform/gp2x/usbjoy.o platform/gp2x/emu.o
\r
55 OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \
\r
56 platform/common/arm_utils.o platform/common/mp3_helix.o # platform/common/readpng.o
\r
59 ifeq "$(amalgamate)" "1"
\r
60 OBJS += ../../PicoAll.o
\r
62 OBJS += Pico/Area.o Pico/Cart.o Pico/Memory.o Pico/Misc.o Pico/Pico.o Pico/Sek.o \
\r
63 Pico/VideoPort.o Pico/Draw2.o Pico/Draw.o Pico/Patch.o Pico/Debug.o
\r
65 OBJS += Pico/cd/Pico.o Pico/cd/Memory.o Pico/cd/Sek.o Pico/cd/LC89510.o \
\r
66 Pico/cd/cd_sys.o Pico/cd/cd_file.o Pico/cd/cue.o Pico/cd/gfx_cd.o \
\r
67 Pico/cd/Area.o Pico/cd/Misc.o Pico/cd/pcm.o Pico/cd/buffering.o
\r
70 OBJS += Pico/Pico/Pico.o Pico/Pico/Memory.o Pico/Pico/xpcm.o
\r
72 OBJS += Pico/carthw/carthw.o Pico/carthw/svp/svp.o Pico/carthw/svp/Memory.o \
\r
73 Pico/carthw/svp/ssp16.o Pico/carthw/svp/compiler.o Pico/carthw/svp/stub_arm.o
\r
76 ifeq "$(asm_render)" "1"
\r
77 DEFINC += -D_ASM_DRAW_C
\r
78 OBJS += Pico/draw_asm.o Pico/draw2_asm.o
\r
80 ifeq "$(asm_memory)" "1"
\r
81 DEFINC += -D_ASM_MEMORY_C
\r
82 OBJS += Pico/memory_asm.o
\r
84 ifeq "$(asm_ym2612)" "1"
\r
85 DEFINC += -D_ASM_YM2612_C
\r
86 OBJS += Pico/sound/ym2612_asm.o
\r
88 ifeq "$(asm_misc)" "1"
\r
89 DEFINC += -D_ASM_MISC_C
\r
90 OBJS += Pico/misc_asm.o
\r
91 OBJS += Pico/cd/misc_asm.o
\r
93 ifeq "$(asm_cdpico)" "1"
\r
94 DEFINC += -D_ASM_CD_PICO_C
\r
95 OBJS += Pico/cd/pico_asm.o
\r
97 ifeq "$(asm_cdmemory)" "1"
\r
98 DEFINC += -D_ASM_CD_MEMORY_C
\r
99 OBJS += Pico/cd/memory_asm.o
\r
103 ifneq "$(amalgamate)" "1"
\r
104 OBJS += Pico/sound/sound.o
\r
106 OBJS += Pico/sound/mix_asm.o
\r
107 OBJS += Pico/sound/sn76496.o Pico/sound/ym2612.o
\r
109 OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \
\r
110 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o
\r
112 OBJS += unzip/unzip.o unzip/unzip_stream.o
\r
114 ifeq "$(debug_cyclone)" "1"
\r
115 OBJS += Pico/DebugCPU.o cpu/musashi/m68kdasm.o
\r
118 ifeq "$(use_musashi)" "1"
\r
119 DEFINC += -DEMU_M68K
\r
120 OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o
\r
122 ifeq "$(use_cyclone)" "1"
\r
123 DEFINC += -DEMU_C68K
\r
124 OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o
\r
128 DEFINC += -D_USE_MZ80
\r
129 OBJS += cpu/mz80/mz80.o
\r
131 DEFINC += -D_USE_DRZ80
\r
132 OBJS += cpu/DrZ80/drz80.o
\r
138 DIRS = platform platform/gp2x platform/common Pico Pico/cd Pico/Pico Pico/sound Pico/carthw/svp \
\r
139 zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools cpu/mz80 cpu/DrZ80
\r
142 all: mkdirs PicoDrive
\r
144 PicoDrive : $(OBJS) ../common/helix/helix_mp3.a
\r
146 $(GCC) -o $@ $(COPT) $^ -lm -Wl,-Map=PicoDrive.map # -lpng
\r
157 # rm -rf $(DIRS) # don't clean, gcda may be there
\r
158 # @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean
\r
162 find ../.. -name '*.gcno' -delete
\r
163 find ../.. -name '*.gcda' -delete
\r
171 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
174 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
177 $(GCC) $(COPT) $(DEFINC) -c $< -o $@
\r
179 Pico/carthw/svp/compiler.o : ../../Pico/carthw/svp/ssp16.o ../../Pico/carthw/svp/gen_arm.c
\r
181 Pico/draw_asm.o : ../../Pico/Draw.s
\r
183 $(AS) $(ASOPT) $< -o $@
\r
184 Pico/draw2_asm.o : ../../Pico/Draw2.s
\r
186 $(AS) $(ASOPT) $< -o $@
\r
187 Pico/memory_asm.o : ../../Pico/Memory.s
\r
189 $(AS) $(ASOPT) $< -o $@
\r
190 Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s
\r
192 $(AS) $(ASOPT) $< -o $@
\r
193 Pico/sound/mix_asm.o : ../../Pico/sound/mix.s
\r
195 $(AS) $(ASOPT) $< -o $@
\r
196 Pico/misc_asm.o : ../../Pico/Misc.s
\r
198 $(AS) $(ASOPT) $< -o $@
\r
199 Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s
\r
201 $(AS) $(ASOPT) $< -o $@
\r
202 Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s
\r
204 $(AS) $(ASOPT) $< -o $@
\r
205 Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s
\r
207 $(AS) $(ASOPT) $< -o $@
\r
210 ../../cpu/Cyclone/proj/Cyclone.s :
\r
211 @echo building Cyclone...
\r
212 @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h
\r
214 ../../cpu/musashi/m68kops.c :
\r
215 @make -C ../../cpu/musashi
\r
217 Pico/Pico.o Pico/cd/Pico.o: ../../Pico/PicoFrameHints.c ../../Pico/PicoInt.h
\r
218 Pico/Memory.o Pico/cd/Memory.o : ../../Pico/MemoryCmn.c ../../Pico/PicoInt.h
\r
221 ../common/helix/helix_mp3.a:
\r
222 make -C ../common/helix
\r
224 readme.txt: ../../tools/textfilter ../base_readme.txt
\r
225 ../../tools/textfilter ../base_readme.txt $@ GP2X
\r
227 ../../tools/textfilter: ../../tools/textfilter.c
\r
228 make -C ../../tools/ textfilter
\r
231 # ----------- release -----------
\r
232 ifneq ($(findstring rel,$(MAKECMDGOALS)),)
\r