-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild_all.sh
147 lines (127 loc) · 3.29 KB
/
build_all.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#!/bin/bash
# SETA e TAITO_SEIBU devono stare insieme perche` condividono driver
size=/c/devkitPro/devkitPPC/bin/powerpc-eabi-size.exe
prj=powerpc-eabi-mame4wii
obj=obj/wii/${prj}
hbc_src="src/hbc"
hbc_home="HBC"
hbc_apps="${hbc_home}/apps/mame4wii"
hbc_mame="${hbc_home}/mame4wii/"
hbc_mamelibs="${hbc_mame}/libs"
hbc_mamesnap="${hbc_mame}/snap"
hbc_mamecrash="${hbc_mame}/crash"
hbc_mamelogs="${hbc_mame}/logs"
hbc_mameroms="${hbc_mame}/roms"
m4w_version="1.35.3"
elf_home="ELF"
cwd=$(pwd)
if [[ "$1" == "--osd" ]]
then
rm -fr ${obj}/libosd.a ${obj}/osd
shift
fi
if [[ "$1" == "--force" ]]
then
rm -fr ${obj}
shift
fi
mkdir -p ${hbc_home} ${elf_home}
if [[ "${1}" == "" ]]
then
source ./liste.env
lista_totale="${lista_taito} ${lista_sega} ${lista_konami} ${lista_neogeo}"
mkdir -p ${hbc_mamelibs}
rm -f ${hbc_mamelibs}/*
rm -f ${elf_home}/*
echo "Make LIBS"
rm -f ${obj}/version.o
for ll in ${lista_totale}
do
build="MAME4Wii${ll}"
lista="${ll}"
make_par=""
for l in ${lista}; do
if [[ ${l:0:1} == "#" ]]; then
echo "skip ${l:1}"
else
make_par="${make_par} -D${l}"
fi
done
rm -f ${obj}/mame/4wii.o ${build}.elf ${build}.dol
make GAME_LIST="${make_par}" WII_VERSION="${m4w_version}" WII_BUILD="${build}"
if [[ $? -eq 0 ]]
then
mkdir -p ${elf_home}
mv ${prj}.elf ${build}.elf
mv ${prj}.dol ${hbc_mamelibs}/${build}.dol
$size ${build}.elf
mv -f ${build}.elf ${elf_home}/.
else
echo "Failed make ${build}"
exit 1
fi
done
fi
# MENU
echo "Make MENU"
mkdir -p ${hbc_apps}
rm -f ${hbc_apps}/*
cd src/menu
make clean
make
if [[ $? -eq 0 ]]
then
cp -f menu.dol ${cwd}/${hbc_apps}/boot.dol
fi
cd ${cwd}
# LOADER
echo "Make LOADER"
rm -f ${hbc_mamelibs}/loader.dol
cd src/loader
make clean
make
if [[ $? -eq 0 ]]
then
cp -f loader.dol ${cwd}/${hbc_mamelibs}/loader.dol
fi
cd ${cwd}
if [[ "${1}" == "" ]] || [[ "${1}" == "hbc" ]]
then
# Make homebrew app
echo "Make homebrew app"
now=$(date +%Y%m%d)
echo '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' > ${hbc_apps}/meta.xml
echo '<app version="'${m4w_version}'">' >> ${hbc_apps}/meta.xml
echo ' <name>MAME4Wii</name>' >> ${hbc_apps}/meta.xml
echo ' <coder>Nebiun</coder>' >> ${hbc_apps}/meta.xml
echo ' <version>'${m4w_version}'(MAME 0.135s)</version>' >> ${hbc_apps}/meta.xml
echo ' <release_date>'${now}'</release_date>' >> ${hbc_apps}/meta.xml
echo ' <short_description>Arcade Emulation</short_description>'>> ${hbc_apps}/meta.xml
echo ' <long_description>MAME for Wii based on WII Mame 1.0</long_description>'>> ${hbc_apps}/meta.xml
echo ' <no_ios_reload/>' >> ${hbc_apps}/meta.xml
echo '</app>' >> ${hbc_apps}/meta.xml
# IMAGE & INI
cp -f ${hbc_src}/mame4wii.png ${hbc_apps}/.
cp -f ${hbc_src}/mame.ini ${hbc_mame}/.
# DIRECTORES
mkdir -p ${hbc_mamesnap}
mkdir -p ${hbc_mamelogs}
mkdir -p ${hbc_mamecrash}
mkdir -p ${hbc_mameroms}
# SNAPSHOT
rm -f ${hbc_mamesnap}/*
cp -f ${hbc_src}/nosnap.png ${hbc_mamesnap}/.
# BUILD APP ARCHIVE
cd ${hbc_home}
rm -f mame4wii-*.zip
zip -r mame4wii-${m4w_version}.zip apps mame4wii
cd ${cwd}
if [[ -d mame4wii_snap ]]
then
cp -f mame4wii_snap/* ${hbc_mamesnap}/.
cd mame4wii_snap
rm -f ${cwd}/${hbc_home}/mame4wii_snap.zip
zip -r ${cwd}/${hbc_home}/mame4wii_snap.zip *.png
cd ${cwd}
fi
fi