-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·79 lines (68 loc) · 1.64 KB
/
build.sh
File metadata and controls
executable file
·79 lines (68 loc) · 1.64 KB
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
#!/usr/bin/env bash
#abort if any command fails
set -e
mkdir -p build
builddir=$(readlink -f build)
export CPPFLAGS=-I$builddir/include
export CFLAGS=-I$builddir/include
export LDFLAGS=-L$builddir/lib
help () {
echo "$1: libmmap build script"
echo ""
echo "Commands:"
echo " <default> Build everything"
echo " debug Build in debug mode"
echo " clean Remove build"
echo " no-gghlite Build without gghlite"
echo " help Print this info and exit"
}
gghlite='y'
if [ x"$1" == x"" ]; then
flags=''
elif [ x"$1" == x"debug" ]; then
echo "DEBUG mode"
flags='-DCMAKE_BUILD_TYPE=Debug'
elif [ x"$1" == x"clean" ]; then
rm -rf build libaesrand clt13 gghlite
exit 0
elif [ x"$1" == x"no-gghlite" ]; then
echo "Disable gghlite"
flags='-DHAVE_GGHLITE=OFF -DCMAKE_BUILD_TYPE=Debug'
gghlite='n'
elif [ x"$1" == x"help" ]; then
help $0
exit 0
else
echo "error: unknown command '$1'"
help $0
exit 0
fi
build () {
path=$1
url=$2
branch=$3
echo
echo "building $path ($url $branch)"
echo
if [ ! -d $path ]; then
git clone $url $path -b $branch;
else
pushd $path; git pull origin $branch; popd
fi
pushd $path
cmake -DCMAKE_INSTALL_PREFIX="${builddir}" ${flags} .
make
make install
popd
}
echo
echo builddir = $builddir
echo
build libaesrand git@github.com:5GenCrypto/libaesrand master
build clt13 git@github.com:5GenCrypto/clt13 master
if [ x"$gghlite" = x"y" ]; then
build gghlite git@github.com:5GenCrypto/gghlite-flint master
fi
rm -rf CMakeCache.txt CMakeFiles
cmake ${flags} .
make