-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
46 lines (38 loc) · 715 Bytes
/
build.sh
File metadata and controls
46 lines (38 loc) · 715 Bytes
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
#!/bin/bash
ACTION="$1"
BUILD="$2"
# guess OS
if [ $# -lt 2 ]; then
unamestr=`uname`
if [[ "$unamestr" == MINGW32_NT* ]]; then # msysgit
BUILD="vs2008"
fi
fi
if [ -z "$BUILD" ]; then
BUILD="gmake"
fi
function clean_output() {
if [ "$BUILD" == "gmake" ]; then
make config=all clean
fi
rm -rf "out"
}
if [ "$ACTION" == "clean" ]; then
clean_output
premake4 clean
exit
fi
if [ ! -f "Makefile" ]; then
premake4 $BUILD
if [ "$BUILD" == "gmake" ]; then
# fix `/usr/lib`-firstness for 32-bit and 64-bit
sed -i -e 's/ -L\/usr\/lib32//g' -e 's/ -L\/usr\/lib64//g' duct.make
fi
fi
if [ "$BUILD" == "gmake" ]; then
if [ -z "$ACTION" ]; then
make config=all
else
make config="$ACTION"
fi
fi