| 865 |
user890104 |
1 |
#!/bin/bash
|
|
|
2 |
#
|
|
|
3 |
#
|
|
|
4 |
# Copyright 2012 user890104
|
|
|
5 |
#
|
|
|
6 |
#
|
|
|
7 |
# This file is part of emCORE.
|
|
|
8 |
#
|
|
|
9 |
# emCORE is free software: you can redistribute it and/or
|
|
|
10 |
# modify it under the terms of the GNU General Public License as
|
|
|
11 |
# published by the Free Software Foundation, either version 2 of the
|
|
|
12 |
# License, or (at your option) any later version.
|
|
|
13 |
#
|
|
|
14 |
# emCORE is distributed in the hope that it will be useful,
|
|
|
15 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
16 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
17 |
# See the GNU General Public License for more details.
|
|
|
18 |
#
|
|
|
19 |
# You should have received a copy of the GNU General Public License
|
|
|
20 |
# along with emCORE. If not, see <http://www.gnu.org/licenses/>.
|
|
|
21 |
#
|
|
|
22 |
#
|
|
|
23 |
|
|
|
24 |
# Builds the installers
|
|
|
25 |
# Adjust the path below, it needs to point to the root of our svn tree
|
|
|
26 |
# You also need a rockbox tree at the same level as our svn tree, that
|
|
|
27 |
# includes builds for ipodnano2g and ipod6g, in build-ipodnano2g and
|
|
|
28 |
# build-ipod6g, respectively.
|
|
|
29 |
|
|
|
30 |
ROOT_PATH='/home/venci/freemyipod/'
|
|
|
31 |
|
|
|
32 |
# what to build? builds the classic installer by default
|
|
|
33 |
|
|
|
34 |
DIRS=(\
|
|
|
35 |
'tools/ucl' \
|
|
|
36 |
'tools/elf2emcoreapp' \
|
|
|
37 |
'apps/installer-ipodclassic' \
|
|
|
38 |
)
|
|
|
39 |
# 'apps/installer-ipodnano2g' \
|
|
|
40 |
|
|
|
41 |
# end of configuration
|
|
|
42 |
|
|
|
43 |
cd "${ROOT_PATH}" || exit 1
|
|
|
44 |
|
|
|
45 |
for i in $(seq 0 $[${#DIRS[@]} - 1])
|
|
|
46 |
do
|
|
|
47 |
echo '== [begin] '"${DIRS[${i}]}"': make clean =='
|
|
|
48 |
|
|
|
49 |
cd "${ROOT_PATH}${DIRS[${i}]}" && \
|
|
|
50 |
\
|
|
|
51 |
if [ 'apps/installer-ipodnano2g' = "${DIRS[${i}]}" ] \
|
|
|
52 |
|| [ 'apps/installer-ipodclassic' = "${DIRS[${i}]}" ]
|
|
|
53 |
then
|
|
|
54 |
echo
|
|
|
55 |
#rm -vf 'flashfiles.built' && \
|
|
|
56 |
#find flashfiles -maxdepth 1 -type f |xargs rm -vrf
|
|
|
57 |
elif [ 'tools/elf2emcoreapp' = "${DIRS[${i}]}" ]
|
|
|
58 |
then
|
|
|
59 |
rm -vf '../arm-elf-eabi-elf2emcoreapp'
|
|
|
60 |
fi
|
|
|
61 |
|
|
|
62 |
echo '== [end] '"${DIRS[${i}]}"': make clean =='
|
|
|
63 |
done
|
|
|
64 |
|
|
|
65 |
cd "${ROOT_PATH}" || exit 2
|
|
|
66 |
|
|
|
67 |
if [ -n "${1}" ]
|
|
|
68 |
then
|
|
|
69 |
if [ '0' = "${1}" ]
|
|
|
70 |
then
|
|
|
71 |
exit
|
|
|
72 |
fi
|
|
|
73 |
|
|
|
74 |
svn -r "${1}" update || exit 3
|
|
|
75 |
else
|
|
|
76 |
svn update || exit 3
|
|
|
77 |
fi
|
|
|
78 |
|
|
|
79 |
rm -vf "${ROOT_PATH}emcore/trunk/build/version.h"
|
|
|
80 |
|
|
|
81 |
for i in $(seq 0 $[${#DIRS[@]} - 1])
|
|
|
82 |
do
|
|
|
83 |
echo '== [begin] '"${DIRS[${i}]}"': make =='
|
|
|
84 |
|
|
|
85 |
cd "${ROOT_PATH}${DIRS[${i}]}" && \
|
|
|
86 |
|
|
|
87 |
if [ 'apps/installer-ipodnano2g' = "${DIRS[${i}]}" ]
|
|
|
88 |
then
|
|
|
89 |
make flashfiles && \
|
|
|
90 |
'../../tools/ucl2e10singleblk' '../../../rockbox/build-ipodnano2g/rockbox.ipod' 'flashfiles/rockbox.ipod.ucl' && \
|
|
|
91 |
make
|
|
|
92 |
elif [ 'apps/installer-ipodclassic' = "${DIRS[${i}]}" ]
|
|
|
93 |
then
|
|
|
94 |
make flashfiles && \
|
|
|
95 |
'../../tools/ucl2e10singleblk' '../../../rockbox/build-ipod6g/rockbox.ipod' 'flashfiles/rockbox.ipod.ucl' && \
|
|
|
96 |
make
|
|
|
97 |
elif [ 'tools/elf2emcoreapp' = "${DIRS[${i}]}" ]
|
|
|
98 |
then
|
|
|
99 |
#make
|
|
|
100 |
ln -vs 'elf2emcoreapp/arm-elf-eabi-elf2emcoreapp' '../'
|
|
|
101 |
else
|
|
|
102 |
make
|
|
|
103 |
fi
|
|
|
104 |
|
|
|
105 |
STATUSES[${i}]=$?
|
|
|
106 |
|
|
|
107 |
echo '== [end] '"${DIRS[${i}]}"': make =='
|
|
|
108 |
done
|
|
|
109 |
|
|
|
110 |
for i in $(seq 0 $[${#DIRS[@]} - 1])
|
|
|
111 |
do
|
|
|
112 |
echo -n "${DIRS[${i}]}"': '
|
|
|
113 |
|
|
|
114 |
if [ -n "{STATUSES[${i}]}" ] && [ '0' = "${STATUSES[${i}]}" ]
|
|
|
115 |
then
|
|
|
116 |
echo 'SUCCESS!'
|
|
|
117 |
else
|
|
|
118 |
echo 'ERROR!'
|
|
|
119 |
fi
|
|
|
120 |
done
|