Properly handle autogenerated *config.ml files in builddir
authorHilko Bengen <bengen@debian.org>
Mon, 23 Dec 2019 11:46:43 +0000 (12:46 +0100)
committerHilko Bengen <bengen@debian.org>
Mon, 6 Mar 2023 14:29:41 +0000 (14:29 +0000)
Gbp-Pq: Name Properly-handle-autogenerated-config.ml-files-in-builddir.patch

common/mlstdutils/Makefile.am
daemon/Makefile.am
ocaml-dep.sh.in
subdir-rules.mk

index 2b73bc6d1d81b488bca7d06ec8d67604df5a8fb2..ea314e48babe638c77b944bc66b4fc812936d4eb 100644 (file)
@@ -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
 
index bc1032839d52728ccc8b2d1619c781c1b931449a..9d35c976b9d58ebf3b58af7f1d9b59c99e4b712f 100644 (file)
@@ -392,7 +392,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
 
index 866f48db86e29a7a6423017bd4377c61601201f2..0c152d637689b677816364e98f54182009bb1bdf 100755 (executable)
@@ -69,7 +69,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
index 40941a9abd3b8ae2c1562cde428a6b8a4d05d3aa..9e5f8604ec92d3a3c11c7ea176fdfc6ef200c8b3 100644 (file)
@@ -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