[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libguestfs] [PATCH] Bootstrap ocaml/.depend more thoroughly



Although I haven't experienced a specific problem with bootstrapping an empty
.depend file, this commit bootstraps it properly using ocamldep. This may or may
not solve any real problem, but it's quite simple and more obviously correct.
---
 bootstrap             |    2 +-
 ocaml/Makefile.am     |   10 +++-------
 ocaml/Makefile.depend |    6 ++++++
 3 files changed, 10 insertions(+), 8 deletions(-)
 create mode 100644 ocaml/Makefile.depend

diff --git a/bootstrap b/bootstrap
index 5ceac31..c0fa3ff 100755
--- a/bootstrap
+++ b/bootstrap
@@ -87,7 +87,7 @@ $gnulib_tool			\
 
 # ocaml/.depend is updated automatically. However, as it's included by
 # ocaml/Makefile.am we need to bootstrap it here.
-touch ocaml/.depend
+make -C ocaml -f Makefile.depend .depend
 
 # Disable autopoint and libtoolize, since they were already done above.
 AUTOPOINT=true LIBTOOLIZE=true autoreconf --verbose --install
diff --git a/ocaml/Makefile.am b/ocaml/Makefile.am
index 77c5be9..287c47d 100644
--- a/ocaml/Makefile.am
+++ b/ocaml/Makefile.am
@@ -120,15 +120,11 @@ t/%.cmx: t/%.ml mlguestfs.cmxa
 .ml.cmx:
 	$(OCAMLFIND) ocamlopt -package xml-light,unix -c $< -o $@
 
-depend: .depend
-
-.depend: $(wildcard *.mli) $(wildcard *.ml)
-	rm -f $@ $ -t
-	$(OCAMLFIND) ocamldep $^ | sed 's/  *$$//' | sort > $ -t
-	mv $ -t $@
-
+include Makefile.depend
 include .depend
 
+depend: .depend
+
 SUFFIXES = .cmo .cmi .cmx .ml .mli .mll .mly
 
 # Do the installation by hand, because we want to run ocamlfind.
diff --git a/ocaml/Makefile.depend b/ocaml/Makefile.depend
new file mode 100644
index 0000000..9977b7a
--- /dev/null
+++ b/ocaml/Makefile.depend
@@ -0,0 +1,6 @@
+# This is split into a separate Makefile because it is used by bootstrap to
+# create .depend before running automake
+.depend: $(wildcard *.mli) $(wildcard *.ml)
+	rm -f $@ $ -t
+	$(OCAMLFIND) ocamldep $^ | sed 's/  *$$//' | sort > $ -t
+	mv $ -t $@

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]