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