From e37440467c33af0ab57c6cd930d795625b654214 Mon Sep 17 00:00:00 2001 From: Hilko Bengen Date: Mon, 23 Dec 2019 12:46:43 +0100 Subject: [PATCH] Properly handle autogenerated *config.ml files in builddir Gbp-Pq: Name Properly-handle-autogenerated-config.ml-files-in-builddir.patch --- 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 2b73bc6d..ea314e48 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 127a943f..40c67634 100644 --- a/daemon/Makefile.am +++ b/daemon/Makefile.am @@ -396,7 +396,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 385a1e6e..ff81340c 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 61a3a459..c712db43 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 -- 2.30.2