[PATCH v3 10/20] src: generate source files into build directory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This affects more than src/Makefile.am as the rule to generate source
files for protocols is generic for all sub-directories.

Affected files are:
    src/admin/admin_protocol.{h,c}
    src/locking/lock_protocol.{h,c}
    src/logging/log_protocol.{h,c}
    src/lxc/lxc_monitor_protocol.{h,c}
    src/remote/{lxc,qemu,remote}_protocol.{h,c}
    src/rpc/{virkeepalive,virnet}protocol.{h,c}

Signed-off-by: Pavel Hrdina <phrdina@xxxxxxxxxx>
Reviewed-by: Ján Tomko <jtomko@xxxxxxxxxx>
---

Notes:
    Changes in v2:
        - remove entries from .gitignore
        - modify generated_files for sc_po_check as well

 .gitignore                  | 8 --------
 build-aux/syntax-check.mk   | 1 -
 src/Makefile.am             | 4 ++--
 src/admin/Makefile.inc.am   | 3 +++
 src/locking/Makefile.inc.am | 6 ++++++
 src/logging/Makefile.inc.am | 4 ++++
 src/lxc/Makefile.inc.am     | 4 ++++
 src/remote/Makefile.inc.am  | 4 ++++
 src/rpc/Makefile.inc.am     | 3 +++
 tests/Makefile.am           | 1 +
 10 files changed, 27 insertions(+), 11 deletions(-)

diff --git a/.gitignore b/.gitignore
index 4c4807019c..6f8d59987e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -49,21 +49,13 @@ Makefile.in
 /src/access/viraccessapicheckqemu.c
 /src/access/viraccessapicheckqemu.h
 /src/admin/admin_client.h
