final src and Makefile adjustments for PSP release
[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
2951214e 9\r
10\r
fe9e3b25 11CFLAGS += -I../.. -I. -DNO_SYNC\r
6f748c47 12CFLAGS += -Wall -Winline -G0\r
fe9e3b25 13#CFLAGS += -DLPRINTF_STDIO\r
5ecedd0c 14#CFLAGS += -pg\r
2951214e 15ifeq ($(DEBUG),)\r
6f748c47 16CFLAGS += -O2 -ftracer -fstrength-reduce -ffast-math\r
2951214e 17else\r
18CFLAGS += -ggdb\r
19endif\r
2951214e 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
5ecedd0c 34 ../../Pico/Patch.o ../../Pico/Draw_amips.o ../../Pico/Memory_amips.o ../../Pico/Misc_amips.o\r
2951214e 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
6f748c47 49 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o \\r
50 ../../zlib/uncompr.o\r
2951214e 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
2b90fc61 57else\r
58CFLAGS += -DEMU_F68K\r
59OBJS += ../../cpu/fame/famec.o\r
2951214e 60endif\r
61# z80\r
62ifeq "$(use_mz80)" "1"\r
63CFLAGS += -D_USE_MZ80\r
64OBJS += ../../cpu/mz80/mz80.o\r
65else\r
0953046b 66CFLAGS += -D_USE_CZ80\r
67OBJS += ../../cpu/cz80/cz80.o\r
2951214e 68endif\r
6f748c47 69# bg images\r
70OBJS += data/bg32.o data/bg40.o\r
2951214e 71\r
72\r
a6df06b7 73LIBS += -lpng -lm -lpspgu -lpsppower -lpspaudio -lpsprtc -lpspaudiocodec\r
5ecedd0c 74#LIBS += -lpspprof\r
a6df06b7 75LDFLAGS += -Wl,-Map=PicoDrive.map\r
2951214e 76\r
5ecedd0c 77\r
2951214e 78# target\r
79TARGET = PicoDrive\r
80EXTRA_TARGETS = EBOOT.PBP\r
16e89bed 81PSP_EBOOT_TITLE = PicoDrive\r
4b8f4f3c 82PSP_EBOOT_ICON = data/icon.png\r
2951214e 83#PSP_EBOOT_PIC1 = .png\r
fe9e3b25 84BUILD_PRX = 1\r
2951214e 85\r
86CUSTOM_CLEAN = myclean\r
87\r
88include $(PSPSDK)/lib/build.mak\r
89\r
2951214e 90# some additional rules\r
91.c.o:\r
92 @echo ">>>" $<\r
93 $(CC) $(CFLAGS) -c $< -o $@\r
94\r
2b90fc61 95AS := psp-as\r
96\r
97.s.o:\r
98 @echo ">>>" $<\r
99 $(AS) -march=allegrex -mtune=allegrex $< -o $@\r
100\r
2951214e 101../../cpu/musashi/m68kops.c :\r
102 make -C ../../cpu/musashi\r
103\r
4b8f4f3c 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
63b796ca 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
4b8f4f3c 115\r
116../../Pico/Draw.o : ../../Pico/Draw.c\r
117 @echo ">>>" $<\r
5ecedd0c 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
4b8f4f3c 123\r
63b796ca 124../../Pico/cd/gfx_cd.o : ../../Pico/cd/gfx_cd.c\r
125 @echo ">>>" $<\r
126 $(CC) $(CFLAGS) -O2 -c $< -o $@\r
127\r
2951214e 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
6f748c47 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
fe9e3b25 141ifndef UPDIR\r
142UPDIR = /media/disk/PSP/GAME/PicoDrive/\r
143endif\r
2951214e 144up: EBOOT.PBP\r
fe9e3b25 145 @cp -v $^ $(UPDIR)\r
2951214e 146\r
147\r
148# cleanup\r
149\r
150myclean:\r
63b796ca 151 $(RM) PicoDrive.map\r
2951214e 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
63b796ca 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
2951214e 173\r