These are generated in many different ways in the various
subdirectories, and sometimes not generated correctly. Introduce a
script to do this in one place, and hopefully correctly.
This is mostly simple refactoring, but I got rid of a couple of
things:
(1) The ‘make depend’ rule doesn't appear to be needed. automake (or
make?) seems to rebuild the ‘.depend’ file automatically just because
it is included.
(2) I got rid of the hairy path rewriting sed expression. Possibly
that is needed for srcdir != builddir.
---
.gitignore| 1 +
builder/Makefile.am | 17 +++-
common/mlpcre/Makefile.am | 15 ++
common/mlprogress/Makefile.am | 17 +++-
common/mlstdutils/Makefile.am | 17 +++-
common/mlutils/Makefile.am| 15 ++
common/mlvisit/Makefile.am| 17 +++-
common/mlxml/Makefile.am | 15 ++
configure.ac | 2 ++
customize/Makefile.am | 17 +++-
daemon/Makefile.am| 15 ++
dib/Makefile.am | 17 +++-
generator/Makefile.am | 15 ++
get-kernel/Makefile.am| 17 ++--
mllib/Makefile.am | 15 ++
ocaml-dep.sh.in | 64 +++
ocaml/Makefile.am | 13 ++---
resize/Makefile.am| 15 ++
sparsify/Makefile.am | 17 +++-
sysprep/Makefile.am | 17 +++-
v2v/Makefile.am | 15 ++
v2v/test-harness/Makefile.am | 15 ++
22 files changed, 131 insertions(+), 237 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0e7a649f8..4d738d10f 100644
--- a/.gitignore
+++ b/.gitignore
@@ -380,6 +380,7 @@ Makefile.in
/mllib/getopt_tests
/mllib/JSON_tests
/mllib/oUnit-*
+/ocaml-dep.sh
/ocaml/bindtests.bc
/ocaml/bindtests.opt
/ocaml/bindtests.ml
diff --git a/builder/Makefile.am b/builder/Makefile.am
index 1b51376be..e1c7bd016 100644
--- a/builder/Makefile.am
+++ b/builder/Makefile.am
@@ -310,23 +310,14 @@ CLEANFILES += \
console-*.img \
console-*.out
-# Dependencies.
-depend: .depend
-
-.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml)
- rm -f $@ $@-t
- $(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) -I
$(abs_top_builddir)/common/mlstdutils -I $(abs_top_builddir)/common/mlutils -I
$(abs_top_builddir)/common/mlpcre -I $(abs_top_builddir)/mllib -I
$(abs_top_builddir)/customize $^ | \
- $(SED) 's/ *$$//' | \
- $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
- $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
- sort > $@-t
- mv $@-t $@
-
+# OCaml dependencies.
+.depend: *.mli *.ml
+ $(top_builddir)/ocaml-dep.sh $^
-include .depend
endif
-.PHONY: depend docs
+.PHONY: docs
# virt-builder's default repository
diff --git a/common/mlpcre/Makefile.am b/common/mlpcre/Makefile.am
index aa638cd94..fd4027a1f 100644
--- a/common/mlpcre/Makefile.am
+++ b/common/mlpcre/Makefile.am
@@ -124,19 +124,10 @@ check-valgrind:
$(MAKE) VG="@VG@" check
# Dependencies.
-depend: .depend
-
-.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml)
- rm -f $@ $@-t
- $(OCAMLFIND) ocamldep -I ../../ocaml -I $(abs_srcdir) $^ | \
- $(SED) 's/ *$$//' | \
- $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
- $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
- sort > $@-t
- mv $@-t $@
-
+.depend: *.mli *.ml
+ $(top_builddir)/ocaml-dep.sh $^
-include .depend
endif
-.PHONY: depend docs
+.PHONY: docs
diff --git a/common/mlprogress/Makefile.am b/common/mlprogress/Makefile.am
index d4a229451..189aa5453 100644
--- a/common/mlprogress/Makefile.am
+++ b/common/mlprogress/Makefile.am
@@ -92,20 +92,11 @@ $(MLPROGRESS_CMA): $(OBJECTS) libmlprogress.a
-cclib -lprogress \
-o mlprogress
-# Dependencies.
-depend: .depend
-
-.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml)
- rm -f $@ $@-t
- $(OCAMLFIND) ocamldep -I ../../ocaml -I $(abs_srcdir) $^ | \
- $(SED) 's/ *$$//' | \
- $(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
- $(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
- sort > $@-t
- mv $@-t $@
-
+# OCaml dependencies.
+.depend: *.mli *.ml
+ $(top_builddir)/ocaml-dep.sh $^
-include .depend
endif
-.PHONY: depend docs
+.PHONY: docs
diff --git a/common/mlstdutils/Makefile.am b/common/mlstdutils/Makefile.am
index ccf7c6884..5208e491f 100644
--- a/common/mlstdutils/Makefile.am
+++ b/common/mlstdutils/Makefile.am
@@ -147,18 +147,9 @@ endif
check-valgrind:
$(MAKE) VG="@VG@" check
-# Dependencies.
-depend: .depend
-
-.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml)
- rm -f $@ $@-t
- $(OCAMLFIND) ocamldep -I $(abs_srcdir) $^ | \
- $(SED) 's/ *$$//' | \
-