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>
Sat, 30 May 2020 21:42:24 +0000 (22:42 +0100)
Gbp-Pq: Name 0016-Properly-handle-autogenerated-config.ml-files-in-bui.patch

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

index 2b4aed8ecd06eedb769239f961c71939b2035f5a..3b2d146255e720ed843785b66847e0a3a8d17b69 100644 (file)
@@ -150,7 +150,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 53c75b853edc9a262724bd6079112510f4502aed..0256434bda6d9283c9870272b0e14d350ddd922c 100644 (file)
@@ -380,7 +380,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 a8fed02f8a0194cbf9dadbce8d606a6d9704caa8..c700dde1310dde004abbd181b3bc20fdfcdb926e 100755 (executable)
@@ -74,7 +74,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 8532fb23a7b3754f97a17ce8e9ecefc00ee906f7..94367f2708154c9d8b0e40023a7ebd977b6ccda9 100644 (file)
@@ -83,9 +83,13 @@ guestfs_am_v_jar_0 = @echo "  JAR     " $@;
        $(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