menu adjustments (L, R for range controls)
[libpicofe.git] / psp / Makefile
CommitLineData
2951214e 1\r
2# pspdev is expected to be in path\r
3PSPSDK = $(shell psp-config --pspsdk-path)\r
4\r
5# settings\r
2b90fc61 6#use_musashi = 1\r
0953046b 7#use_mz80 = 1\r
2951214e 8amalgamate = 0\r
93c0d147 9for_15fw = 1\r
b8464531 10# :!touch platform/psp/psp.c\r
2951214e 11\r
12\r
f11bad75 13CFLAGS += -I../.. -I. -DNO_SYNC -D_ASM_DRAW_C_AMIPS\r
6f748c47 14CFLAGS += -Wall -Winline -G0\r
fe9e3b25 15#CFLAGS += -DLPRINTF_STDIO\r
5ecedd0c 16#CFLAGS += -pg\r
2951214e 17ifeq ($(DEBUG),)\r
6f748c47 18CFLAGS += -O2 -ftracer -fstrength-reduce -ffast-math\r
2951214e 19else\r
20CFLAGS += -ggdb\r
21endif\r
93c0d147 22ifeq "$(for_15fw)" "1"\r
23CFLAGS += -DFW15\r
24endif\r
2951214e 25\r
26\r
93c0d147 27# frontend and stuff\r
28OBJS += main.o emu.o mp3.o menu.o psp.o asm_utils.o\r
2951214e 29\r
30# common\r
ac3494f4 31OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o platform/common/readpng.o\r
2951214e 32\r
33# Pico\r
34ifeq "$(amalgamate)" "1"\r
f11bad75 35OBJS += ../../picoAll.o\r
2951214e 36else\r
f11bad75 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
2951214e 40# Pico - CD\r
f11bad75 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
960a8e27 44# Pico - carthw\r
f11bad75 45OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \\r
46 pico/carthw/svp/ssp16.o\r
8a091e48 47# Pico - Pico\r
f11bad75 48OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r
2951214e 49endif\r
50\r
51# Pico - sound\r
52ifneq "$(amalgamate)" "1"\r
f11bad75 53OBJS += pico/sound/sound.o\r
2951214e 54endif\r
f11bad75 55OBJS += pico/sound/mix.o\r
56OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r
2951214e 57# zlib (hacked)\r
ac3494f4 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
2951214e 61# unzip\r
ac3494f4 62OBJS += unzip/unzip.o unzip/unzip_stream.o\r
2951214e 63# CPU cores\r
64ifeq "$(use_musashi)" "1"\r
65CFLAGS += -DEMU_M68K\r
ac3494f4 66OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r
2b90fc61 67else\r
68CFLAGS += -DEMU_F68K\r
ac3494f4 69OBJS += cpu/fame/famec.o\r
2951214e 70endif\r
71# z80\r
72ifeq "$(use_mz80)" "1"\r
73CFLAGS += -D_USE_MZ80\r
ac3494f4 74OBJS += cpu/mz80/mz80.o\r
2951214e 75else\r
0953046b 76CFLAGS += -D_USE_CZ80\r
ac3494f4 77OBJS += cpu/cz80/cz80.o\r
2951214e 78endif\r
6f748c47 79# bg images\r
80OBJS += data/bg32.o data/bg40.o\r
2951214e 81\r
ac3494f4 82vpath %.c = ../..\r
83vpath %.s = ../..\r
f11bad75 84DIRS = platform platform/psp platform/common pico pico/cd pico/pico pico/sound pico/carthw/svp \\r
ac3494f4 85 zlib unzip cpu cpu/musashi cpu/fame cpu/mz80 cpu/cz80\r
86\r
2951214e 87\r
117f236a 88LIBS += -lpng -lm -lpspgu -lpsppower -lpspaudio -lpsprtc -lpspaudiocodec -lpspkubridge\r
5ecedd0c 89#LIBS += -lpspprof\r
a6df06b7 90LDFLAGS += -Wl,-Map=PicoDrive.map\r
2951214e 91\r
5ecedd0c 92\r
2951214e 93# target\r
94TARGET = PicoDrive\r
ac3494f4 95EXTRA_TARGETS = mkdirs EBOOT.PBP\r
16e89bed 96PSP_EBOOT_TITLE = PicoDrive\r
4b8f4f3c 97PSP_EBOOT_ICON = data/icon.png\r
2951214e 98#PSP_EBOOT_PIC1 = .png\r
93c0d147 99ifneq "$(for_15fw)" "1"\r
fe9e3b25 100BUILD_PRX = 1\r
93c0d147 101endif\r
2951214e 102\r
103CUSTOM_CLEAN = myclean\r
104\r
105include $(PSPSDK)/lib/build.mak\r
106\r
2951214e 107# some additional rules\r
ac3494f4 108mkdirs:\r
109 mkdir -p $(DIRS)\r
110\r
2951214e 111.c.o:\r
112 @echo ">>>" $<\r
113 $(CC) $(CFLAGS) -c $< -o $@\r
114\r
2b90fc61 115AS := psp-as\r
116\r
117.s.o:\r
118 @echo ">>>" $<\r
119 $(AS) -march=allegrex -mtune=allegrex $< -o $@\r
120\r
2951214e 121../../cpu/musashi/m68kops.c :\r
122 make -C ../../cpu/musashi\r
123\r
ac3494f4 124cpu/fame/famec.o : ../../cpu/fame/famec.c\r
4b8f4f3c 125 @echo ">>>" $<\r
126 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@\r
127\r
f11bad75 128pico/misc.o : ../../pico/misc.c\r
4b8f4f3c 129 @echo ">>>" $<\r
f11bad75 130 $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_MISC_C_AMIPS\r
4b8f4f3c 131\r
f11bad75 132pico/memory.o : ../../pico/memory.c\r
4b8f4f3c 133 @echo ">>>" $<\r
f11bad75 134 $(CC) $(CFLAGS) -O2 -c $< -o $@ -D_ASM_MEMORY_C -D_ASM_MEMORY_C_AMIPS\r
5ecedd0c 135\r
f11bad75 136pico/cd/memory.o : ../../pico/cd/memory.c\r
5ecedd0c 137 @echo ">>>" $<\r
f11bad75 138 $(CC) $(CFLAGS) -O2 -c $< -o $@\r
4b8f4f3c 139\r
f11bad75 140pico/cd/gfx_cd.o : ../../pico/cd/gfx_cd.c\r
63b796ca 141 @echo ">>>" $<\r
142 $(CC) $(CFLAGS) -O2 -c $< -o $@\r
143\r
2951214e 144readme.txt: ../../tools/textfilter ../base_readme.txt\r
145 ../../tools/textfilter ../base_readme.txt $@ PSP\r
146\r
147../../tools/textfilter: ../../tools/textfilter.c\r
148 make -C ../../tools/ textfilter\r
149\r
6f748c47 150data/bg32.o: data/bg32.bin\r
151 bin2o -i $< $@ bgdatac32\r
152\r
153data/bg40.o: data/bg40.bin\r
154 bin2o -i $< $@ bgdatac40\r
155\r
156#\r
fe9e3b25 157ifndef UPDIR\r
158UPDIR = /media/disk/PSP/GAME/PicoDrive/\r
159endif\r
2951214e 160up: EBOOT.PBP\r
fe9e3b25 161 @cp -v $^ $(UPDIR)\r
2951214e 162\r
163\r
164# cleanup\r
165\r
166myclean:\r
b8464531 167 #rm -rf $(DIRS)\r
63b796ca 168 $(RM) PicoDrive.map\r
2951214e 169 make -C ../../cpu/musashi clean\r
170\r
171\r
172clean_prof:\r
173 find ../.. -name '*.gcno' -delete\r
174 find ../.. -name '*.gcda' -delete\r
175\r
176# ----------- release -----------\r
177ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
178ifeq ($(VER),)\r
179$(error need VER)\r
180endif\r
181endif\r
182\r
183# ?\r
960a8e27 184rel: EBOOT.PBP readme.txt ../game_def.cfg\r
63b796ca 185 mkdir -p PicoDrive/skin/\r
186 cp $^ PicoDrive/\r
187 cp skin/* PicoDrive/skin/\r
f060b8b9 188 zip -9 -r ../../PicoDrive_psp_$(VER).zip PicoDrive\r
63b796ca 189 rm -rf PicoDrive\r
b4008282 190 mkdir bin_to_cso_mp3\r
191 cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/\r
192 zip -9 -r ../../PicoDrive_psp_$(VER).zip bin_to_cso_mp3\r
193 rm -rf bin_to_cso_mp3\r
2951214e 194\r
960a8e27 195rel_kxploit: readme.txt ../game_def.cfg\r
f060b8b9 196 mkdir -p PicoDrive/skin/\r
197 cp $^ PicoDrive/\r
198 cp skin/* PicoDrive/skin/\r
199 zip -9 -r ../../PicoDrive_psp_$(VER)_kxploit.zip PicoDrive\r
200 zip -9 -r ../../PicoDrive_psp_$(VER)_kxploit.zip PicoDrive%\r
b4008282 201 mkdir bin_to_cso_mp3\r
202 cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/\r
203 zip -9 -r ../../PicoDrive_psp_$(VER)_kxploit.zip bin_to_cso_mp3\r
204 rm -rf bin_to_cso_mp3\r
f060b8b9 205\r