-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·45 lines (38 loc) · 812 Bytes
/
build.sh
File metadata and controls
executable file
·45 lines (38 loc) · 812 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
#!/usr/bin/env bash
#abort if any command fails
set -e
builddir=$(readlink -f build)
if [[ "$1" == "debug" ]]; then
debug="-DCMAKE_BUILD_TYPE=Debug"
elif [[ "$1" == "clean" ]]; then
rm -rf CMakeCache CMakeFiles/ libaesrand
exit 0
else
debug=""
fi
export CPPFLAGS=-I$builddir/include
export CFLAGS=-I$builddir/include
export LDFLAGS=-L$builddir/lib
build () {
echo building $1
path=$1
url=$2
branch=$3
if [ ! -d $path ]; then
git clone $url $path -b $branch;
else
pushd $path; git pull origin $branch; popd
fi
pushd $1
cmake -DCMAKE_INSTALL_PREFIX="${builddir}" .
make
make install
popd
echo
}
echo
echo builddir = $builddir
echo
build libaesrand https://github.com/5GenCrypto/libaesrand master
cmake "${debug}" .
make