-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild-cmd.sh
90 lines (82 loc) · 2.39 KB
/
build-cmd.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/sh
# turn on verbose debugging output for parabuild logs.
set -x
# make errors fatal
set -e
if [ -z "$AUTOBUILD" ] ; then
fail
fi
if [ "$OSTYPE" = "cygwin" ] ; then
export AUTOBUILD="$(cygpath -u $AUTOBUILD)"
fi
# run build from root of checkout
cd "$(dirname "$0")"
# load autbuild provided shell functions and variables
set +x
eval "$("$AUTOBUILD" source_environment)"
set -x
top="$(pwd)"
case "$AUTOBUILD_PLATFORM" in
"windows")
build_sln "glodlib.sln" "Debug|Default"
build_sln "glodlib.sln" "Release|Default"
mkdir -p stage/lib/{debug,release}
cp "lib/debug/glod.lib" \
"stage/lib/debug/glod.lib"
cp "lib/debug/glod.dll" \
"stage/lib/debug/glod.dll"
cp "src/api/debug/glod.pdb" \
"stage/lib/debug/glod.pdb"
cp "lib/release/glod.lib" \
"stage/lib/release/glod.lib"
cp "lib/release/glod.dll" \
"stage/lib/release/glod.dll"
;;
"darwin")
libdir="$top/stage/lib"
mkdir -p "$libdir"/{debug,release}
make -C src clean
make -C src debug
install_name_tool -id "@executable_path/../Resources/libGLOD.dylib" "lib/libGLOD.dylib"
cp "lib/libGLOD.dylib" \
"$libdir/debug/libGLOD.dylib"
make -C src clean
make -C src release
install_name_tool -id "@executable_path/../Resources/libGLOD.dylib" "lib/libGLOD.dylib"
cp "lib/libGLOD.dylib" \
"$libdir/release/libGLOD.dylib"
;;
"linux")
prefix="$top/stage/libraries/i686-linux"
mkdir -p "$prefix/include/glod"
cp "include/glod.h" "$prefix/include/glod"
libdir="$prefix/lib"
mkdir -p "$libdir"/{debug,release}
export CFLAGS=-m32
export LFLAGS=-m32
make -C src clean
make -C src debug
cp "lib/libGLOD.so" "$libdir/debug/libGLOD.so"
make -C src clean
make -C src release
cp "lib/libGLOD.so" "$libdir/release/libGLOD.so"
;;
"linux64")
prefix="$top/stage/libraries/x86_64-linux"
mkdir -p "$prefix/include/glod"
cp "include/glod.h" "$prefix/include/glod"
libdir="$prefix/lib"
mkdir -p "$libdir"/{debug,release}
export CFLAGS=-m64
export LFLAGS=-m64
make -C src clean
make -C src debug
cp "lib/libGLOD.so" "$libdir/debug/libGLOD.so"
make -C src clean
make -C src release
cp "lib/libGLOD.so" "$libdir/release/libGLOD.so"
;;
esac
mkdir -p stage/LICENSES
cp LICENSE stage/LICENSES/GLOD.txt
pass