asm for PicoDoHighPal555
[picodrive.git] / platform / pandora / Makefile
... / ...
CommitLineData
1export CROSS = arm-none-linux-gnueabi-\r
2\r
3# settings\r
4#mz80 = 1\r
5#debug_cyclone = 1\r
6asm_memory = 1\r
7asm_render = 1\r
8asm_ym2612 = 1\r
9asm_misc = 1\r
10asm_cdpico = 1\r
11asm_cdmemory = 1\r
12amalgamate = 0\r
13#profile = 1\r
14#use_musashi = 1\r
15#up = 1\r
16\r
17\r
18ifeq "$(debug_cyclone)" "1"\r
19use_cyclone = 1\r
20use_musashi = 1\r
21endif\r
22ifeq "$(use_musashi)" "1"\r
23asm_cdpico = 0\r
24asm_memory = 0\r
25asm_cdmemory = 0\r
26else\r
27use_cyclone = 1\r
28endif\r
29\r
30DEFINC = -I../.. -I. -DARM -DPANDORA\r
31COPT_COMMON = -static -Wall -Winline\r
32ifeq ($(DEBUG),)\r
33COPT_COMMON += -O3 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r
34else\r
35COPT_COMMON += -ggdb\r
36endif\r
37ifeq "$(profile)" "1"\r
38COPT_COMMON += -fprofile-generate\r
39endif\r
40ifeq "$(profile)" "2"\r
41COPT_COMMON += -fprofile-use\r
42endif\r
43COPT = $(COPT_COMMON)\r
44ASOPT =\r
45GCC = $(CROSS)gcc\r
46STRIP = $(CROSS)strip\r
47AS = $(CROSS)as\r
48LD = $(CROSS)ld\r
49OBJCOPY = $(CROSS)objcopy\r
50\r
51# frontend\r
52OBJS += pandora.o main.o emu.o platform/gp2x/menu.o platform/gp2x/usbjoy.o\r
53\r
54# common\r
55OBJS += 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
57\r
58# Pico\r
59ifeq "$(amalgamate)" "1"\r
60OBJS += ../../PicoAll.o\r
61else\r
62OBJS += 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
64# Pico - CD\r
65OBJS += 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
68endif\r
69# Pico - Pico\r
70OBJS += Pico/Pico/Pico.o Pico/Pico/Memory.o Pico/Pico/xpcm.o\r
71# Pico - carthw\r
72OBJS += 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
74\r
75# asm stuff\r
76ifeq "$(asm_render)" "1"\r
77DEFINC += -D_ASM_DRAW_C\r
78OBJS += Pico/draw_asm.o Pico/draw2_asm.o\r
79endif\r
80ifeq "$(asm_memory)" "1"\r
81DEFINC += -D_ASM_MEMORY_C\r
82OBJS += Pico/memory_asm.o\r
83endif\r
84ifeq "$(asm_ym2612)" "1"\r
85DEFINC += -D_ASM_YM2612_C\r
86OBJS += Pico/sound/ym2612_asm.o\r
87endif\r
88ifeq "$(asm_misc)" "1"\r
89DEFINC += -D_ASM_MISC_C\r
90OBJS += Pico/misc_asm.o\r
91OBJS += Pico/cd/misc_asm.o\r
92endif\r
93ifeq "$(asm_cdpico)" "1"\r
94DEFINC += -D_ASM_CD_PICO_C\r
95OBJS += Pico/cd/pico_asm.o\r
96endif\r
97ifeq "$(asm_cdmemory)" "1"\r
98DEFINC += -D_ASM_CD_MEMORY_C\r
99OBJS += Pico/cd/memory_asm.o\r
100endif\r
101\r
102# Pico - sound\r
103ifneq "$(amalgamate)" "1"\r
104OBJS += Pico/sound/sound.o\r
105endif\r
106OBJS += Pico/sound/mix_asm.o\r
107OBJS += Pico/sound/sn76496.o Pico/sound/ym2612.o\r
108# zlib\r
109OBJS += 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
111# unzip\r
112OBJS += unzip/unzip.o unzip/unzip_stream.o\r
113# debug\r
114ifeq "$(debug_cyclone)" "1"\r
115OBJS += Pico/DebugCPU.o cpu/musashi/m68kdasm.o\r
116endif\r
117# CPU cores\r
118ifeq "$(use_musashi)" "1"\r
119DEFINC += -DEMU_M68K\r
120OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r
121endif\r
122ifeq "$(use_cyclone)" "1"\r
123DEFINC += -DEMU_C68K\r
124OBJS += cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r
125endif\r
126# drz80/mz80\r
127ifeq "$(mz80)" "1"\r
128DEFINC += -D_USE_MZ80\r
129OBJS += cpu/mz80/mz80.o\r
130else\r
131DEFINC += -D_USE_DRZ80\r
132OBJS += cpu/DrZ80/drz80.o\r
133endif\r
134\r
135vpath %.c = ../..\r
136vpath %.s = ../..\r
137vpath %.S = ../..\r
138DIRS = 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
140\r
141\r
142all: mkdirs PicoDrive\r
143\r
144PicoDrive : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r
145 @echo ">>>" $@\r
146 $(GCC) -o $@ $(COPT) $^ -lm -Wl,-Map=PicoDrive.map # -lpng\r
147ifeq ($(DEBUG),)\r
148 $(STRIP) $@\r
149endif\r
150\r
151\r
152# cleanup\r
153clean: tidy\r
154 $(RM) PicoDrive\r
155tidy:\r
156 $(RM) $(OBJS)\r
157# rm -rf $(DIRS) # don't clean, gcda may be there\r
158# @make -C ../../cpu/Cyclone/proj -f Makefile.linux clean\r
159\r
160\r
161clean_prof:\r
162 find ../.. -name '*.gcno' -delete\r
163 find ../.. -name '*.gcda' -delete\r
164\r
165\r
166mkdirs:\r
167 mkdir -p $(DIRS)\r
168\r
169.c.o:\r
170 @echo ">>>" $<\r
171 $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
172.s.o:\r
173 @echo ">>>" $<\r
174 $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
175.S.o:\r
176 @echo ">>>" $<\r
177 $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r
178\r
179Pico/carthw/svp/compiler.o : ../../Pico/carthw/svp/ssp16.o ../../Pico/carthw/svp/gen_arm.c\r
180\r
181Pico/draw_asm.o : ../../Pico/Draw.s\r
182 @echo ">>>" $<\r
183 $(AS) $(ASOPT) $< -o $@\r
184Pico/draw2_asm.o : ../../Pico/Draw2.s\r
185 @echo ">>>" $<\r
186 $(AS) $(ASOPT) $< -o $@\r
187Pico/memory_asm.o : ../../Pico/Memory.s\r
188 @echo ">>>" $<\r
189 $(AS) $(ASOPT) $< -o $@\r
190Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s\r
191 @echo ">>>" $<\r
192 $(AS) $(ASOPT) $< -o $@\r
193Pico/sound/mix_asm.o : ../../Pico/sound/mix.s\r
194 @echo ">>>" $<\r
195 $(AS) $(ASOPT) $< -o $@\r
196Pico/misc_asm.o : ../../Pico/Misc.s\r
197 @echo ">>>" $<\r
198 $(AS) $(ASOPT) $< -o $@\r
199Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s\r
200 @echo ">>>" $<\r
201 $(AS) $(ASOPT) $< -o $@\r
202Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s\r
203 @echo ">>>" $<\r
204 $(AS) $(ASOPT) $< -o $@\r
205Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s\r
206 @echo ">>>" $<\r
207 $(AS) $(ASOPT) $< -o $@\r
208\r
209# build Cyclone\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
213\r
214../../cpu/musashi/m68kops.c :\r
215 @make -C ../../cpu/musashi\r
216\r
217Pico/Pico.o Pico/cd/Pico.o: ../../Pico/PicoFrameHints.c ../../Pico/PicoInt.h\r
218Pico/Memory.o Pico/cd/Memory.o : ../../Pico/MemoryCmn.c ../../Pico/PicoInt.h\r
219\r
220# build helix libs\r
221../common/helix/$(CROSS)helix-mp3.a:\r
222 make -C ../common/helix clean all\r
223\r
224readme.txt: ../../tools/textfilter ../base_readme.txt\r
225 ../../tools/textfilter ../base_readme.txt $@ GP2X\r
226\r
227../../tools/textfilter: ../../tools/textfilter.c\r
228 make -C ../../tools/ textfilter\r
229\r
230\r
231# ----------- release -----------\r
232ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
233$(error TODO)\r
234ifeq ($(VER),)\r
235$(error need VER)\r
236endif\r
237endif\r
238\r