-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathbuild.sh
89 lines (77 loc) · 1.88 KB
/
build.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
#!/bin/bash
vc_ver=latest
# create directory for placing makefiles
mkdir -p obj
# function for building single target
# usage: build <target-name> [verbose]
function build()
{
local cfg sdk host year amd64 libdir vctool_opts
cfg=$1
# check host application
if [[ $cfg = Maya* ]]; then
host="Maya"
year=${cfg:4:4}
amd64=${cfg:8}
elif [[ $cfg = Max* ]]; then
host="Max"
year=${cfg:3:4}
amd64=${cfg:7}
else
echo "ERROR: unknown target $cfg"
exit
fi
# x64 and x86 differs in libraries only; x64 libs are either in sdk_x64/lib or sdk/x64/lib
sdk="SDK/$host$year"
if ! [ -d "$sdk" ] && [ "$amd64" ]; then
# no directlry, try _x64 suffix
sdk=${sdk}_x64
libdir=$sdk/lib
elif [ "$amd64" ]; then
libdir=$sdk/x64/lib
else
libdir=$sdk/lib
fi
# check SDK for selected platform
# echo "... testing config: $cfg host=$host year=$year amd64=$amd64 -> $sdk"
if ! [ -d $libdir ]; then
# echo "... NOT FOUND $sdk ($libdir)" #!!!
if [ "$2" ]; then
echo ERROR: SDK for $cfg was not found!
fi
return
fi
# echo "FOUND $sdk ($libdir)"
echo
echo "----------------- Building $cfg -----------------"
echo
# check bitness (32/64)
if [ $amd64 ]; then
vctool_opts="--64"
platform="vc-win64"
else
vctool_opts=""
platform="vc-win32"
fi
# generate makefile
makefile=obj/ActorX_$cfg.mak
./genmake ActorX_$host.project SDK_INC=$sdk/include SDK_LIB=$libdir CFG=$cfg VER=$year TARGET=$platform > $makefile
# build
vc32tools --version=$vc_ver $vctool_opts --make $makefile || exit 1
}
# build specific version if needed (may specify multiple versions)
if [ "$1" ]; then
for ver in $*; do
build "$ver" 1
done
exit
fi
# build all known targets
for host in "Max" "Maya"; do
for ver in {2012..2030}; do
for amd64 in "" "_x64"; do
cfg=${host}${ver}${amd64}
build $cfg
done
done
done