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