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