1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
From: Hilko Bengen <bengen@debian.org>
Date: Mon, 23 Dec 2019 12:46:43 +0100
Subject: Properly handle autogenerated *config.ml files in builddir
---
common/mlstdutils/Makefile.am | 2 +-
daemon/Makefile.am | 2 +-
ocaml-dep.sh.in | 2 +-
subdir-rules.mk | 4 ++++
4 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/common/mlstdutils/Makefile.am b/common/mlstdutils/Makefile.am
index 2b73bc6..ea314e4 100644
--- a/common/mlstdutils/Makefile.am
+++ b/common/mlstdutils/Makefile.am
@@ -138,7 +138,7 @@ check-valgrind:
$(MAKE) VG="@VG@" check
# OCaml dependencies.
-.depend: $(srcdir)/*.mli $(srcdir)/*.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml $(builddir)/guestfs_config.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 02d9d11..d7cf5bc 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -399,7 +399,7 @@ camldaemon.o: $(OBJECTS)
$(OBJECTS)
# OCaml dependencies.
-.depend: $(srcdir)/*.mli $(srcdir)/*.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml $(builddir)/daemon_config.ml
$(top_builddir)/ocaml-dep.sh $^
-include .depend
diff --git a/ocaml-dep.sh.in b/ocaml-dep.sh.in
index 385a1e6..ff81340 100755
--- a/ocaml-dep.sh.in
+++ b/ocaml-dep.sh.in
@@ -68,7 +68,7 @@ echo >> $output-t
| sed \
-e "s,@abs_top_srcdir@/${subdir},.,g" \
-e "s,\B${srcdir_re}/\\([^ ]*[.]\\)\\(cm[^ ]*\\|o\\),\\1\\2,g" \
- -e "s,\B${srcdir_re}/\\([^ /]*_config[.]ml\\),\\1,g" \
+ -e "s,\B${srcdir_re}/\\([^ /]*config[.]ml\\),\\1,g" \
-e "s,@abs_top_srcdir@/\\([^ ]*[.]\\)\\(cm[^ ]*\\|o\\),${top_builddir}/\\1\\2,g" \
-e 's,\(^\| \)./,\1,g' \
>> $output-t
diff --git a/subdir-rules.mk b/subdir-rules.mk
index 61a3a45..c712db4 100644
--- a/subdir-rules.mk
+++ b/subdir-rules.mk
@@ -86,9 +86,13 @@ guestfs_am_v_po4a_translate_0 = @echo " PO4A-T " $@;
$(guestfs_am_v_ocamlcmi)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
%.cmo: %.ml
$(guestfs_am_v_ocamlc)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
+%.cmo: $(builddir)/%.ml
+ $(guestfs_am_v_ocamlc)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
if HAVE_OCAMLOPT
%.cmx: %.ml
$(guestfs_am_v_ocamlopt)$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
+%.cmx: $(builddir)/%.ml
+ $(guestfs_am_v_ocamlopt)$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@
endif
# Test shell scripts should use '$TEST_FUNCTIONS' to get a predefined
|