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 |
1820b5a7 |
9 | \r |
10 | \r |
9caf44b5 |
11 | CFLAGS += -I../.. -I. -DNO_SYNC -DLPRINTF_STDIO\r |
8ab3e3c1 |
12 | CFLAGS += -Wall -Winline -G0\r |
b542be46 |
13 | CFLAGS += -DLPRINTF_STDIO\r |
14 | #CFLAGS += -fprofile-generate\r |
15 | #CFLAGS += -fprofile-use\r |
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 |
1820b5a7 |
22 | \r |
23 | \r |
24 | # frontend\r |
25 | OBJS += main.o emu.o mp3.o menu.o psp.o\r |
26 | \r |
27 | # common\r |
28 | OBJS += ../common/emu.o ../common/menu.o ../common/fonts.o ../common/readpng.o\r |
29 | \r |
30 | # Pico\r |
31 | ifeq "$(amalgamate)" "1"\r |
32 | OBJS += ../../PicoAll.o\r |
33 | else\r |
34 | OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \\r |
35 | ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \\r |
b542be46 |
36 | ../../Pico/Patch.o ../../Pico/Draw_amips.o ../../Pico/Memory_amips.o ../../Pico/Misc_amips.o\r |
1820b5a7 |
37 | # Pico - CD\r |
38 | OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r |
39 | ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r |
40 | ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o\r |
41 | endif\r |
42 | \r |
43 | # Pico - sound\r |
44 | ifneq "$(amalgamate)" "1"\r |
45 | OBJS += ../../Pico/sound/sound.o\r |
46 | endif\r |
47 | OBJS += ../../Pico/sound/mix.o\r |
48 | OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o\r |
49 | # zlib (hacked)\r |
50 | OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \\r |
8ab3e3c1 |
51 | ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o \\r |
52 | ../../zlib/uncompr.o\r |
1820b5a7 |
53 | # unzip\r |
54 | OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o\r |
55 | # CPU cores\r |
56 | ifeq "$(use_musashi)" "1"\r |
57 | CFLAGS += -DEMU_M68K\r |
58 | OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o\r |
70357ce5 |
59 | else\r |
60 | CFLAGS += -DEMU_F68K\r |
61 | OBJS += ../../cpu/fame/famec.o\r |
1820b5a7 |
62 | endif\r |
63 | # z80\r |
64 | ifeq "$(use_mz80)" "1"\r |
65 | CFLAGS += -D_USE_MZ80\r |
66 | OBJS += ../../cpu/mz80/mz80.o\r |
67 | else\r |
a4221917 |
68 | CFLAGS += -D_USE_CZ80\r |
69 | OBJS += ../../cpu/cz80/cz80.o\r |
1820b5a7 |
70 | endif\r |
8ab3e3c1 |
71 | # bg images\r |
72 | OBJS += data/bg32.o data/bg40.o\r |
1820b5a7 |
73 | \r |
74 | \r |
4b167c12 |
75 | LIBS += -lpng -lm -lpspgu -lpsppower -lpspaudio -lpsprtc -lpspaudiocodec\r |
b542be46 |
76 | #LIBS += -lpspprof\r |
4b167c12 |
77 | LDFLAGS += -Wl,-Map=PicoDrive.map\r |
1820b5a7 |
78 | \r |
b542be46 |
79 | \r |
1820b5a7 |
80 | # target\r |
81 | TARGET = PicoDrive\r |
82 | EXTRA_TARGETS = EBOOT.PBP\r |
9caf44b5 |
83 | PSP_EBOOT_TITLE = PicoDrive\r |
3ec29f01 |
84 | PSP_EBOOT_ICON = data/icon.png\r |
1820b5a7 |
85 | #PSP_EBOOT_PIC1 = .png\r |
86 | \r |
87 | CUSTOM_CLEAN = myclean\r |
88 | \r |
89 | include $(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 |
96 | AS := 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 |
3ec29f01 |
105 | ../../cpu/fame/famec.o : ../../cpu/fame/famec.c\r |
106 | @echo ">>>" $<\r |
107 | $(CC) $(CFLAGS) -Wno-unused -c $< -o $@\r |
108 | \r |
109 | ../../Pico/Memory.o : ../../Pico/Memory.c\r |
110 | @echo ">>>" $<\r |
111 | $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_MEMORY_C -D_ASM_MEMORY_C_AMIPS\r |
112 | \r |
113 | ../../Pico/Draw.o : ../../Pico/Draw.c\r |
114 | @echo ">>>" $<\r |
b542be46 |
115 | $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_DRAW_C_AMIPS\r |
116 | \r |
117 | ../../Pico/Misc.o : ../../Pico/Misc.c\r |
118 | @echo ">>>" $<\r |
119 | $(CC) $(CFLAGS) -c $< -o $@ -D_ASM_MISC_C_AMIPS\r |
3ec29f01 |
120 | \r |
1820b5a7 |
121 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
122 | ../../tools/textfilter ../base_readme.txt $@ PSP\r |
123 | \r |
124 | ../../tools/textfilter: ../../tools/textfilter.c\r |
125 | make -C ../../tools/ textfilter\r |
126 | \r |
8ab3e3c1 |
127 | data/bg32.o: data/bg32.bin\r |
128 | bin2o -i $< $@ bgdatac32\r |
129 | \r |
130 | data/bg40.o: data/bg40.bin\r |
131 | bin2o -i $< $@ bgdatac40\r |
132 | \r |
133 | #\r |
1820b5a7 |
134 | up: EBOOT.PBP\r |
135 | @cp -v $^ /media/disk/PSP/GAME/PicoDrive/\r |
136 | \r |
137 | \r |
138 | # cleanup\r |
139 | \r |
140 | myclean:\r |
141 | make -C ../../cpu/musashi clean\r |
142 | \r |
143 | \r |
144 | clean_prof:\r |
145 | find ../.. -name '*.gcno' -delete\r |
146 | find ../.. -name '*.gcda' -delete\r |
147 | \r |
148 | # ----------- release -----------\r |
149 | ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r |
150 | ifeq ($(VER),)\r |
151 | $(error need VER)\r |
152 | endif\r |
153 | endif\r |
154 | \r |
155 | # ?\r |
156 | rel: EBOOT.PBP readme.txt\r |
b542be46 |
157 | zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r |
1820b5a7 |
158 | \r |