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