-
Notifications
You must be signed in to change notification settings - Fork 42
/
autobuild
executable file
·66 lines (66 loc) · 2.48 KB
/
autobuild
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
#!/bin/sh
if [ "$1" = "--help" ]; then
echo "Description: Automation script to handle the build and distribution process of this project"
echo "Options:"
echo "$0 --generate"
echo " generates configuration aclocal.m4 and Makefile.in if any are missing"
echo "$0 --regenerate"
echo " generates configuration aclocal.m4 and Makefile.in even if they already exist"
echo "$0 --configure [--enable-tests] [--enable-opencl]"
echo " runs configuration if Makefile is not found, option to include tests"
echo "$0 --reconfigure [--enable-tests] [--enable-opencl]"
echo " force runs configuration, option to include tests"
echo "$0 --test"
echo " build and run the test suite"
echo "$0 --build"
echo " build the program"
echo "$0 --distribute"
echo " build the tarball"
echo "$0 --install"
echo " build and install the program"
echo "$0 --install-python"
echo " build and install the python extension"
elif [ "$1" = "--clean" ]; then
echo "Cleaning Dependency Tests"
if [ -f "Makefile" -a -f "config.status" ]; then
make clean
fi
for file in config.log autom4te.cache aclocal.m4; do
if [ -f $file -o -d $file ]; then
echo "removing $file"
rm -rf $file
fi
done
elif [ "$1" = "--generate" ]; then
if [ ! -f "configure" -o ! -f "Makefile.in" -o "$2" = "--force" ]; then
echo "Generating Dependency Tests"
autoreconf --install --warnings=all && aclocal && automake || echo "Failed to generate dependency tests."
./$0 --clean
fi
elif [ "$1" = "--regenerate" ]; then
./$0 --generate --force
elif [ "$1" = "--configure" ]; then
./$0 --generate
if [ ! -f "Makefile" ]; then
echo "Executing Dependency Tests"
./configure $2
./$0 --clean
fi
elif [ "$1" = "--reconfigure" ]; then
./$0 --generate
echo "Executing Dependency Tests"
./configure $2
./$0 --clean
elif [ "$1" = "--test" ]; then
./$0 --configure --enable-tests && make -j4 test
elif [ "$1" = "--build" ]; then
./$0 --configure $2 $3 && make -j4 gosdt && mv gosdt build/
elif [ "$1" = "--distribute" ]; then
./$0 --configure $2 $3 && make -j4 dist && mv gosdt-* build/
elif [ "$1" = "--install" ]; then
./$0 --configure $2 $3 && make -j4 && make install
elif [ "$1" = "--install-python" ]; then
./$0 --configure $2 $3 && make -j4 clean && python3 setup.py clean && python3 setup.py build && python3 setup.py install
else
./$0 --help
fi