forked from plclub/hs-to-coq
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboot.sh
executable file
·157 lines (135 loc) · 3.46 KB
/
boot.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#!/bin/bash
set -e
################################################################################
## Arguments and configuring what does/doesn't get done
CLEAN=YES
COQ=YES
COQ_TEST=YES
COQ_VERSION=8.10
function clean () { if [ "$CLEAN" = "YES" ]; then "$@"; fi }
function coq () { if [ "$COQ" = "YES" ]; then "$@"; fi }
function coq-test () { if [ "$COQ_TEST" = "YES" ]; then "$@"; fi }
function usage () {
echo "Usage: $0 [OPTION]"
echo
echo "Possible options:"
echo " - full: Clean, run Coq, and run tests [default]"
echo " - noclean: Don't clean"
echo " - nocoq: Don't run Coq"
echo " - quick: Don't clean or run tests"
echo " - help: Print this help message"
}
case $# in
0)
OPTION='full'
;;
1)
OPTION=$1
;;
*)
echo "Too many arguments"
echo
usage
exit 1
esac
case $OPTION in
full)
echo "Doing everything"
;;
noclean)
echo "Skipping cleaning"
CLEAN=NO
;;
nocoq)
echo "Skipping running Coq"
COQ=NO
COQ_TEST=NO
;;
quick)
echo "Skipping cleaning and tests"
CLEAN=NO
COQ_TEST=NO
;;
help|--help|-h)
usage
exit 0
;;
*)
echo "Unknown option $1"
echo
usage
exit 1
esac
################################################################################
## Rebuild what's requested
cd $(dirname $0)
if [ -z "$NO_BUILD_HS_TO_COQ" ] && which stack >/dev/null
then
echo "Rebuilding the tool if necessary"
stack build
fi
function have () { command -v "$1" >/dev/null 2>&1 ; }
function check_coq_version() {
if ! which coqc >/dev/null
then
echo "No coqc in the path. Did you forget to run . <(opam config env)?"
exit 1
fi
if ! coqc --version | grep -q -F "$COQ_VERSION"
then
echo "coqc does not seem to be version $COQ_VERSION. Did you forget to run . <(opam config env)?"
exit 1
fi
}
coq check_coq_version
clean echo "Cleaning everything"
clean make -C tests clean
clean make -C base-tests clean
clean make -C successors clean
clean make -C intervals clean
clean make -C compiler clean
clean make -C dlist clean
clean make -C rle clean
clean make -C bag clean
clean make -C quicksort clean
clean make -C coinduction clean
clean make -C ../base-thy clean
clean make -C containers clean
clean make -C containers/theories clean
clean make -C ghc/theories clean
clean make -C core-semantics clean
clean make -C base-src clean
clean make -C transformers clean
clean make -C ghc clean
have ruby && clean make -C ../emacs clean
have sphinx-build && clean make -C ../doc clean
have ruby && make -C ../emacs
have sphinx-build && make -C ../doc html
coq-test make -C tests
make -C base-src vfiles
coq make -C base-src coq
(cd ../base-thy; coq coq_makefile -f _CoqProject -o Makefile)
coq make -C ../base-thy
coq-test make -C base-tests
make -C containers vfiles
coq make -C containers coq
(cd containers/theories; coq coq_makefile -f _CoqProject -o Makefile)
coq make -C containers/theories
make -C transformers vfiles
coq make -C transformers coq
#coq make -C transformers/theories no theories yet
make -C ghc vfiles
coq make -C ghc/lib
(cd ghc/theories; coq coq_makefile -f _CoqProject -o Makefile)
coq make -C ghc/theories
make -C core-semantics vfiles
coq make -C core-semantics coq
#coq make -C core-semantics/theories theories yet
coq make -C successors
coq make -C intervals
coq make -C compiler
coq make -C rle
coq make -C bag
coq make -C quicksort
coq make -C dlist
coq make -C coinduction