-
Notifications
You must be signed in to change notification settings - Fork 2
/
bootstrap-make
executable file
·61 lines (50 loc) · 1.19 KB
/
bootstrap-make
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
#!/bin/bash
usage() {
cat <<EOF 1>&2
Usage: $0 $@
Parameters:
--help: This!
--install: run make install after final build.
--bootstrap: run ./bootstrap (with parameters \$BOOTSTRAP).
--config: run configure after bootstrap, before makes
(with parameters \$CONFIG).
Rebuilds the system from the ground up, building codegen
and running a distcheck.
EOF
exit -1
}
runif() {
local test=$1
shift
if ${!test}; then
echo "Running: $@"
"$@"
local r=$?
[[ $r != 0 ]] && exit $r
fi
return 0
}
install=false
bootstrap=false
config=false
true=:
for i ; do
case "$i" in
--install) install=: ;;
--bootstrap) bootstrap=: ;;
--config) config=: ;;
--help) usage ;;
*) break ;;
esac
shift
done
[[ $# != 0 ]] && usage
runif bootstrap ./bootstrap $BOOTSTRAP
runif config ./configure --enable-plugins --enable-plugins-support \
--enable-maintainer-mode --enable-petsc --enable-rthreads \
--with-petsc=/opt/petsc/ --with-petsc-arch=linux_deb_d \
CPPFLAGS="-Wall -g -O2" $CONFIG
for i in clean gencode clean -j9 clean distcheck clean -j9; do
runif true make $i
done
runif install make install