aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/CoqMakefile.in
diff options
context:
space:
mode:
authorGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2018-02-28 11:55:14 +0100
committerGravatar Gaëtan Gilbert <gaetan.gilbert@skyskimmer.net>2018-02-28 12:32:59 +0100
commit195c03f798141dc816e97def7275bbdd1aa623a2 (patch)
tree5930215865bf0840ceefba46c10bdd0de87ad47b /tools/CoqMakefile.in
parente3124e098ef8170dac2b348b91757a7034bc4999 (diff)
Fix #6830: coqdep VDFILE uses too many arguments for fiat-crypto/OSX
We fix as suggested by @JasonGross by reading file names from the _CoqProject when coq_makefile was invoked with one. I made coqdep only look at the .v files from _CoqProject because it's easier this way. Since we're going through the _CoqProject parser we could have coqdep understand more of it but let's leave that to another PR (and maybe someone else). Some projects pass vfiles on the command line, we keep the list of these files to pass them to coqdep via command line even when there is a _CoqProject. Multiple project files is probably broken.
Diffstat (limited to 'tools/CoqMakefile.in')
-rw-r--r--tools/CoqMakefile.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/tools/CoqMakefile.in b/tools/CoqMakefile.in
index 727fd3ec3..e9ac8f55d 100644
--- a/tools/CoqMakefile.in
+++ b/tools/CoqMakefile.in
@@ -23,6 +23,7 @@ MLFILES := $(COQMF_MLFILES)
ML4FILES := $(COQMF_ML4FILES)
MLPACKFILES := $(COQMF_MLPACKFILES)
MLLIBFILES := $(COQMF_MLLIBFILES)
+CMDLINE_VFILES := $(COQMF_CMDLINE_VFILES)
INSTALLCOQDOCROOT := $(COQMF_INSTALLCOQDOCROOT)
OTHERFLAGS := $(COQMF_OTHERFLAGS)
COQ_SRC_SUBDIRS := $(COQMF_COQ_SRC_SUBDIRS)
@@ -724,9 +725,19 @@ $(addsuffix .d,$(MLPACKFILES)): %.mlpack.d: %.mlpack
$(SHOW)'COQDEP $<'
$(HIDE)$(COQDEP) $(OCAMLLIBS) -c "$<" $(redir_if_ok)
+# If this makefile is created using a _CoqProject we have coqdep get
+# the list of files from it. This avoids argument length limits for
+# pathological projects. Note that extra files might be on the command
+# line.
+ifeq (,@PROJECT_FILE@)
+COQDEP_VFILES:=$(CMDLINE_VFILES)
+else
+COQDEP_VFILES:=-f @PROJECT_FILE@ $(CMDLINE_VFILES)
+endif
+
$(VDFILE).d: $(VFILES)
$(SHOW)'COQDEP VFILES'
- $(HIDE)$(COQDEP) $(COQLIBS) -dyndep var -c $(VFILES) $(redir_if_ok)
+ $(HIDE)$(COQDEP) $(COQLIBS) -dyndep var -c $(COQDEP_VFILES) $(redir_if_ok)
# Misc ########################################################################