[Sheepdog] [PATCH] Build lib files once into an archive instead of twice for sheep/collie

Steven Dake sdake at redhat.com
Fri May 21 19:43:16 CEST 2010


The previous automake setup would build the lib dir files twice.  This patch
builds a library of files in the lib dir, and then links it with either collie
or sheep.

Signed-off-by: Steven Dake <sdake at redhat.com>
---
 Makefile.am        |    2 +-
 collie/Makefile.am |    7 +++----
 lib/Makefile.am    |    8 ++++++--
 sheep/Makefile.am  |    6 +++---
 4 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index fedd5ab..88b174c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -13,7 +13,7 @@ sheepdogsysconfdir	= ${SHEEPDOGCONFDIR}
 
 sheepdogsysconf_DATA	= 
 
-SUBDIRS			= collie sheep include script lib
+SUBDIRS			= lib collie sheep include script
 
 install-exec-local:
 
diff --git a/collie/Makefile.am b/collie/Makefile.am
index 2f629c1..515b97a 100644
--- a/collie/Makefile.am
+++ b/collie/Makefile.am
@@ -23,10 +23,9 @@ INCLUDES		= -I$(top_builddir)/include -I$(top_srcdir)/include
 
 sbin_PROGRAMS		= collie
 
-collie_SOURCES		= collie.c treeview.c ../lib/event.c ../lib/net.c ../lib/logger.c
-collie_LDADD	  	= 
-collie_DEPENDENCIES	= 
-
+collie_SOURCES		= collie.c treeview.c
+collie_LDADD	  	= ../lib/libsheepdog.a
+collie_DEPENDENCIES	= ../lib/libsheepdog.a
 
 noinst_HEADERS		= treeview.h
 
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 2375b68..cb46c9a 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,3 +1,7 @@
-MAINTAINERCLEANFILES    = Makefile.in config.h.in
+MAINTAINERCLEANFILES    = Makefile.in
 
-noinst_HEADERS          = event.c logger.c net.c
+INCLUDES                = -I$(top_builddir)/include -I$(top_srcdir)/include
+
+noinst_LIBRARIES	= libsheepdog.a
+
+libsheepdog_a_SOURCES	= event.c logger.c net.c
diff --git a/sheep/Makefile.am b/sheep/Makefile.am
index 4f68683..9efb8c3 100644
--- a/sheep/Makefile.am
+++ b/sheep/Makefile.am
@@ -23,9 +23,9 @@ INCLUDES		= -I$(top_builddir)/include -I$(top_srcdir)/include $(libcpg_CFLAGS) $
 
 sbin_PROGRAMS		= sheep
 
-sheep_SOURCES		= sheep.c group.c sdnet.c store.c vdi.c work.c ../lib/event.c ../lib/logger.c ../lib/net.c
-sheep_LDADD	  	= $(libcpg_LIBS) $(libcfg_LIBS)
-sheep_DEPENDENCIES	= 
+sheep_SOURCES		= sheep.c group.c sdnet.c store.c vdi.c work.c
+sheep_LDADD	  	= $(libcpg_LIBS) $(libcfg_LIBS) ../lib/libsheepdog.a
+sheep_DEPENDENCIES	= ../lib/libsheepdog.a
 
 
 noinst_HEADERS		= work.h sheep_priv.h
-- 
1.6.2.5




More information about the sheepdog mailing list