Fixed out-of-tree compilation of OCaml code after .depend files removal

This commit is contained in:
Hilko Bengen
2012-01-20 08:44:44 +01:00
committed by Richard W.M. Jones
parent 762d1bbda1
commit 251c6e994d
3 changed files with 11 additions and 8 deletions

View File

@@ -139,12 +139,13 @@ t/%.cmx: t/%.ml mlguestfs.cmxa
depend: .depend
.depend: $(wildcard *.mli) $(wildcard *.ml)
.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml)
rm -f $@ $@-t
$(OCAMLFIND) ocamldep $^ | \
$(SED) -e 's/ *$$//' | \
$(OCAMLFIND) ocamldep -I ../ocaml -I $(abs_srcdir) $^ | \
$(SED) 's/ *$$//' | \
$(SED) -e :a -e '/ *\\$$/N; s/ *\\\n */ /; ta' | \
LANG=C sort > $@-t
$(SED) -e 's,$(abs_srcdir)/,$(builddir)/,g' | \
sort > $@-t
mv $@-t $@
-include .depend

View File

@@ -112,11 +112,12 @@ TESTS = test-virt-resize.sh utils_tests
# Dependencies.
depend: .depend
.depend: $(wildcard *.mli) $(wildcard *.ml)
.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml)
rm -f $@ $@-t
$(OCAMLFIND) ocamldep -I ../ocaml $^ | \
$(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 $@

View File

@@ -105,11 +105,12 @@ TESTS = test-virt-sparsify.sh
# Dependencies.
depend: .depend
.depend: $(wildcard *.mli) $(wildcard *.ml)
.depend: $(wildcard $(abs_srcdir)/*.mli) $(wildcard $(abs_srcdir)/*.ml)
rm -f $@ $@-t
$(OCAMLFIND) ocamldep -I ../ocaml $^ | \
$(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 $@