2 # pspdev is expected to be in path
\r
3 PSPSDK = $(shell psp-config --pspsdk-path)
\r
12 CFLAGS += -I../.. -I. -DNO_SYNC
\r
13 CFLAGS += -Wall -Winline -G0
\r
14 #CFLAGS += -DLPRINTF_STDIO
\r
17 CFLAGS += -O2 -ftracer -fstrength-reduce -ffast-math
\r
21 ifeq "$(for_15fw)" "1"
\r
26 # frontend and stuff
\r
27 OBJS += main.o emu.o mp3.o menu.o psp.o asm_utils.o
\r
30 OBJS += ../common/emu.o ../common/menu.o ../common/fonts.o ../common/config.o ../common/readpng.o
\r
33 ifeq "$(amalgamate)" "1"
\r
34 OBJS += ../../PicoAll.o
\r
36 OBJS += ../../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
38 ../../Pico/Patch.o ../../Pico/Draw_amips.o ../../Pico/Memory_amips.o ../../Pico/Misc_amips.o
\r
40 OBJS += ../../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/cue.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
44 OBJS += ../../Pico/carthw/carthw.o ../../Pico/carthw/svp/svp.o ../../Pico/carthw/svp/Memory.o \
\r
45 ../../Pico/carthw/svp/ssp16.o
\r
49 ifneq "$(amalgamate)" "1"
\r
50 OBJS += ../../Pico/sound/sound.o
\r
52 OBJS += ../../Pico/sound/mix.o
\r
53 OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o
\r
55 OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \
\r
56 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o \
\r
57 ../../zlib/uncompr.o
\r
59 OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o
\r
61 ifeq "$(use_musashi)" "1"
\r
62 CFLAGS += -DEMU_M68K
\r
63 OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o
\r
65 CFLAGS += -DEMU_F68K
\r
66 OBJS += ../../cpu/fame/famec.o
\r
69 ifeq "$(use_mz80)" "1"
\r
70 CFLAGS += -D_USE_MZ80
\r
71 OBJS += ../../cpu/mz80/mz80.o
\r
73 CFLAGS += -D_USE_CZ80
\r
74 OBJS += ../../cpu/cz80/cz80.o
\r
77 OBJS += data/bg32.o data/bg40.o
\r
80 LIBS += -lpng -lm -lpspgu -lpsppower -lpspaudio -lpsprtc -lpspaudiocodec -lpspkubridge
\r
82 LDFLAGS += -Wl,-Map=PicoDrive.map
\r
87 EXTRA_TARGETS = EBOOT.PBP
\r
88 PSP_EBOOT_TITLE = PicoDrive
\r
89 PSP_EBOOT_ICON = data/icon.png
\r
90 #PSP_EBOOT_PIC1 = .png
\r
91 ifneq "$(for_15fw)" "1"
\r
95 CUSTOM_CLEAN = myclean
\r
97 include $(PSPSDK)/lib/build.mak
\r
99 # some additional rules
\r
102 $(CC) $(CFLAGS) -c $< -o $@
\r
108 $(AS) -march=allegrex -mtune=allegrex $< -o $@
\r
110 ../../cpu/musashi/m68kops.c :
\r
111 make -C ../../cpu/musashi
\r
113 ../../cpu/fame/famec.o : ../../cpu/fame/famec.c
\r
115 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@
\r
117 ../../Pico/Memory.o : ../../Pico/Memory.c
\r
119 $(CC) $(CFLAGS) -O2 -c $< -o $@ -D_ASM_MEMORY_C -D_ASM_MEMORY_C_AMIPS
\r
121 ../../Pico/cd/Memory.o : ../../Pico/cd/Memory.c
\r
123 $(CC) $(CFLAGS) -O2 -c $< -o $@
\r
125 ../../Pico/Draw.o : ../../Pico/Draw.c
\r
127 $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_DRAW_C_AMIPS
\r
129 ../../Pico/Misc.o : ../../Pico/Misc.c
\r
131 $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_MISC_C_AMIPS
\r
133 ../../Pico/cd/gfx_cd.o : ../../Pico/cd/gfx_cd.c
\r
135 $(CC) $(CFLAGS) -O2 -c $< -o $@
\r
137 readme.txt: ../../tools/textfilter ../base_readme.txt
\r
138 ../../tools/textfilter ../base_readme.txt $@ PSP
\r
140 ../../tools/textfilter: ../../tools/textfilter.c
\r
141 make -C ../../tools/ textfilter
\r
143 data/bg32.o: data/bg32.bin
\r
144 bin2o -i $< $@ bgdatac32
\r
146 data/bg40.o: data/bg40.bin
\r
147 bin2o -i $< $@ bgdatac40
\r
151 UPDIR = /media/disk/PSP/GAME/PicoDrive/
\r
160 $(RM) PicoDrive.map
\r
161 make -C ../../cpu/musashi clean
\r
165 find ../.. -name '*.gcno' -delete
\r
166 find ../.. -name '*.gcda' -delete
\r
168 # ----------- release -----------
\r
169 ifneq ($(findstring rel,$(MAKECMDGOALS)),)
\r
176 rel: EBOOT.PBP readme.txt ../game_def.cfg
\r
177 mkdir -p PicoDrive/skin/
\r
179 cp skin/* PicoDrive/skin/
\r
180 zip -9 -r ../../PicoDrive_psp_$(VER).zip PicoDrive
\r
183 rel_kxploit: readme.txt ../game_def.cfg
\r
184 mkdir -p PicoDrive/skin/
\r
186 cp skin/* PicoDrive/skin/
\r
187 zip -9 -r ../../PicoDrive_psp_$(VER)_kxploit.zip PicoDrive
\r
188 zip -9 -r ../../PicoDrive_psp_$(VER)_kxploit.zip PicoDrive%
\r