On Thu, Nov 26, 2009 at 11:04:04AM +0000, Richard W.M. Jones wrote:
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
I don't quite understand why, but now the appliance is being
rebuilt very frequently again, and I think it's related to
this commit ...
Rich.
--
Richard Jones, Virtualization Group, Red Hat
http://people.redhat.com/~rjones
Read my programming blog:
http://rwmj.wordpress.com
Fedora now supports 80 OCaml packages (the OPEN alternative to F#)
http://cocan.org/getting_started_with_ocaml_on_red_hat_and_fedora