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 |
6 | use_musashi = 1\r |
7 | use_mz80 = 1\r |
8 | amalgamate = 0\r |
9 | #profile = 1\r |
10 | #up = 1\r |
11 | \r |
12 | \r |
13 | CFLAGS += -I../.. -I. -D_UNZIP_SUPPORT -DNO_SYNC # -DBENCHMARK\r |
14 | CFLAGS += -Wall -Winline\r |
15 | ifeq ($(DEBUG),)\r |
16 | CFLAGS += -O2 -G0 -ftracer -fstrength-reduce -fomit-frame-pointer -fstrict-aliasing -ffast-math\r |
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 |
40 | ../../Pico/Patch.o\r |
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 |
55 | ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o\r |
56 | # unzip\r |
57 | OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o\r |
58 | # CPU cores\r |
59 | ifeq "$(use_musashi)" "1"\r |
60 | CFLAGS += -DEMU_M68K\r |
61 | OBJS += ../../cpu/musashi/m68kops.o ../../cpu/musashi/m68kcpu.o\r |
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 |
68 | $(error nothing here!)\r |
69 | endif\r |
70 | \r |
71 | \r |
72 | LIBS += -lpng -lm -lpspgu # -lpspaudio -lpspgu -lpsppower -lpsphprm -lz -lm -lstdc++\r |
73 | \r |
74 | # target\r |
75 | TARGET = PicoDrive\r |
76 | EXTRA_TARGETS = EBOOT.PBP\r |
77 | PSP_EBOOT_TITLE = PICODRIVE\r |
78 | #PSP_EBOOT_ICON = .png\r |
79 | #PSP_EBOOT_PIC1 = .png\r |
80 | \r |
81 | CUSTOM_CLEAN = myclean\r |
82 | \r |
83 | include $(PSPSDK)/lib/build.mak\r |
84 | \r |
85 | \r |
86 | # some additional rules\r |
87 | .c.o:\r |
88 | @echo ">>>" $<\r |
89 | $(CC) $(CFLAGS) -c $< -o $@\r |
90 | \r |
91 | ../../cpu/musashi/m68kops.c :\r |
92 | make -C ../../cpu/musashi\r |
93 | \r |
94 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
95 | ../../tools/textfilter ../base_readme.txt $@ PSP\r |
96 | \r |
97 | ../../tools/textfilter: ../../tools/textfilter.c\r |
98 | make -C ../../tools/ textfilter\r |
99 | \r |
100 | \r |
101 | # ?\r |
102 | up: EBOOT.PBP\r |
103 | @cp -v $^ /media/disk/PSP/GAME/PicoDrive/\r |
104 | \r |
105 | \r |
106 | # cleanup\r |
107 | \r |
108 | myclean:\r |
109 | make -C ../../cpu/musashi clean\r |
110 | \r |
111 | \r |
112 | clean_prof:\r |
113 | find ../.. -name '*.gcno' -delete\r |
114 | find ../.. -name '*.gcda' -delete\r |
115 | \r |
116 | # ----------- release -----------\r |
117 | ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r |
118 | ifeq ($(VER),)\r |
119 | $(error need VER)\r |
120 | endif\r |
121 | endif\r |
122 | \r |
123 | # ?\r |
124 | rel: EBOOT.PBP readme.txt\r |
125 | zip -9 -j ../../PicoDrive_$(VER).zip $^\r |
126 | # zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r |
127 | \r |