da42200b |
1 | export CROSS = arm-linux-\r |
cc68a136 |
2 | \r |
3 | # settings\r |
cc68a136 |
4 | #mz80 = 1\r |
0af33fe0 |
5 | #debug_cyclone = 1\r |
0ace9b9a |
6 | asm_memory = 1\r |
cc68a136 |
7 | asm_render = 1\r |
8 | asm_ym2612 = 1\r |
3a81ecde |
9 | asm_misc = 1\r |
7336a99a |
10 | asm_cdpico = 1\r |
0ace9b9a |
11 | asm_cdmemory = 1\r |
e8151fd5 |
12 | amalgamate = 0\r |
490eb480 |
13 | #profile = 1\r |
cc68a136 |
14 | #use_musashi = 1\r |
1d29444d |
15 | use_sh2mame = 1\r |
cc68a136 |
16 | #up = 1\r |
17 | \r |
2d0b15bb |
18 | \r |
19 | ifeq "$(debug_cyclone)" "1"\r |
20 | use_cyclone = 1\r |
21 | use_musashi = 1\r |
2270612a |
22 | endif\r |
23 | ifeq "$(use_musashi)" "1"\r |
24 | asm_cdpico = 0\r |
2d0b15bb |
25 | asm_memory = 0\r |
26 | asm_cdmemory = 0\r |
2270612a |
27 | else\r |
2d0b15bb |
28 | use_cyclone = 1\r |
29 | endif\r |
30 | \r |
bbc8ceb9 |
31 | DEFINC = -I../.. -I. -DARM -D__GP2X__ -DIN_GP2X -DIN_EVDEV # -DBENCHMARK\r |
ee2a3bdf |
32 | CFLAGS += -Wall -Winline\r |
1dceadae |
33 | ifeq ($(DEBUG),)\r |
e39e0acb |
34 | CFLAGS += -O3 -fomit-frame-pointer -fstrict-aliasing -ffast-math\r |
1dceadae |
35 | else\r |
ee2a3bdf |
36 | CFLAGS += -ggdb\r |
1dceadae |
37 | endif\r |
cc68a136 |
38 | ifeq "$(profile)" "1"\r |
ee2a3bdf |
39 | CFLAGS += -fprofile-generate\r |
cc68a136 |
40 | endif\r |
41 | ifeq "$(profile)" "2"\r |
ee2a3bdf |
42 | CFLAGS += -fprofile-use\r |
cc68a136 |
43 | endif\r |
ee2a3bdf |
44 | CFLAGS += -mcpu=arm920t -mtune=arm920t\r |
ca482e5d |
45 | SFLAGS = $(CFLAGS)\r |
46 | ASFLAGS = -mcpu=arm920t -mfloat-abi=soft\r |
47 | CC = $(CROSS)gcc\r |
cc68a136 |
48 | STRIP = $(CROSS)strip\r |
49 | AS = $(CROSS)as\r |
50 | LD = $(CROSS)ld\r |
51 | OBJCOPY = $(CROSS)objcopy\r |
52 | \r |
53 | # frontend\r |
e39e0acb |
54 | OBJS += plat.o warm.o pollux_set.o soc.o soc_mmsp2.o soc_pollux.o emu.o in_gp2x.o\r |
cc68a136 |
55 | # 940 core control\r |
85f8e929 |
56 | OBJS += 940ctl.o\r |
eff55556 |
57 | \r |
e5f426aa |
58 | # common\r |
490eb480 |
59 | OBJS += platform/common/emu.o platform/common/menu.o platform/common/fonts.o platform/common/config.o \\r |
60 | platform/common/arm_utils.o platform/common/arm_linux.o platform/common/readpng.o \\r |
61 | platform/common/mp3_helix.o platform/common/input.o platform/common/main.o \\r |
bbc8ceb9 |
62 | platform/linux/sndout_oss.o platform/linux/plat.o platform/linux/in_evdev.o\r |
e5f426aa |
63 | \r |
cc68a136 |
64 | # Pico\r |
eff55556 |
65 | ifeq "$(amalgamate)" "1"\r |
efcba75f |
66 | OBJS += ../../picoAll.o\r |
eff55556 |
67 | else\r |
45f2f245 |
68 | OBJS += pico/area.o pico/cart.o pico/memory.o pico/pico.o pico/sek.o pico/z80if.o \\r |
69 | pico/videoport.o pico/draw2.o pico/draw.o pico/mode4.o pico/sms.o \\r |
70 | pico/misc.o pico/eeprom.o pico/patch.o pico/debug.o\r |
8c1952f0 |
71 | # Pico - CD\r |
efcba75f |
72 | OBJS += pico/cd/pico.o pico/cd/memory.o pico/cd/sek.o pico/cd/LC89510.o \\r |
73 | pico/cd/cd_sys.o pico/cd/cd_file.o pico/cd/cue.o pico/cd/gfx_cd.o \\r |
74 | pico/cd/area.o pico/cd/misc.o pico/cd/pcm.o pico/cd/buffering.o\r |
eff55556 |
75 | endif\r |
974fdb5b |
76 | # Pico - 32X\r |
db1d3564 |
77 | OBJS += pico/32x/32x.o pico/32x/memory.o pico/32x/draw.o pico/32x/pwm.o\r |
c9e1affc |
78 | # Pico - Pico\r |
efcba75f |
79 | OBJS += pico/pico/pico.o pico/pico/memory.o pico/pico/xpcm.o\r |
0ffefdb8 |
80 | # Pico - carthw\r |
efcba75f |
81 | OBJS += pico/carthw/carthw.o pico/carthw/svp/svp.o pico/carthw/svp/memory.o \\r |
82 | pico/carthw/svp/ssp16.o pico/carthw/svp/compiler.o pico/carthw/svp/stub_arm.o\r |
eff55556 |
83 | \r |
cc68a136 |
84 | # Pico - sound\r |
eff55556 |
85 | ifneq "$(amalgamate)" "1"\r |
efcba75f |
86 | OBJS += pico/sound/sound.o\r |
eff55556 |
87 | endif\r |
efcba75f |
88 | OBJS += pico/sound/mix_arm.o\r |
89 | OBJS += pico/sound/sn76496.o pico/sound/ym2612.o\r |
e39e0acb |
90 | # unzip\r |
91 | OBJS += unzip/unzip.o unzip/unzip_stream.o\r |
cc68a136 |
92 | # zlib\r |
8187ba84 |
93 | OBJS += zlib/gzio.o zlib/inffast.o zlib/inflate.o zlib/inftrees.o zlib/trees.o \\r |
94 | zlib/deflate.o zlib/crc32.o zlib/adler32.o zlib/zutil.o zlib/compress.o\r |
2d0b15bb |
95 | # debug\r |
96 | ifeq "$(debug_cyclone)" "1"\r |
efcba75f |
97 | OBJS += pico/DebugCPU.o cpu/musashi/m68kdasm.o\r |
2d0b15bb |
98 | endif\r |
490eb480 |
99 | # CPU cores\r |
e39e0acb |
100 | ifeq "$(use_musashi)" "1"\r |
101 | DEFINC += -DEMU_M68K\r |
102 | OBJS += cpu/musashi/m68kops.o cpu/musashi/m68kcpu.o\r |
103 | endif\r |
104 | ifeq "$(use_cyclone)" "1"\r |
105 | DEFINC += -DEMU_C68K\r |
5e89f0f5 |
106 | OBJS += pico/m68kif_cyclone.o cpu/Cyclone/proj/Cyclone.o cpu/Cyclone/tools/idle.o\r |
e39e0acb |
107 | endif\r |
490eb480 |
108 | ifeq "$(mz80)" "1"\r |
109 | DEFINC += -D_USE_MZ80\r |
110 | OBJS += cpu/mz80/mz80.o\r |
111 | else\r |
112 | DEFINC += -D_USE_DRZ80\r |
113 | OBJS += cpu/DrZ80/drz80.o\r |
114 | endif\r |
41397701 |
115 | OBJS += cpu/sh2/sh2.o\r |
1d29444d |
116 | ifeq "$(use_sh2mame)" "1"\r |
41397701 |
117 | OBJS += cpu/sh2/mame/sh2pico.o\r |
1d29444d |
118 | else\r |
119 | endif\r |
41397701 |
120 | OBJS += cpu/drc/cmn.o\r |
cc68a136 |
121 | \r |
8187ba84 |
122 | vpath %.c = ../..\r |
123 | vpath %.s = ../..\r |
124 | vpath %.S = ../..\r |
490eb480 |
125 | \r |
5e49c3a8 |
126 | DIRS = platform platform/gp2x platform/linux platform/common pico pico/cd pico/pico pico/32x \\r |
127 | pico/sound pico/carthw/svp zlib unzip cpu cpu/musashi cpu/Cyclone/proj cpu/Cyclone/tools \\r |
41397701 |
128 | cpu/mz80 cpu/DrZ80 cpu/sh2/mame cpu/drc\r |
cb0316e4 |
129 | \r |
8187ba84 |
130 | \r |
490eb480 |
131 | all: mkdirs PicoDrive\r |
cc68a136 |
132 | \r |
efcba75f |
133 | include ../common/common_arm.mak\r |
87b0845f |
134 | include ../common/revision.mak\r |
b3158e98 |
135 | \r |
490eb480 |
136 | # partial linking helps profiled builds due to section merging\r |
e39e0acb |
137 | PicoDrive.o : $(OBJS) ../common/helix/$(CROSS)helix-mp3.a\r |
138 | $(LD) -r -o $@ $^\r |
139 | \r |
490eb480 |
140 | # still using static, dynamic linking slows Wiz 1-10%\r |
141 | # also libm on F100 is not compatible\r |
142 | PicoDrive : PicoDrive.o\r |
b542be46 |
143 | @echo ">>>" $@\r |
e39e0acb |
144 | $(CC) -static -o $@ $(CFLAGS) $^ -lm -lpng -Wl,-Map=$@.map\r |
7336a99a |
145 | ifeq ($(DEBUG),)\r |
b542be46 |
146 | $(STRIP) $@\r |
cc68a136 |
147 | endif\r |
148 | \r |
ee2a3bdf |
149 | up: PicoDrive\r |
150 | @cp -v PicoDrive /mnt/gp2x/mnt/sd/emus/PicoDrive/\r |
672ad671 |
151 | \r |
8187ba84 |
152 | clean: tidy\r |
ee2a3bdf |
153 | $(RM) PicoDrive\r |
8187ba84 |
154 | tidy:\r |
155 | $(RM) $(OBJS)\r |
8187ba84 |
156 | \r |
7eed09b3 |
157 | readme.txt: ../../tools/textfilter ../base_readme.txt\r |
158 | ../../tools/textfilter ../base_readme.txt $@ GP2X\r |
159 | \r |
cb0316e4 |
160 | # ----------- release -----------\r |
161 | ifneq ($(findstring rel,$(MAKECMDGOALS)),)\r |
162 | ifeq ($(VER),)\r |
163 | $(error need VER)\r |
164 | endif\r |
165 | endif\r |
4010330c |
166 | CODE940 = code940/pico940_v3.bin\r |
cb0316e4 |
167 | \r |
4010330c |
168 | rel: PicoDrive PicoDrive.gpe $(CODE940) readme.txt PicoDrive.png ../game_def.cfg \\r |
490eb480 |
169 | warm_2.4.25.o warm_2.4.26-open2x.o warm_2.6.24.ko\r |
170 | zip -9 -j ../../PicoDrive_$(VER).zip $^\r |
a4f0cc86 |
171 | zip -9 -r ../../PicoDrive_$(VER).zip skin -i \*.png -i \*.txt\r |
c0fcf293 |
172 | mkdir bin_to_cso_mp3\r |
173 | cp ../../tools/bin_to_cso_mp3/* bin_to_cso_mp3/\r |
174 | zip -9 -r ../../PicoDrive_$(VER).zip bin_to_cso_mp3\r |
175 | rm -rf bin_to_cso_mp3\r |
cb0316e4 |
176 | \r |
4010330c |
177 | $(CODE940):\r |
cb0316e4 |
178 | make -C code940/\r |
179 | \r |