aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jason Gross <jagro@google.com>2016-07-20 15:26:26 -0700
committerGravatar Jason Gross <jagro@google.com>2016-07-20 15:27:51 -0700
commit22f5069791d4c201441f553c756e32e18b88ffac (patch)
treed2ddf774a2cf26c63f1db046ce6e0a694aa6c9a5
parent476f078855a221a2ec47a63e7efdceaa35acd488 (diff)
Add target for .dir-locals.el
This fixes #31 Thanks @cpitclaudel!
-rw-r--r--.dir-locals.el.in5
-rw-r--r--.gitignore1
-rw-r--r--Makefile37
3 files changed, 19 insertions, 24 deletions
diff --git a/.dir-locals.el.in b/.dir-locals.el.in
new file mode 100644
index 000000000..6153af754
--- /dev/null
+++ b/.dir-locals.el.in
@@ -0,0 +1,5 @@
+((coq-mode . ((eval . (let* ((project-root (locate-dominating-file buffer-file-name "_CoqProject"))
+ (coqprime-folder (expand-file-name "@COQPRIME@" project-root))
+ (coq-path (split-string (or (getenv "COQPATH") "") ":" t)))
+ (unless (memql coqprime-folder coq-path)
+ (setenv "COQPATH" (mapconcat #'identity (cons coqprime-folder coq-path) ":"))))))))
diff --git a/.gitignore b/.gitignore
index b22a815ee..aeba9e55d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,7 @@
*.vo
*~
.#*
+/.dir-locals.el
Makefile.bak
Makefile.coq
Makefile.coq.bak
diff --git a/Makefile b/Makefile
index b6ae6ab61..6dfe0a04a 100644
--- a/Makefile
+++ b/Makefile
@@ -2,9 +2,7 @@ MOD_NAME := Crypto
SRC_DIR := src
.PHONY: coq clean update-_CoqProject cleanall install \
- install-coqprime install-coqprime-8.4 install-coqprime-8.5 \
- clean-coqprime clean-coqprime-8.4 clean-coqprime-8.5 \
- coqprime coqprime-8.4 coqprime-8.5
+ install-coqprime clean-coqprime coqprime
.DEFAULT_GOAL := coq
SORT_COQPROJECT = sed 's,[^/]*/,~&,g' | env LC_COLLATE=C sort | sed 's,~,,g'
@@ -19,32 +17,19 @@ COQ_VERSION_PREFIX = The Coq Proof Assistant, version
COQ_VERSION := $(firstword $(subst $(COQ_VERSION_PREFIX),,$(shell $(COQBIN)coqc --version 2>/dev/null)))
ifneq ($(filter 8.4%,$(COQ_VERSION)),) # 8.4
-coqprime: coqprime-8.4
-clean-coqprime: clean-coqprime-8.4
-install-coqprime: install-coqprime-8.4
+COQPRIME_FOLDER := coqprime-8.4
else
-coqprime: coqprime-8.5
-clean-coqprime: clean-coqprime-8.5
-install-coqprime: install-coqprime-8.5
+COQPRIME_FOLDER := coqprime
endif
-coqprime-8.4:
- $(MAKE) -C coqprime-8.4
+coqprime:
+ $(MAKE) -C $(COQPRIME_FOLDER)
-coqprime-8.5:
- $(MAKE) -C coqprime
+clean-coqprime:
+ $(MAKE) -C $(COQPRIME_FOLDER) clean
-clean-coqprime-8.4:
- $(MAKE) -C coqprime-8.4 clean
-
-clean-coqprime-8.5:
- $(MAKE) -C coqprime clean
-
-install-coqprime-8.4:
- $(MAKE) -C coqprime-8.4 install
-
-install-coqprime-8.5:
- $(MAKE) -C coqprime install
+install-coqprime:
+ $(MAKE) -C $(COQPRIME_FOLDER) install
Makefile.coq: Makefile _CoqProject
$(Q)$(COQBIN)coq_makefile -f _CoqProject -o Makefile.coq
@@ -54,7 +39,11 @@ clean: Makefile.coq
rm -f Makefile.coq
cleanall: clean clean-coqprime
+ rm -f .dir-locals.el
install: coq Makefile.coq
$(MAKE) install-coqprime
$(MAKE) -f Makefile.coq install
+
+.dir-locals.el::
+ sed 's:@COQPRIME@:$(COQPRIME_FOLDER):g' .dir-locals.el.in > $@