-/src/admin/admin_protocol.[ch]
 /src/admin/admin_server_dispatch_stubs.h
 /src/esx/*.generated.*
 /src/hyperv/*.generated.*
 /src/locking/lock_daemon_dispatch_stubs.h
-/src/locking/lock_protocol.[ch]
 /src/logging/log_daemon_dispatch_stubs.h
-/src/logging/log_protocol.[ch]
 /src/lxc/lxc_controller_dispatch.h
 /src/lxc/lxc_monitor_dispatch.h
-/src/lxc/lxc_monitor_protocol.c
-/src/lxc/lxc_monitor_protocol.h
 /src/remote/*_client_bodies.h
-/src/remote/*_protocol.[ch]
 /src/remote/*_stubs.h
-/src/rpc/virkeepaliveprotocol.[ch]
-/src/rpc/virnetprotocol.[ch]
 tags
diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk
index 156c72d452..b83e98860d 100644
--- a/build-aux/syntax-check.mk
+++ b/build-aux/syntax-check.mk
@@ -1980,7 +1980,6 @@ generated_files = \
   $(srcdir)/src/admin/admin_server_dispatch_stubs.h \
   $(srcdir)/src/lxc/{lxc_monitor,lxc_controller}_dispatch.h \
   $(srcdir)/src/remote/*_client_bodies.h \
-  $(srcdir)/src/*/*_protocol.[ch] \
   $(srcdir)/gnulib/lib/*.[ch]
 
 _gl_translatable_string_re ?= \b(N?_|gettext *)\([^)"]*("|$$)
diff --git a/src/Makefile.am b/src/Makefile.am
index e0b917fcdd..da7e2e6c80 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -394,11 +394,11 @@ GENERATED_SYM_FILES += \
 
 %protocol.c: %protocol.x %protocol.h $(srcdir)/rpc/genprotocol.pl
 	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -c \
-	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
+	       $< $(subst $(srcdir)/,,$@)
 
 %protocol.h: %protocol.x $(srcdir)/rpc/genprotocol.pl
 	$(AM_V_GEN)$(PERL) -w $(srcdir)/rpc/genprotocol.pl $(RPCGEN) -h \
-	       $< $(srcdir)/$(subst $(srcdir)/,,$@)
+	       $< $(subst $(srcdir)/,,$@)
 
 check-local: check-augeas
 
diff --git a/src/admin/Makefile.inc.am b/src/admin/Makefile.inc.am
index 4fd7878e5c..bea0967aaf 100644
--- a/src/admin/Makefile.inc.am
+++ b/src/admin/Makefile.inc.am
@@ -30,6 +30,7 @@ libvirt_driver_admin_la_CFLAGS = \
 	$(XDR_CFLAGS) \
 	-I$(top_srcdir)/src/util \
 	-I$(top_srcdir)/src/admin \
+	-I$(top_builddir)/src/rpc \
 	$(NULL)
 libvirt_driver_admin_la_LIBADD = ../gnulib/lib/libgnu.la
 libvirt_driver_admin_la_LDFLAGS = -module -avoid-version $(AM_LDFLAGS)
@@ -87,8 +88,10 @@ endif WITH_DTRACE_PROBES
 
 libvirt_admin_la_CFLAGS = \
 	$(AM_CFLAGS) \
+	-I$(builddir)/admin \
 	-I$(srcdir)/remote \
 	-I$(srcdir)/rpc \
+	-I$(builddir)/rpc \
 	$(XDR_CFLAGS) \
 	$(CAPNG_CFLAGS) \
 	$(YAJL_CFLAGS) \
diff --git a/src/locking/Makefile.inc.am b/src/locking/Makefile.inc.am
index 2b1c030041..ba7a9ea2ea 100644
--- a/src/locking/Makefile.inc.am
+++ b/src/locking/Makefile.inc.am
@@ -109,6 +109,9 @@ lockd_la_SOURCES = \
 	$(NULL)
 lockd_la_CFLAGS = \
 	-I$(srcdir)/conf \
+	-I$(srcdir)/locking \
+	-I$(builddir)/locking \
+	-I$(builddir)/rpc \
 	$(XDR_CFLAGS) \
 	$(AM_CFLAGS) \
 	$(NULL)
@@ -146,6 +149,9 @@ virtlockd_SOURCES = \
 	$(LOCK_DAEMON_GENERATED) \
 	$(NULL)
 virtlockd_CFLAGS = \
+	-I$(srcdir)/locking \
+	-I$(builddir)/locking \
+	-I$(builddir)/rpc \
 	$(AM_CFLAGS) \
 	$(PIE_CFLAGS) \
 	$(XDR_CFLAGS) \
diff --git a/src/logging/Makefile.inc.am b/src/logging/Makefile.inc.am
index 7d10b646ea..bb7ea7338d 100644
--- a/src/logging/Makefile.inc.am
+++ b/src/logging/Makefile.inc.am
@@ -67,6 +67,8 @@ libvirt_driver_log_la_SOURCES = \
 	$(LOG_DRIVER_SOURCES) \
 	$(NULL)
 libvirt_driver_log_la_CFLAGS = \
+	-I$(builddir)/logging \
+	-I$(builddir)/rpc \
 	$(AM_CFLAGS) \
 	$(XDR_CFLAGS) \
 	$(NULL)
@@ -82,6 +84,8 @@ virtlogd_SOURCES = \
 		$(LOG_DAEMON_GENERATED) \
 		$(NULL)
 virtlogd_CFLAGS = \
+		-I$(builddir)/logging \
+		-I$(builddir)/rpc \
 		$(AM_CFLAGS) \
 		$(PIE_CFLAGS) \
 		$(XDR_CFLAGS) \
diff --git a/src/lxc/Makefile.inc.am b/src/lxc/Makefile.inc.am
index b6db70af7d..78f14bf37a 100644
--- a/src/lxc/Makefile.inc.am
+++ b/src/lxc/Makefile.inc.am
@@ -95,6 +95,8 @@ libvirt_driver_lxc_impl_la_CFLAGS = \
 	$(XDR_CFLAGS) \
 	-I$(srcdir)/access \
 	-I$(srcdir)/conf \
+	-I$(builddir)/lxc \
+	-I$(builddir)/rpc \
 	$(AM_CFLAGS) \
 	$(NULL)
 libvirt_driver_lxc_impl_la_LIBADD = \
@@ -199,6 +201,8 @@ endif WITH_DTRACE_PROBES
 libvirt_lxc_LDADD += $(SECDRIVER_LIBS)
 libvirt_lxc_CFLAGS = \
 	-I$(srcdir)/conf \
+	-I$(builddir)/lxc \
+	-I$(builddir)/rpc \
 	$(AM_CFLAGS) \
 	$(PIE_CFLAGS) \
 	$(CAPNG_CFLAGS) \
diff --git a/src/remote/Makefile.inc.am b/src/remote/Makefile.inc.am
index 5c5f5f4d2c..6b0ae586d1 100644
--- a/src/remote/Makefile.inc.am
+++ b/src/remote/Makefile.inc.am
@@ -50,6 +50,8 @@ REMOTE_DAEMON_CFLAGS = \
 	-I$(srcdir)/access \
 	-I$(srcdir)/conf \
 	-I$(srcdir)/rpc \
+	-I$(builddir)/rpc \
+	-I$(builddir)/remote \
 	$(NULL)
 
 REMOTE_DAEMON_LD_FLAGS = \
@@ -174,6 +176,8 @@ libvirt_driver_remote_la_CFLAGS = \
 	$(XDR_CFLAGS) \
 	-I$(srcdir)/conf \
 	-I$(srcdir)/rpc \
+	-I$(builddir)/rpc \
+	-I$(builddir)/remote \
 	$(AM_CFLAGS) \
 	$(NULL)
 libvirt_driver_remote_la_LDFLAGS = $(AM_LDFLAGS)
diff --git a/src/rpc/Makefile.inc.am b/src/rpc/Makefile.inc.am
index b8ca53c69a..4aa38db1ab 100644
--- a/src/rpc/Makefile.inc.am
+++ b/src/rpc/Makefile.inc.am
@@ -79,6 +79,7 @@ EXTRA_DIST += \
 endif ! WITH_LIBSSH
 
 libvirt_net_rpc_la_CFLAGS = \
+	-I$(builddir)/rpc \
 	$(GNUTLS_CFLAGS) \
 	$(SASL_CFLAGS) \
 	$(SSH2_CFLAGS) \
@@ -109,6 +110,7 @@ libvirt_net_rpc_server_la_SOURCES = \
 	rpc/virnetserver.c \
 	$(NULL)
 libvirt_net_rpc_server_la_CFLAGS = \
+	-I$(builddir)/rpc \
 	$(DBUS_CFLAGS) \
 	$(XDR_CFLAGS) \
 	$(SASL_CFLAGS) \
@@ -129,6 +131,7 @@ libvirt_net_rpc_client_la_SOURCES = \
 	rpc/virnetclient.c \
 	$(NULL)
 libvirt_net_rpc_client_la_CFLAGS = \
+	-I$(builddir)/rpc \
 	$(AM_CFLAGS) \
 	$(XDR_CFLAGS) \
 	$(NULL)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index a9acd88670..9ae456c268 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -25,6 +25,7 @@ AM_CPPFLAGS = \
 	-I$(top_builddir)/src -I$(top_srcdir)/src \
 	-I$(top_srcdir)/src/util \
 	-I$(top_srcdir)/src/conf \
+	-I$(top_builddir)/src/rpc \
 	$(NULL)
 
 WARN_CFLAGS += $(RELAXED_FRAME_LIMIT_CFLAGS)
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux