-
Notifications
You must be signed in to change notification settings - Fork 89
Expand file tree
/
Copy pathhol_4.14.sh
More file actions
executable file
·63 lines (53 loc) · 1.69 KB
/
hol_4.14.sh
File metadata and controls
executable file
·63 lines (53 loc) · 1.69 KB
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
#!/bin/bash
# Makefile will replace __DIR__ with the path
export HOLLIGHT_DIR=__DIR__
export HOLLIGHT_USE_MODULE=__USE_MODULE__
if [ "$#" -eq 1 ]; then
if [ "$1" == "-pp" ]; then
echo "camlp5r pa_lexer.cmo pa_extend.cmo q_MLast.cmo -I \"${HOLLIGHT_DIR}\" pa_j.cmo"
exit 0
elif [ "$1" == "-dir" ]; then
echo "${HOLLIGHT_DIR}"
exit 0
elif [ "$1" == "-use-module" ]; then
echo "${HOLLIGHT_USE_MODULE}"
exit 0
fi
fi
# If a local OPAM is installed, use it
if [ -d "${HOLLIGHT_DIR}/_opam" ]; then
eval $(opam env --switch "${HOLLIGHT_DIR}/" --set-switch)
fi
if [ "$#" -gt 1 ]; then
if [ "$1" == "inline-load" ]; then
# Do the inlining.
shift
ocaml ${HOLLIGHT_DIR}/inline_load.ml $@
exit $?
elif [ "$1" == "compile" ]; then
# Native-compile the source code using ocamlopt.
shift
OCAMLRUNPARAM=l=2000000000 ocamlopt.byte \
-pp "camlp5r pa_lexer.cmo pa_extend.cmo q_MLast.cmo -I \"${HOLLIGHT_DIR}\" pa_j.cmo" \
-I "${HOLLIGHT_DIR}" -I +unix -c \
hol_lib.cmxa $@
exit $?
elif [ "$1" == "link" ]; then
# Link the native module
shift
ocamlfind ocamlopt -package zarith,unix -linkpkg hol_lib.cmxa \
-I "${HOLLIGHT_DIR}" $@
exit $?
fi
fi
# The default ocaml REPL does not accept arrow keys.
# Export LINE_EDITOR to a proper program to enable this before invoking this
# script. If not set, ledit will be used.
if [ "${LINE_EDITOR}" == "" ]; then
LINE_EDITOR="ledit"
fi
# If a custom hol.ml is given, use it. This variable is used by make-checkpoint.sh .
if [ "${HOL_ML_PATH}" == "" ]; then
HOL_ML_PATH="${HOLLIGHT_DIR}/hol.ml"
fi
${LINE_EDITOR} ${HOLLIGHT_DIR}/ocaml-hol -init ${HOL_ML_PATH} -I ${HOLLIGHT_DIR}