From 4cd801dcff1393f6ffcb81cac9a6dcdb1f007bd2 Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Tue, 17 Dec 2019 15:38:00 +0100 Subject: [PATCH] build: fix make implicit dependencies on ml/mli files As proposed in the Debian bug #946594 [1], the implicit .cmi/.cmo/.cmx dependencies are tied to files in the source directory only, and thus they break when either the .ml or the .mli files are in the build directory. Since there is already VPATH set up by automake, rely on it to locate the right source. [1] https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=946594#36 Solution proposed by Vincent Danjean, thanks! This reverts commit 802c5d2055593adf6bfae796b102b8c902de571e in this file. --- subdir-rules.mk | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/subdir-rules.mk b/subdir-rules.mk index 3a20cb10d..a789a82f6 100644 --- a/subdir-rules.mk +++ b/subdir-rules.mk @@ -79,12 +79,12 @@ guestfs_am_v_jar = $(guestfs_am_v_jar_@AM_V@) guestfs_am_v_jar_ = $(guestfs_am_v_jar_@AM_DEFAULT_V@) guestfs_am_v_jar_0 = @echo " JAR " $@; -%.cmi: $(srcdir)/%.mli +%.cmi: %.mli $(guestfs_am_v_ocamlcmi)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ -%.cmo: $(srcdir)/%.ml +%.cmo: %.ml $(guestfs_am_v_ocamlc)$(OCAMLFIND) ocamlc $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ if HAVE_OCAMLOPT -%.cmx: $(srcdir)/%.ml +%.cmx: %.ml $(guestfs_am_v_ocamlopt)$(OCAMLFIND) ocamlopt $(OCAMLFLAGS) $(OCAMLPACKAGES) -c $< -o $@ endif