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

[Libguestfs] [PATCH 2/2] daemon: Link guestfs_protocol.[ch] into the daemon directory.



-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
libguestfs lets you edit virtual machines.  Supports shell scripting,
bindings from many languages.  http://et.redhat.com/~rjones/libguestfs/
See what it can do: http://et.redhat.com/~rjones/libguestfs/recipes.html
>From d7cefd8bdaa53ae1c6172a472d60f3e37ea40089 Mon Sep 17 00:00:00 2001
From: Richard Jones <rjones redhat com>
Date: Thu, 26 Nov 2009 11:01:01 +0000
Subject: [PATCH 2/2] daemon: Link guestfs_protocol.[ch] into the daemon directory.

Instead of doing a recursive call into the src/ directory to build
the object files, hard link the source files into the daemon
directory and build them separately.

See:
http://www.redhat.com/archives/libguestfs/2009-November/msg00254.html
---
 .gitignore         |    2 ++
 daemon/Makefile.am |   29 ++++++++++++++++++++++++-----
 2 files changed, 26 insertions(+), 5 deletions(-)

diff --git a/.gitignore b/.gitignore
index 1af0b68..6293dd9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -45,6 +45,8 @@ config.sub
 configure
 daemon/actions.h
 daemon/guestfsd
+daemon/guestfs_protocol.c
+daemon/guestfs_protocol.h
 daemon/install-sh
 daemon/missing
 daemon/names.c
diff --git a/daemon/Makefile.am b/daemon/Makefile.am
index 485f340..d4eb563 100644
--- a/daemon/Makefile.am
+++ b/daemon/Makefile.am
@@ -32,12 +32,31 @@ $(generator_built): $(libsrcdir)/stamp-generator
 $(libsrcdir)/stamp-generator: force
 	$(MAKE) -C $(libsrcdir) stamp-generator
 
-BUILT_SOURCES = $(generator_built)
+BUILT_SOURCES = \
+	$(generator_built) \
+	guestfs_protocol.c \
+	guestfs_protocol.h
 
 EXTRA_DIST = $(BUILT_SOURCES)
 
-$(libsrcdir)/guestfs_protocol.o: force
-	$(MAKE) -C $(libsrcdir) guestfs_protocol.o
+# This convenience library is solely to avoid compiler warnings
+# in its generated sources.
+noinst_LIBRARIES = libprotocol.a
+libprotocol_a_SOURCES = \
+	guestfs_protocol.c \
+	guestfs_protocol.h
+libprotocol_a_CFLAGS =
+
+guestfs_protocol.c: $(libsrcdir)/guestfs_protocol.c
+	rm -f $@
+	ln $< $@
+guestfs_protocol.h: $(libsrcdir)/guestfs_protocol.h
+	rm -f $@
+	ln $< $@
+$(libsrcdir)/guestfs_protocol.c: force
+	$(MAKE) -C $(libsrcdir) guestfs_protocol.c
+$(libsrcdir)/guestfs_protocol.h: force
+	$(MAKE) -C $(libsrcdir) guestfs_protocol.c
 
 noinst_PROGRAMS = guestfsd
 guestfsd_SOURCES = \
@@ -110,8 +129,8 @@ guestfsd_SOURCES = \
 	zero.c \
 	zerofree.c
 guestfsd_LDADD = \
-        $(libsrcdir)/guestfs_protocol.o \
-        lib/libgnu.a $(LIB_CLOCK_GETTIME)
+	libprotocol.a \
+	lib/libgnu.a $(LIB_CLOCK_GETTIME)
 
 AM_CPPFLAGS = -I$(srcdir)/lib -Ilib
 guestfsd_CFLAGS = $(WARN_CFLAGS) $(WERROR_CFLAGS)
-- 
1.6.5.2


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