e5f426aa |
1 | \r |
2 | # you may or may not need to change this\r |
da42200b |
3 | export CROSS = /opt/cegcc/arm-wince-cegcc/bin/\r |
e5f426aa |
4 | \r |
5 | # settings\r |
6 | asm_memory = 1\r |
7 | asm_render = 1\r |
8 | asm_ym2612 = 1\r |
9 | asm_misc = 1\r |
10 | asm_cdpico = 1\r |
11 | asm_cdmemory = 1\r |
12 | amalgamate = 0\r |
13 | #profile = 1\r |
14 | \r |
15 | \r |
16 | \r |
3ec29f01 |
17 | DEFINC = -I../.. -I. -D__GIZ__ -DNO_SYNC\r |
2ec14aec |
18 | COPT_COMMON = -Wall -Winline\r |
ea8c405f |
19 | ifeq ($(DEBUG),)\r |
2ec14aec |
20 | COPT_COMMON += -O2 -ftracer -fomit-frame-pointer -fstrict-aliasing -ffast-math\r |
ea8c405f |
21 | else\r |
22 | COPT_COMMON += -ggdb\r |
23 | endif\r |
e5f426aa |
24 | ifeq "$(profile)" "1"\r |
25 | COPT_COMMON += -fprofile-generate\r |
26 | endif\r |
27 | ifeq "$(profile)" "2"\r |
28 | COPT_COMMON += -fprofile-use\r |
29 | endif\r |
30 | COPT = $(COPT_COMMON) -mtune=arm920t\r |
31 | ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r |
32 | GCC = $(CROSS)gcc\r |
33 | STRIP = $(CROSS)strip\r |
34 | AS = $(CROSS)as\r |
35 | LD = $(CROSS)ld\r |
36 | \r |
37 | # frontend\r |
ea8c405f |
38 | OBJS += main.o emu.o menu.o giz.o asm_utils.o\r |
e5f426aa |
39 | \r |
40 | # common\r |
da42200b |
41 | OBJS += ../common/emu.o ../common/menu.o ../common/fonts.o ../common/arm_utils.o \\r |
42 | ../common/readpng.o ../common/mp3_helix.o\r |
e5f426aa |
43 | \r |
44 | # Pico\r |
45 | ifeq "$(amalgamate)" "1"\r |
46 | OBJS += ../../PicoAll.o\r |
47 | else\r |
48 | OBJS += ../../Pico/Area.o ../../Pico/Cart.o ../../Pico/Memory.o ../../Pico/Misc.o \\r |
49 | ../../Pico/Pico.o ../../Pico/Sek.o ../../Pico/VideoPort.o ../../Pico/Draw2.o ../../Pico/Draw.o \\r |
50 | ../../Pico/Patch.o\r |
51 | # Pico - CD\r |
52 | OBJS += ../../Pico/cd/Pico.o ../../Pico/cd/Memory.o ../../Pico/cd/Sek.o ../../Pico/cd/LC89510.o \\r |
53 | ../../Pico/cd/cd_sys.o ../../Pico/cd/cd_file.o ../../Pico/cd/gfx_cd.o \\r |
54 | ../../Pico/cd/Area.o ../../Pico/cd/Misc.o ../../Pico/cd/pcm.o ../../Pico/cd/buffering.o\r |
55 | endif\r |
56 | \r |
57 | # asm stuff\r |
58 | ifeq "$(asm_render)" "1"\r |
59 | DEFINC += -D_ASM_DRAW_C\r |
60 | OBJS += ../../Pico/draw_asm.o ../../Pico/draw2_asm.o\r |
61 | endif\r |
62 | ifeq "$(asm_memory)" "1"\r |
63 | DEFINC += -D_ASM_MEMORY_C\r |
64 | OBJS += ../../Pico/memory_asm.o\r |
65 | endif\r |
66 | ifeq "$(asm_ym2612)" "1"\r |
67 | DEFINC += -D_ASM_YM2612_C\r |
68 | OBJS += ../../Pico/sound/ym2612_asm.o\r |
69 | endif\r |
70 | ifeq "$(asm_misc)" "1"\r |
71 | DEFINC += -D_ASM_MISC_C\r |
72 | OBJS += ../../Pico/misc_asm.o\r |
73 | OBJS += ../../Pico/cd/misc_asm.o\r |
74 | endif\r |
75 | ifeq "$(asm_cdpico)" "1"\r |
76 | DEFINC += -D_ASM_CD_PICO_C\r |
77 | OBJS += ../../Pico/cd/pico_asm.o\r |
78 | endif\r |
79 | ifeq "$(asm_cdmemory)" "1"\r |
80 | DEFINC += -D_ASM_CD_MEMORY_C\r |
81 | OBJS += ../../Pico/cd/memory_asm.o\r |
82 | endif\r |
83 | \r |
84 | # Pico - sound\r |
85 | ifneq "$(amalgamate)" "1"\r |
86 | OBJS += ../../Pico/sound/sound.o\r |
87 | endif\r |
88 | OBJS += ../../Pico/sound/mix_asm.o\r |
89 | OBJS += ../../Pico/sound/sn76496.o ../../Pico/sound/ym2612.o\r |
90 | # zlib\r |
91 | OBJS += ../../zlib/gzio.o ../../zlib/inffast.o ../../zlib/inflate.o ../../zlib/inftrees.o ../../zlib/trees.o \\r |
92 | ../../zlib/deflate.o ../../zlib/crc32.o ../../zlib/adler32.o ../../zlib/zutil.o ../../zlib/compress.o\r |
93 | # unzip\r |
94 | OBJS += ../../unzip/unzip.o ../../unzip/unzip_stream.o\r |
e5f426aa |
95 | # CPU cores\r |
96 | # Cyclone\r |
97 | DEFINC += -DEMU_C68K\r |
98 | OBJS += ../../cpu/Cyclone/proj/Cyclone.o\r |
99 | # drz80\r |
100 | DEFINC += -D_USE_DRZ80\r |
101 | OBJS += ../../cpu/DrZ80/drz80.o\r |
102 | \r |
103 | \r |
7eed09b3 |
104 | all: PicoDrive.exe readme.txt\r |
e5f426aa |
105 | \r |
da42200b |
106 | PicoDrive.exe : $(OBJS) ../common/helix/helix_mp3.a\r |
2ec14aec |
107 | @echo ">>>" $@\r |
499a0be3 |
108 | $(GCC) -o $@ -static $(COPT) $^ -lm -lpng -Lkgsdk/ -lKGSDK -Wl,-Map=PicoDrive.map 2>&1 | \\r |
109 | grep -v ".idata$$4" # | grep -v "supports interworking, whereas"\r |
e5f426aa |
110 | ifeq ($(DEBUG),)\r |
2ec14aec |
111 | $(STRIP) $@\r |
e5f426aa |
112 | endif\r |
113 | \r |
114 | \r |
115 | .c.o:\r |
2ec14aec |
116 | @echo ">>>" $<\r |
117 | $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r |
e5f426aa |
118 | #.s.o:\r |
119 | # @echo $<\r |
120 | # $(GCC) $(COPT) $(DEFINC) -c $< -o $@\r |
121 | \r |
122 | ../../Pico/draw_asm.o : ../../Pico/Draw.s\r |
fa283c9a |
123 | @echo ">>>" $@\r |
e5f426aa |
124 | @$(AS) $(ASFLAGS) $< -o $@\r |
125 | ../../Pico/draw2_asm.o : ../../Pico/Draw2.s\r |
fa283c9a |
126 | @echo ">>>" $@\r |
e5f426aa |
127 | @$(AS) $(ASFLAGS) $< -o $@\r |
128 | ../../Pico/memory_asm.o : ../../Pico/Memory.s\r |
fa283c9a |
129 | @echo ">>>" $@\r |
e5f426aa |
130 | @$(AS) $(ASFLAGS) $< -o $@\r |
131 | ../../Pico/sound/ym2612_asm.o : ../../Pico/sound/ym2612.s\r |
fa283c9a |
132 | @echo ">>>" $@\r |
e5f426aa |
133 | @$(AS) $(ASFLAGS) $< -o $@\r |
134 | ../../Pico/sound/mix_asm.o : ../../Pico/sound/mix.s\r |
fa283c9a |
135 | @echo ">>>" $@\r |
e5f426aa |
136 | @$(AS) $(ASFLAGS) $< -o $@\r |
ea8c405f |
137 | ../../Pico/misc_asm.o : ../../Pico/Misc.s\r |
fa283c9a |
138 | @echo ">>>" $@\r |
e5f426aa |
139 | @$(AS) $(ASFLAGS) $< -o $@\r |
140 | ../../Pico/cd/pico_asm.o : ../../Pico/cd/Pico.s\r |
fa283c9a |
141 | @echo ">>>" $@\r |
e5f426aa |
142 | @$(AS) $(ASFLAGS) $< -o $@\r |
143 | ../../Pico/cd/memory_asm.o : ../../Pico/cd/Memory.s\r |
fa283c9a |
144 | @echo ">>>" $@\r |
e5f426aa |
145 | @$(AS) $(ASFLAGS) $< -o $@\r |
ea8c405f |
146 | ../../Pico/cd/misc_asm.o : ../../Pico/cd/Misc.s\r |
fa283c9a |
147 | @echo ">>>" $@\r |
e5f426aa |
148 | @$(AS) $(ASFLAGS) $< -o $@\r |
149 | \r |
150 | # build Cyclone\r |
7eed09b3 |
151 | ../../cpu/Cyclone/proj/Cyclone.s:\r |
e5f426aa |
152 | @echo building Cyclone...\r |
153 | @make -C ../../cpu/Cyclone/proj CONFIG_FILE=config_pico.h\r |
154 | \r |
da42200b |
155 | # build helix libs\r |
156 | ../common/helix/helix_mp3.a:\r |
157 | make -C ../common/helix\r |
e5f426aa |
158 | \r |
7eed09b3 |
159 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
160 | ../../tools/textfilter ../base_readme.txt $@ GIZ\r |
161 | \r |
162 | ../../tools/textfilter: ../../tools/textfilter.c\r |
163 | make -C ../../tools/ textfilter\r |
164 | \r |
e5f426aa |
165 | \r |
166 | # cleanup\r |
167 | clean: tidy\r |
168 | @$(RM) PicoDrive.exe\r |
169 | tidy:\r |
170 | @$(RM) $(OBJS)\r |
171 | \r |
172 | \r |
173 | clean_prof:\r |
174 | find ../.. -name '*.gcno' -delete\r |
175 | find ../.. -name '*.gcda' -delete\r |
176 | \r |
ea8c405f |
177 | up: PicoDrive.exe\r |
178 | synce-pcp -d 3 PicoDrive.exe ":/SD Card/emus/PicoDrive/PicoDrive.exe"\r |
179 | \r |
180 | run: up\r |
181 | synce-prun "/SD Card/emus/PicoDrive/PicoDrive.exe"\r |
182 | \r |
183 | run_only:\r |
184 | synce-prun "/SD Card/emus/PicoDrive/PicoDrive.exe"\r |
185 | \r |
e5f426aa |
186 | # ----------- release -----------\r |
187 | ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r |
188 | ifeq ($(VER),)\r |
189 | $(error need VER)\r |
190 | endif\r |
191 | endif\r |
192 | \r |
7eed09b3 |
193 | rel: PicoDrive.exe kgsdk/ARMV4IRel/KGSDK.dll readme.txt\r |
e5f426aa |
194 | zip -9 -j ../../PicoDrive_$(VER).zip $^\r |
2ec14aec |
195 | ln -s ../gp2x/skin skin\r |
e5f426aa |
196 | zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r |
2ec14aec |
197 | rm skin\r |
e5f426aa |
198 | \r |