-
Notifications
You must be signed in to change notification settings - Fork 6
/
pg
executable file
·67 lines (58 loc) · 1.45 KB
/
pg
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
#!/bin/sh
# Start Proof General with the right -I options
# Use the Makefile to rebuild dependencies if needed
# Recompile the modified file after coqide editing
update_path_vars()
{
INCLUDES=$1
PREFIX=$2
AFTERAS=
RECMODE=rec
ISPATH=0
for arg in $INCLUDES; do
case "$arg" in
-as) ;;
-R)
COQPROGARGS="$COQPROGARGS \"$arg\""
RECMODE=
ISPATH=1
;;
-I)
COQPROGARGS="$COQPROGARGS \"$arg\""
RECMODE=nonrec
ISPATH=1
;;
*)
if [ $ISPATH -eq 1 ]; then
COQPROGARGS="$COQPROGARGS \"$PREFIX$arg\""
COQLOADPATH="$COQLOADPATH ($RECMODE \"$PREFIX$arg\""
ISPATH=0
else
COQPROGARGS="$COQPROGARGS $AFTERAS\"$arg\""
COQLOADPATH="$COQLOADPATH \"$arg\")"
fi
;;
esac
case "$arg" in
-as) AFTERAS='"-as" ';;
*) AFTERAS=;;
esac
done
}
PWD=$(pwd)
COMPCERT_INCLUDES=$(make --no-print-directory -C CompCert print-includes)
COQPROGNAME=$(which coqtop)
COQPROGARGS=""
COQLOADPATH=""
update_path_vars "$COMPCERT_INCLUDES" "$PWD/CompCert/"
COQPROGARGS="\"-R\" \"$PWD\" \"Velus\" $COQPROGARGS"
COQLOADPATH="(\"$PWD\" \"Velus\") $COQLOADPATH"
#echo "COQPROGARGS=$COQPROGARGS"
#echo
#echo "COQLOADPATH=$COQLOADPATH"
emacs --eval "(setq coq-prog-name \"$COQPROGNAME\")" \
--eval "(setq coq-use-project-file nil)" \
--eval "(setq coq-prog-args '($COQPROGARGS))" \
--eval "(setq coq-load-path '($COQLOADPATH))" \
--eval "(setq compile-before-require nil)" \
"$@"