some work on PSP CLUT
[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
2951214e 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
14CFLAGS += -Wall -Winline\r
15ifeq ($(DEBUG),)\r
2b90fc61 16CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -ffast-math\r
2951214e 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
2b90fc61 40 ../../Pico/Patch.o ../../Pico/Draw_amips.o\r
2951214e 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
55 ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o\r
56# unzip\r
57OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o\r
58# CPU cores\r
59ifeq "$(use_musashi)" "1"\r
60CFLAGS += -DEMU_M68K\r
61OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o\r
2b90fc61 62else\r
63CFLAGS += -DEMU_F68K\r
64OBJS += ../../cpu/fame/famec.o\r
2951214e 65endif\r
66# z80\r
67ifeq "$(use_mz80)" "1"\r
68CFLAGS += -D_USE_MZ80\r
69OBJS += ../../cpu/mz80/mz80.o\r
70else\r
71$(error nothing here!)\r
72endif\r
73\r
74\r
2b90fc61 75LIBS += -lpng -lm -lpspgu -lpsppower -Wl,-Map=PicoDrive.map # -lpspaudio -lpsphprm\r
2951214e 76\r
77# target\r
78TARGET = PicoDrive\r
79EXTRA_TARGETS = EBOOT.PBP\r
80PSP_EBOOT_TITLE = PICODRIVE\r
81#PSP_EBOOT_ICON = .png\r
82#PSP_EBOOT_PIC1 = .png\r
83\r
84CUSTOM_CLEAN = myclean\r
85\r
86include $(PSPSDK)/lib/build.mak\r
87\r
2951214e 88# some additional rules\r
89.c.o:\r
90 @echo ">>>" $<\r
91 $(CC) $(CFLAGS) -c $< -o $@\r
92\r
2b90fc61 93AS := psp-as\r
94\r
95.s.o:\r
96 @echo ">>>" $<\r
97 $(AS) -march=allegrex -mtune=allegrex $< -o $@\r
98\r
2951214e 99../../cpu/musashi/m68kops.c :\r
100 make -C ../../cpu/musashi\r
101\r
102readme.txt: ../../tools/textfilter ../base_readme.txt\r
103 ../../tools/textfilter ../base_readme.txt $@ PSP\r
104\r
105../../tools/textfilter: ../../tools/textfilter.c\r
106 make -C ../../tools/ textfilter\r
107\r
2b90fc61 108../../cpu/fame/famec.o : ../../cpu/fame/famec.c\r
109 @echo ">>>" $<\r
110 $(CC) $(CFLAGS) -Wno-unused -c $< -o $@\r
2951214e 111\r
112# ?\r
113up: EBOOT.PBP\r
114 @cp -v $^ /media/disk/PSP/GAME/PicoDrive/\r
115\r
116\r
117# cleanup\r
118\r
119myclean:\r
120 make -C ../../cpu/musashi clean\r
121\r
122\r
123clean_prof:\r
124 find ../.. -name '*.gcno' -delete\r
125 find ../.. -name '*.gcda' -delete\r
126\r
127# ----------- release -----------\r
128ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r
129ifeq ($(VER),)\r
130$(error need VER)\r
131endif\r
132endif\r
133\r
134# ?\r
135rel: EBOOT.PBP readme.txt\r
136 zip -9 -j ../../PicoDrive_$(VER).zip $^\r
137# zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r
138\r