-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-dev.sh
executable file
·66 lines (56 loc) · 1.39 KB
/
build-dev.sh
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/bash
SWITCHES=${SWITCHES:- \
ocaml4.12.1-coq8.13.2-ssr1.12.0 \
ocaml4.13.1-coq8.14.1-ssr1.13.0 \
ocaml4.13.1-coq8.15.0-ssr1.14.0 \
ocaml4.14.0-coq8.15.2-ssr1.14.0 \
ocaml4.14.0-coq8.16.0-ssr1.15.0 \
}
BUILD_DIR=_build
if [[ "$1" == "clean" ]]; then
rm -rf ${BUILD_DIR}
exit
fi
CURRENT=`opam switch show`
for s in ${SWITCHES}; do
echo "Building with ${s}"
echo -n " * Running 'opam switch' "
opam switch ${s} &> /dev/null
status=$?
if [[ ${status} == 0 ]]; then
echo "[DONE]"
else
echo "[FAIL]"
continue
fi
eval $(opam env)
echo -n " * Copying files "
mkdir -p ${BUILD_DIR}/${s}
tar -c --exclude ${BUILD_DIR} --exclude "*.vo" --exclude "*.vok" --exclude "*.vos" --exclude "*.glob" * | tar -x --keep-newer-files -C ${BUILD_DIR}/${s} &> /dev/null
echo "[DONE]"
echo -n " * Building Coq code "
make -C ${BUILD_DIR}/${s} all >${BUILD_DIR}/${s}.log 2>&1
status=$?
if [[ $status == 0 ]]; then
echo "[DONE]"
echo -n " * Building OCaml code "
pushd ${BUILD_DIR}/${s}/src/ocaml &> /dev/null
dune build &> /dev/null
status=$?
if [[ $status == 0 ]]; then
echo "[DONE]"
else
echo "[FAIL]"
fi
popd &> /dev/null
else
echo "[FAIL]"
fi
done
echo
echo "See the following log files for compilation details."
for s in ${SWITCHES}; do
echo " * ${BUILD_DIR}/${s}.log"
done
opam switch ${CURRENT}
eval $(opam env)