aboutsummaryrefslogtreecommitdiff
path: root/tools/ocamllibdep.mll
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2020-02-12 23:12:26 +0100
committerEmilio Jesus Gallego Arias2020-02-13 22:11:05 +0100
commit8d73861eeae56321a106f28d07b47d5d6699939d (patch)
tree31e8ee4a328798a9269141dab30c77e70b78bdfd /tools/ocamllibdep.mll
parent4ea2825a4589b0c77225dd6f4caf98b12ac6dd6f (diff)
[coqdep] Remove support for `-c` ocamldep replacement.
There is not need for coqdep to ship an `ocamldep` replacement, in particular: - not used in the main build since a long time - not tested - not kept up to date with upstream This allows for a significant reduction of `coqdep` code, including some duplicated code from `ocamllibdep`. `coq_makefile` now uses `ocamllibdep` to process `mllib/mlpack` files, so it has then to be installed. We also remove the residual `-slash` option.
Diffstat (limited to 'tools/ocamllibdep.mll')
-rw-r--r--tools/ocamllibdep.mll11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/ocamllibdep.mll b/tools/ocamllibdep.mll
index 41a4e2a86a..2ecc20f1b0 100644
--- a/tools/ocamllibdep.mll
+++ b/tools/ocamllibdep.mll
@@ -195,6 +195,14 @@ let mllib_dependencies () =
flush stdout)
(List.rev !mllibAccu)
+let coq_makefile_mode = ref false
+
+let print_for_pack modname d =
+ if !coq_makefile_mode then
+ printf "%s.cmx : FOR_PACK=-for-pack %s\n" d modname
+ else
+ printf "%s_FORPACK:= -for-pack %s\n" d modname
+
let mlpack_dependencies () =
List.iter
(fun (name,dirname) ->
@@ -204,7 +212,7 @@ let mlpack_dependencies () =
let sdeps = String.concat " " deps in
let efullname = escape fullname in
printf "%s_MLPACK_DEPENDENCIES:=%s\n" efullname sdeps;
- List.iter (fun d -> printf "%s_FORPACK:= -for-pack %s\n" d modname) deps;
+ List.iter (print_for_pack modname) deps;
printf "%s.cmo:$(addsuffix .cmo,$(%s_MLPACK_DEPENDENCIES))\n"
efullname efullname;
printf "%s.cmx:$(addsuffix .cmx,$(%s_MLPACK_DEPENDENCIES))\n"
@@ -213,6 +221,7 @@ let mlpack_dependencies () =
(List.rev !mlpackAccu)
let rec parse = function
+ | "-c" :: r -> coq_makefile_mode := true; parse r
| "-I" :: r :: ll ->
(* To solve conflict (e.g. same filename in kernel and checker)
we allow to state an explicit order *)