Subversion Repositories eduke32

Rev

Rev 6055 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6055 Rev 6431
Line 3... Line 3...
3
get_abs_path()
3
get_abs_path()
4
{
4
{
5
    echo "$(cd "$1" && pwd)"
5
    echo "$(cd "$1" && pwd)"
6
}
6
}
7
7
-
 
8
get_num_logical_cpus()
-
 
9
{
-
 
10
    getconf _NPROCESSORS_ONLN 2>/dev/null || getconf NPROCESSORS_ONLN 2>/dev/null || echo 1
-
 
11
}
-
 
12
8
targets=( eduke32 mapster32 )
13
targets=( eduke32 mapster32 )
9
extensions=( ".dol" )
14
extensions=( ".dol" )
10
15
-
 
16
-
 
17
# Change directory to the eduke32 root:
-
 
18
11
sourcedir="$(dirname "${BASH_SOURCE[0]}")"
19
sourcedir="$(dirname "${BASH_SOURCE[0]}")"
12
sourcedir="$(get_abs_path "$sourcedir/..")"
20
sourcedir="$(get_abs_path "$sourcedir/..")"
13
21
14
pushd "${sourcedir}" >/dev/null
22
pushd "${sourcedir}" >/dev/null
15
23
-
 
24
-
 
25
# Set up PATH
-
 
26
-
 
27
p=${DEVKITPPC}/bin:${PATH}
-
 
28
-
 
29
pathstoremove=( "/mingw64/bin" )
-
 
30
-
 
31
for i in "${pathstoremove[@]}"; do
-
 
32
    p=${p/:${i}/}
-
 
33
done
-
 
34
-
 
35
export PATH=${p}
-
 
36
-
 
37
16
# Detect versioning systems and pull the revision number:
38
# Detect versioning systems and pull the revision number:
-
 
39
17
export VC_REV=$(svn info 2> /dev/null | grep Revision | awk '{ print $2 }')
40
export VC_REV=$(svn info 2> /dev/null | grep Revision | awk '{ print $2 }')
18
vc=svn
41
vc=svn
19
if [ -z "$VC_REV" ]; then
42
if [ -z "$VC_REV" ]; then
20
    vc=git
43
    vc=git
21
    export VC_REV=$(git svn info 2> /dev/null | grep Revision | awk '{ print $2 }')
44
    export VC_REV=$(git svn info 2> /dev/null | grep Revision | awk '{ print $2 }')
Line 25... Line 48...
25
    vc=none
48
    vc=none
26
fi
49
fi
27
50
28
date=$(date +%Y%m%d)
51
date=$(date +%Y%m%d)
29
52
-
 
53
-
 
54
# Build:
-
 
55
30
make=( make PLATFORM=WII $* STRIP="" SDLCONFIG="" )
56
make=( make PLATFORM=WII $* STRIP="" )
31
57
32
echo "${make[@]}"
58
echo "${make[@]}"
33
"${make[@]}"
59
"${make[@]}"
34
60
35
for i in "${targets[@]}"; do
61
for i in "${targets[@]}"; do
Line 38... Line 64...
38
            exit 1
64
            exit 1
39
        fi
65
        fi
40
    done
66
    done
41
done
67
done
42
68
-
 
69
43
# Package data:
70
# Package data:
-
 
71
44
mkdir -p apps
72
mkdir -p apps
45
73
46
for i in "${targets[@]}"; do
74
for i in "${targets[@]}"; do
47
    cp -R "platform/Wii/apps/$i" "apps/"
75
    cp -R "platform/Wii/apps/$i" "apps/"
48
    for j in "${extensions[@]}"; do
76
    for j in "${extensions[@]}"; do
Line 65... Line 93...
65
    rm -f apps/mapster32/*.dll
93
    rm -f apps/mapster32/*.dll
66
fi
94
fi
67
95
68
ls -l -R apps
96
ls -l -R apps
69
97
-
 
98
cpus=$(get_num_logical_cpus)
-
 
99
70
rm -f "eduke32-wii-r${VC_REV}-debug-elf.7z"
100
rm -f "eduke32-wii-r${VC_REV}-debug-elf.7z"
71
rm -f "eduke32-wii-r${VC_REV}.7z"
101
rm -f "eduke32-wii-r${VC_REV}.7z"
72
7zr a -mx9 -ms=on -t7z "eduke32-wii-r${VC_REV}-debug-elf.7z" *.elf -xr!*.svn*
102
7zr a -mx9 -ms=on -t7z -m0=lzma2 -mmt${cpus} "eduke32-wii-r${VC_REV}-debug-elf.7z" *.elf -xr!*.svn*
73
7zr a -mx9 -ms=on -t7z "eduke32-wii-r${VC_REV}.7z" apps -xr!*.svn*
103
7zr a -mx9 -ms=on -t7z -m0=lzma2 -mmt${cpus} "eduke32-wii-r${VC_REV}.7z" apps -xr!*.svn*
-
 
104
-
 
105
# Clean up:
74
106
75
popd >/dev/null
107
popd >/dev/null