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