optimizations, fixes, hacks, psp, ...
[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
1820b5a7 9\r
10\r
9caf44b5 11CFLAGS += -I../.. -I. -DNO_SYNC -DLPRINTF_STDIO\r
8ab3e3c1 12CFLAGS += -Wall -Winline -G0\r
b542be46 13CFLAGS += -DLPRINTF_STDIO\r
14#CFLAGS += -fprofile-generate\r
15#CFLAGS += -fprofile-use\r
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
1820b5a7 22\r
23\r
24# frontend\r
25OBJS += main.o emu.o mp3.o menu.o psp.o\r
26\r
27# common\r
28OBJS += ../common/emu.o ../common/menu.o ../common/fonts.o ../common/readpng.o\r
29\r
30# Pico\r
31ifeq "$(amalgamate)" "1"\r
32OBJS += ../../PicoAll.o\r
33else\r
34OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \\r
35 ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \\r
b542be46 36 ../../Pico/Patch.o ../../Pico/Draw_amips.o ../../Pico/Memory_amips.o ../../Pico/Misc_amips.o\r
1820b5a7 37# Pico - CD\r
38OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r
39 ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r
40 ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o\r
41endif\r
42\r
43# Pico - sound\r
44ifneq "$(amalgamate)" "1"\r
45OBJS += ../../Pico/sound/sound.o\r
46endif\r
47OBJS += ../../Pico/sound/mix.o\r
48OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o\r
49# zlib (hacked)\r
50OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \\r
8ab3e3c1 51 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o \\r
52 ../../zlib/uncompr.o\r
1820b5a7 53# unzip\r
54OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o\r
55# CPU cores\r
56ifeq "$(use_musashi)" "1"\r
57CFLAGS += -DEMU_M68K\r
58OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o\r
70357ce5 59else\r
60CFLAGS += -DEMU_F68K\r
61OBJS += ../../cpu/fame/famec.o\r
1820b5a7 62endif\r
63# z80\r
64ifeq "$(use_mz80)" "1"\r
65CFLAGS += -D_USE_MZ80\r
66OBJS += ../../cpu/mz80/mz80.o\r
67else\r
a4221917 68CFLAGS += -D_USE_CZ80\r
69OBJS += ../../cpu/cz80/cz80.o\r
1820b5a7 70endif\r
8ab3e3c1 71# bg images\r
72OBJS += data/bg32.o data/bg40.o\r
1820b5a7 73\r
74\r
4b167c12 75LIBS += -lpng -lm -lpspgu -lpsppower -lpspaudio -lpsprtc -lpspaudiocodec\r
b542be46 76#LIBS += -lpspprof\r
4b167c12 77LDFLAGS += -Wl,-Map=PicoDrive.map\r
1820b5a7 78\r
b542be46 79\r
1820b5a7 80# target\r
81TARGET = PicoDrive\r
82EXTRA_TARGETS = EBOOT.PBP\r
9caf44b5 83PSP_EBOOT_TITLE = PicoDrive\r
3ec29f01 84PSP_EBOOT_ICON = data/icon.png\r
1820b5a7 85#PSP_EBOOT_PIC1 = .png\r
86\r
87CUSTOM_CLEAN = myclean\r
88\r
89include $(PSPSDK)/lib/build.mak\r
90\r
1820b5a7 91# some additional rules\r
92.c.o:\r
93 @echo ">>>" $<\r
94 $(CC) $(CFLAGS) -c $< -o $@\r
95\r
70357ce5 96AS := psp-as\r
97\r
98.s.o:\r
99 @echo ">>>" $<\r
100 $(AS) -march=allegrex -mtune=allegrex $< -o $@\r
101\r
1820b5a7 102../../cpu/musashi/m68kops.c :\r
103 make -C ../../cpu/musashi\r
104\r
3ec29f01 105../../cpu/fame/famec.o : ../../cpu/fame/famec.c\r
106 @echo ">>>" $<\r
107 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@\r
108\r
109../../Pico/Memory.o : ../../Pico/Memory.c\r
110 @echo ">>>" $<\r
111 $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_MEMORY_C -D_ASM_MEMORY_C_AMIPS\r
112\r
113../../Pico/Draw.o : ../../Pico/Draw.c\r
114 @echo ">>>" $<\r
b542be46 115 $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_DRAW_C_AMIPS\r
116\r
117../../Pico/Misc.o : ../../Pico/Misc.c\r
118 @echo ">>>" $<\r
119 $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_MISC_C_AMIPS\r
3ec29f01 120\r
1820b5a7 121readme.txt: ../../tools/textfilter ../base_readme.txt\r
122 ../../tools/textfilter ../base_readme.txt $@ PSP\r
123\r
124../../tools/textfilter: ../../tools/textfilter.c\r
125 make -C ../../tools/ textfilter\r
126\r
8ab3e3c1 127data/bg32.o: data/bg32.bin\r
128 bin2o -i $< $@ bgdatac32\r
129\r
130data/bg40.o: data/bg40.bin\r
131 bin2o -i $< $@ bgdatac40\r
132\r
133#\r
1820b5a7 134up: EBOOT.PBP\r
135 @cp -v $^ /media/disk/PSP/GAME/PicoDrive/\r
136\r
137\r
138# cleanup\r
139\r
140myclean:\r
141 make -C ../../cpu/musashi clean\r
142\r
143\r
144clean_prof:\r
145 find ../.. -name '*.gcno' -delete\r
146 find ../.. -name '*.gcda' -delete\r
147\r
148# ----------- release -----------\r
149ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
150ifeq ($(VER),)\r
151$(error need VER)\r
152endif\r
153endif\r
154\r
155# ?\r
156rel: EBOOT.PBP readme.txt\r
b542be46 157 zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r
1820b5a7 158\r