Blob Blame History Raw
From b31fcaf9879b9f4fe36a19e439895a867a1fbc72 Mon Sep 17 00:00:00 2001
From: Pino Toscano <ptoscano@redhat.com>
Date: Tue, 22 May 2018 17:24:18 +0200
Subject: [PATCH] v2v: fix build rules for output_rhv_upload_*_source.ml files

Use the $(srcdir) variable where needed, to make sure it builds also
with srcdir != builddir.

Furthermore, make sure that the OCaml dependencies calculation depend on
the generated output_rhv_upload_*_source.ml files, otherwise there will
be incomplete OCaml rules for them in the generated .depend.

Fixes commit cc04573927cca97de60d544d37467e67c25867a7.

(cherry picked from commit a4e3b7c0598370d8d068b21909da95b6031eb688)
---
 v2v/Makefile.am | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/v2v/Makefile.am b/v2v/Makefile.am
index 3a0c80f44..7de050b06 100644
--- a/v2v/Makefile.am
+++ b/v2v/Makefile.am
@@ -143,12 +143,12 @@ SOURCES_C = \
 
 # These files are generated and contain rhv-upload-*.py embedded as an
 # OCaml string.
-output_rhv_upload_createvm_source.ml: rhv-upload-createvm.py
-	./embed.sh code $^ $@
-output_rhv_upload_plugin_source.ml: rhv-upload-plugin.py
-	./embed.sh code $^ $@
-output_rhv_upload_precheck_source.ml: rhv-upload-precheck.py
-	./embed.sh code $^ $@
+output_rhv_upload_createvm_source.ml: $(srcdir)/rhv-upload-createvm.py
+	$(srcdir)/embed.sh code $^ $@
+output_rhv_upload_plugin_source.ml: $(srcdir)/rhv-upload-plugin.py
+	$(srcdir)/embed.sh code $^ $@
+output_rhv_upload_precheck_source.ml: $(srcdir)/rhv-upload-precheck.py
+	$(srcdir)/embed.sh code $^ $@
 
 if HAVE_OCAML
 
@@ -575,7 +575,7 @@ v2v_unit_tests_LINK = \
 	  $(v2v_unit_tests_THEOBJECTS) -o $@
 
 # Dependencies.
-.depend: $(srcdir)/*.mli $(srcdir)/*.ml
+.depend: $(srcdir)/*.mli $(srcdir)/*.ml output_rhv_upload_createvm_source.ml output_rhv_upload_plugin_source.ml output_rhv_upload_precheck_source.ml
 	$(top_builddir)/ocaml-dep.sh $^
 -include .depend
 
-- 
2.21.0