ABC turbo
[picodrive.git] / platform / psp / Makefile
CommitLineData
1820b5a7 1\r
2# pspdev is expected to be in path\r
3PSPSDK = $(shell psp-config --pspsdk-path)\r
4\r
5# settings\r
70357ce5 6#use_musashi = 1\r
a4221917 7#use_mz80 = 1\r
1820b5a7 8amalgamate = 0\r
2445b7cb 9for_15fw = 1\r
f579f7b8 10# :!touch platform/psp/psp.c\r
1820b5a7 11\r
12\r
110df09c 13CFLAGS += -I../.. -I. -DNO_SYNC\r
8ab3e3c1 14CFLAGS += -Wall -Winline -G0\r
110df09c 15#CFLAGS += -DLPRINTF_STDIO\r
b542be46 16#CFLAGS += -pg\r
1820b5a7 17ifeq ($(DEBUG),)\r
8ab3e3c1 18CFLAGS += -O2 -ftracer -fstrength-reduce -ffast-math\r
1820b5a7 19else\r
20CFLAGS += -ggdb\r
21endif\r
2445b7cb 22ifeq "$(for_15fw)" "1"\r
23CFLAGS += -DFW15\r
24endif\r
1820b5a7 25\r
26\r
2445b7cb 27# frontend and stuff\r
28OBJS += main.o emu.o mp3.o menu.o psp.o asm_utils.o\r
1820b5a7 29\r
30# common\r
8187ba84 31OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o platform/common/readpng.o\r
1820b5a7 32\r
33# Pico\r
34ifeq "$(amalgamate)" "1"\r
35OBJS += ../../PicoAll.o\r
36else\r
f579f7b8 37OBJS += Pico/Area.o Pico/Cart.o Pico/Memory.o Pico/Misc.o Pico/Pico.o Pico/Sek.o Pico/VideoPort.o \\r
38 Pico/Draw2.o Pico/Draw.o Pico/Patch.o Pico/Draw_amips.o Pico/Memory_amips.o \\r
39 Pico/Misc_amips.o Pico/Debug.o\r
1820b5a7 40# Pico - CD\r
8187ba84 41OBJS += Pico/cd/Pico.o Pico/cd/Memory.o Pico/cd/Sek.o Pico/cd/LC89510.o \\r
42 Pico/cd/cd_sys.o Pico/cd/cd_file.o Pico/cd/cue.o Pico/cd/gfx_cd.o \\r
43 Pico/cd/Area.o Pico/cd/Misc.o Pico/cd/pcm.o Pico/cd/buffering.o\r
6fc57144 44# Pico - carthw\r
8187ba84 45OBJS += Pico/carthw/carthw.o Pico/carthw/svp/svp.o Pico/carthw/svp/Memory.o \\r
46 Pico/carthw/svp/ssp16.o\r
c060a9ab 47# Pico - Pico\r
8187ba84 48OBJS += Pico/Pico/Pico.o Pico/Pico/Memory.o Pico/Pico/xpcm.o\r
1820b5a7 49endif\r
50\r
51# Pico - sound\r
52ifneq "$(amalgamate)" "1"\r
8187ba84 53OBJS += Pico/sound/sound.o\r
1820b5a7 54endif\r
8187ba84 55OBJS += Pico/sound/mix.o\r
56OBJS += Pico/sound/sn76496.o Pico/sound/ym2612.o\r
1820b5a7 57# zlib (hacked)\r
8187ba84 58OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r
59 zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o \\r
60 zlib/uncompr.o\r
1820b5a7 61# unzip\r
8187ba84 62OBJS += unzip/unzip.o unzip/unzip_stream.o\r
1820b5a7 63# CPU cores\r
64ifeq "$(use_musashi)" "1"\r
65CFLAGS += -DEMU_M68K\r
8187ba84 66OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r
70357ce5 67else\r
68CFLAGS += -DEMU_F68K\r
8187ba84 69OBJS += cpu/fame/famec.o\r
1820b5a7 70endif\r
71# z80\r
72ifeq "$(use_mz80)" "1"\r
73CFLAGS += -D_USE_MZ80\r
8187ba84 74OBJS += cpu/mz80/mz80.o\r
1820b5a7 75else\r
a4221917 76CFLAGS += -D_USE_CZ80\r
8187ba84 77OBJS += cpu/cz80/cz80.o\r
1820b5a7 78endif\r
8ab3e3c1 79# bg images\r
80OBJS += data/bg32.o data/bg40.o\r
1820b5a7 81\r
8187ba84 82vpath %.c = ../..\r
83vpath %.s = ../..\r
84DIRS = platform platform/psp platform/common Pico Pico/cd Pico/Pico Pico/sound Pico/carthw/svp \\r
85 zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80\r
86\r
1820b5a7 87\r
aefb65bc 88LIBS += -lpng -lm -lpspgu -lpsppower -lpspaudio -lpsprtc -lpspaudiocodec -lpspkubridge\r
b542be46 89#LIBS += -lpspprof\r
4b167c12 90LDFLAGS += -Wl,-Map=PicoDrive.map\r
1820b5a7 91\r
b542be46 92\r
1820b5a7 93# target\r
94TARGET = PicoDrive\r
8187ba84 95EXTRA_TARGETS = mkdirs EBOOT.PBP\r
9caf44b5 96PSP_EBOOT_TITLE = PicoDrive\r
3ec29f01 97PSP_EBOOT_ICON = data/icon.png\r
1820b5a7 98#PSP_EBOOT_PIC1 = .png\r
2445b7cb 99ifneq "$(for_15fw)" "1"\r
110df09c 100BUILD_PRX = 1\r
2445b7cb 101endif\r
1820b5a7 102\r
103CUSTOM_CLEAN = myclean\r
104\r
105include $(PSPSDK)/lib/build.mak\r
106\r
1820b5a7 107# some additional rules\r
8187ba84 108mkdirs:\r
109 mkdir -p $(DIRS)\r
110\r
1820b5a7 111.c.o:\r
112 @echo ">>>" $<\r
113 $(CC) $(CFLAGS) -c $< -o $@\r
114\r
70357ce5 115AS := psp-as\r
116\r
117.s.o:\r
118 @echo ">>>" $<\r
119 $(AS) -march=allegrex -mtune=allegrex $< -o $@\r
120\r
1820b5a7 121../../cpu/musashi/m68kops.c :\r
122 make -C ../../cpu/musashi\r
123\r
8187ba84 124cpu/fame/famec.o : ../../cpu/fame/famec.c\r
3ec29f01 125 @echo ">>>" $<\r
126 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@\r
127\r
8187ba84 128Pico/Memory.o : ../../Pico/Memory.c\r
3ec29f01 129 @echo ">>>" $<\r
8b99ab90 130 $(CC) $(CFLAGS) -O2 -c $< -o $@ -D_ASM_MEMORY_C -D_ASM_MEMORY_C_AMIPS\r
131\r
8187ba84 132Pico/cd/Memory.o : ../../Pico/cd/Memory.c\r
8b99ab90 133 @echo ">>>" $<\r
134 $(CC) $(CFLAGS) -O2 -c $< -o $@\r
3ec29f01 135\r
8187ba84 136Pico/Draw.o : ../../Pico/Draw.c\r
3ec29f01 137 @echo ">>>" $<\r
b542be46 138 $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_DRAW_C_AMIPS\r
139\r
8187ba84 140Pico/Misc.o : ../../Pico/Misc.c\r
b542be46 141 @echo ">>>" $<\r
142 $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_MISC_C_AMIPS\r
3ec29f01 143\r
8187ba84 144Pico/cd/gfx_cd.o : ../../Pico/cd/gfx_cd.c\r
8b99ab90 145 @echo ">>>" $<\r
146 $(CC) $(CFLAGS) -O2 -c $< -o $@\r
147\r
1820b5a7 148readme.txt: ../../tools/textfilter ../base_readme.txt\r
149 ../../tools/textfilter ../base_readme.txt $@ PSP\r
150\r
151../../tools/textfilter: ../../tools/textfilter.c\r
152 make -C ../../tools/ textfilter\r
153\r
8ab3e3c1 154data/bg32.o: data/bg32.bin\r
155 bin2o -i $< $@ bgdatac32\r
156\r
157data/bg40.o: data/bg40.bin\r
158 bin2o -i $< $@ bgdatac40\r
159\r
160#\r
110df09c 161ifndef UPDIR\r
162UPDIR = /media/disk/PSP/GAME/PicoDrive/\r
163endif\r
1820b5a7 164up: EBOOT.PBP\r
110df09c 165 @cp -v $^ $(UPDIR)\r
1820b5a7 166\r
167\r
168# cleanup\r
169\r
170myclean:\r
f579f7b8 171 #rm -rf $(DIRS)\r
8b99ab90 172 $(RM) PicoDrive.map\r
1820b5a7 173 make -C ../../cpu/musashi clean\r
174\r
175\r
176clean_prof:\r
177 find ../.. -name '*.gcno' -delete\r
178 find ../.. -name '*.gcda' -delete\r
179\r
180# ----------- release -----------\r
181ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
182ifeq ($(VER),)\r
183$(error need VER)\r
184endif\r
185endif\r
186\r
187# ?\r
6fc57144 188rel: EBOOT.PBP readme.txt ../game_def.cfg\r
8b99ab90 189 mkdir -p PicoDrive/skin/\r
190 cp $^ PicoDrive/\r
191 cp skin/* PicoDrive/skin/\r
ff6b7429 192 zip -9 -r ../../PicoDrive_psp_$(VER).zip PicoDrive\r
8b99ab90 193 rm -rf PicoDrive\r
c0fcf293 194 mkdir bin_to_cso_mp3\r
195 cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/\r
196 zip -9 -r ../../PicoDrive_psp_$(VER).zip bin_to_cso_mp3\r
197 rm -rf bin_to_cso_mp3\r
1820b5a7 198\r
6fc57144 199rel_kxploit: readme.txt ../game_def.cfg\r
ff6b7429 200 mkdir -p PicoDrive/skin/\r
201 cp $^ PicoDrive/\r
202 cp skin/* PicoDrive/skin/\r
203 zip -9 -r ../../PicoDrive_psp_$(VER)_kxploit.zip PicoDrive\r
204 zip -9 -r ../../PicoDrive_psp_$(VER)_kxploit.zip PicoDrive%\r
c0fcf293 205 mkdir bin_to_cso_mp3\r
206 cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/\r
207 zip -9 -r ../../PicoDrive_psp_$(VER)_kxploit.zip bin_to_cso_mp3\r
208 rm -rf bin_to_cso_mp3\r
ff6b7429 209\r