diff options
| author | Kazuhiko Sakaguchi | 2019-10-24 00:15:13 +0200 |
|---|---|---|
| committer | Kazuhiko Sakaguchi | 2019-10-28 17:23:23 +0100 |
| commit | 23a0f7343df0b92f847d7c5c8eec8ab4984295a3 (patch) | |
| tree | 417bb609b58c9e8f4f1934eecc8467b36e5eff12 /tools | |
| parent | e6991dce306c41352c359a8ba5d6d9d6c5e6dfb2 (diff) | |
Rename `VDFILE` from `.coqdeps.d` to `.<CoqMakefile>.d` in the `coq_makefile` utility
The `coq_makefile` utility and `Makefile`s generated by it generate and include
some files: `<CoqMakefile>.conf`, `<CoqMakefile>.local`, and the dependency file
`.coqdep.d`, where `<CoqMakefile>` is the name of the output file given by the
`-o` option. Out of these, only the name of the dependency file `.coqdep.d` is
fixed to a constant. This seems to be a potential pitfall when we place multiple
`Makefile`s generated by `coq_makefile` in the same directory. This patch
renames `.coqdeps.d` to `.<CoqMakefile>.d`.
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/CoqMakefile.in | 6 | ||||
| -rw-r--r-- | tools/coq_makefile.ml | 6 |
2 files changed, 7 insertions, 5 deletions
diff --git a/tools/CoqMakefile.in b/tools/CoqMakefile.in index 08253e5a8f..626ac0fe67 100644 --- a/tools/CoqMakefile.in +++ b/tools/CoqMakefile.in @@ -226,7 +226,7 @@ COQTOPINSTALL = $(call concat_path,$(DESTDIR),$(COQLIB)/toploop) # We here define a bunch of variables about the files being part of the # Coq project in order to ease the writing of build target and build rules -VDFILE := .coqdeps +VDFILE := @DEP_FILE@ ALLSRCFILES := \ $(MLGFILES) \ @@ -312,7 +312,7 @@ else DO_NATDYNLINK = endif -ALLDFILES = $(addsuffix .d,$(ALLSRCFILES) $(VDFILE)) +ALLDFILES = $(addsuffix .d,$(ALLSRCFILES)) $(VDFILE) # Compilation targets ######################################################### @@ -732,7 +732,7 @@ $(addsuffix .d,$(MLPACKFILES)): %.mlpack.d: %.mlpack # projects. Note that extra options might be on the command line. VDFILE_FLAGS:=$(if @PROJECT_FILE@,-f @PROJECT_FILE@,) $(CMDLINE_COQLIBS) $(CMDLINE_VFILES) -$(VDFILE).d: $(VFILES) +$(VDFILE): $(VFILES) $(SHOW)'COQDEP VFILES' $(HIDE)$(COQDEP) -dyndep var $(VDFILE_FLAGS) $(redir_if_ok) diff --git a/tools/coq_makefile.ml b/tools/coq_makefile.ml index 1bd52d5bf1..b091ff3b4e 100644 --- a/tools/coq_makefile.ml +++ b/tools/coq_makefile.ml @@ -122,7 +122,7 @@ let read_whole_file s = let quote s = if String.contains s ' ' || CString.is_empty s then "'" ^ s ^ "'" else s -let generate_makefile oc conf_file local_file args project = +let generate_makefile oc conf_file local_file dep_file args project = let coqlib = Envars.coqlib () in let makefile_template = let template = Filename.concat "tools" "CoqMakefile.in" in @@ -133,6 +133,7 @@ let generate_makefile oc conf_file local_file args project = (fun s (k,v) -> Str.global_substitute (Str.regexp_string k) (fun _ -> v) s) s [ "@CONF_FILE@", conf_file; "@LOCAL_FILE@", local_file; + "@DEP_FILE@", dep_file; "@COQ_VERSION@", Coq_config.version; "@PROJECT_FILE@", (Option.default "" project.project_file); "@COQ_MAKEFILE_INVOCATION@",String.concat " " (List.map quote args); @@ -412,6 +413,7 @@ let _ = let conf_file = Option.default "CoqMakefile" project.makefile ^ ".conf" in let local_file = Option.default "CoqMakefile" project.makefile ^ ".local" in + let dep_file = "." ^ Option.default "CoqMakefile" project.makefile ^ ".d" in if project.extra_targets <> [] then begin eprintf "Warning: -extra and -extra-phony are deprecated.\n"; @@ -434,7 +436,7 @@ let _ = Envars.set_coqlib ~fail:(fun x -> Printf.eprintf "Error: %s\n" x; exit 1); let ocm = Option.cata open_out stdout project.makefile in - generate_makefile ocm conf_file local_file (prog :: args) project; + generate_makefile ocm conf_file local_file dep_file (prog :: args) project; close_out ocm; let occ = open_out conf_file in generate_conf occ project (prog :: args); |
