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

[Cluster-devel] Cluster Project branch, master, updated. cluster-2.99.03-12-g59342a0



This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Cluster Project".

http://sources.redhat.com/git/gitweb.cgi?p=cluster.git;a=commitdiff;h=59342a0899496061507e0ab4c30f02e1b5746e0f

The branch, master has been updated
       via  59342a0899496061507e0ab4c30f02e1b5746e0f (commit)
      from  a1a9382b9fb73087ae57ff7d16ad053495141f6f (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 59342a0899496061507e0ab4c30f02e1b5746e0f
Author: Fabio M. Di Nitto <fdinitto redhat com>
Date:   Fri Jun 6 10:46:43 2008 +0200

    [BUILD] Collapse common library makefile bits in libs.mk
    
    Almost all libraries we build share the same Makefile bits:
    
    - Collapse them in one location.
    - Make it smarter to switch a library from shared to static and viceversa.
    - Convert all possible libs to use the new system.
    
    Fix libdlm linking order.
    
    Standardize invokation to AR.
    
    Signed-off-by: Fabio M. Di Nitto <fdinitto redhat com>

-----------------------------------------------------------------------

Summary of changes:
 ccs/libccscompat/Makefile         |   16 ++----------
 cman/lib/Makefile                 |   32 +-----------------------
 config/libs/libccsconfdb/Makefile |   28 +---------------------
 dlm/libdlm/Makefile               |    8 +++---
 dlm/libdlmcontrol/Makefile        |   30 +----------------------
 fence/libfence/Makefile           |   30 +----------------------
 fence/libfenced/Makefile          |   15 +++--------
 gfs/libgfs/Makefile               |   40 +++++++++++-------------------
 gfs2/libgfs2/Makefile             |   37 ++++++++++-------------------
 group/lib/Makefile                |   13 +--------
 group/libgfscontrol/Makefile      |   15 +++--------
 make/libs.mk                      |   47 +++++++++++++++++++++++++++++++++++++
 12 files changed, 99 insertions(+), 212 deletions(-)
 create mode 100644 make/libs.mk

diff --git a/ccs/libccscompat/Makefile b/ccs/libccscompat/Makefile
index 0f5f2d9..5650155 100644
--- a/ccs/libccscompat/Makefile
+++ b/ccs/libccscompat/Makefile
@@ -10,28 +10,18 @@
 ###############################################################################
 ###############################################################################
 
-TARGET= libccscompat.a
+TARGET= libccscompat
 
-all: ${TARGET}
+MAKESTATICLIB = 1
 
 include ../../make/defines.mk
+include $(OBJDIR)/make/libs.mk
 include $(OBJDIR)/make/cobj.mk
 include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	libccscompat.o
-
 CFLAGS += -D_FILE_OFFSET_BITS=64
 CFLAGS += -fPIC
 CFLAGS += -I$(S)/../include
 CFLAGS += -I${incdir}
-
-
-${TARGET}: ${OBJS}
-	${AR} cr $@ $^
-	${RANLIB} $@
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/cman/lib/Makefile b/cman/lib/Makefile
index 13c6f6e..10ca696 100644
--- a/cman/lib/Makefile
+++ b/cman/lib/Makefile
@@ -2,7 +2,7 @@
 ###############################################################################
 ##
 ##  Copyright (C) Sistina Software, Inc.  1997-2004  All rights reserved.
-##  Copyright (C) 2004 Red Hat, Inc.  All rights reserved.
+##  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 ##  
 ##  This copyrighted material is made available to anyone wishing to use,
 ##  modify, copy, or redistribute it subject to the terms and conditions
@@ -13,41 +13,13 @@
 
 TARGET= libcman
 
-LIBDIRT=$(TARGET).a \
-	$(TARGET).so.$(SOMAJOR).$(SOMINOR)
-
-LIBSYMT=$(TARGET).so \
-	$(TARGET).so.$(SOMAJOR)
-
-INCDIRT=$(TARGET).h
-
 include ../../make/defines.mk
-
-SHAREDLIB=$(TARGET).so.${SOMAJOR}.${SOMINOR}
-STATICLIB=$(TARGET).a
-
-all: $(STATICLIB) $(SHAREDLIB)
-
+include $(OBJDIR)/make/libs.mk
 include $(OBJDIR)/make/cobj.mk
 include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	$(TARGET).o
-
 CFLAGS += -fPIC
 CFLAGS += -I${cmanincdir} -I$(S)/../daemon
 CFLAGS += -I${incdir}
-
-$(TARGET).a: $(OBJS)
-	${AR} r $@ $^
-	${RANLIB} $@
-
-$(TARGET).so.${SOMAJOR}.${SOMINOR}: $(OBJS)
-	$(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $<
-	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so
-	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/config/libs/libccsconfdb/Makefile b/config/libs/libccsconfdb/Makefile
index 92c3b78..515c515 100644
--- a/config/libs/libccsconfdb/Makefile
+++ b/config/libs/libccsconfdb/Makefile
@@ -13,28 +13,15 @@
 
 TARGET= libccs
 
-LIBDIRT=$(TARGET).a \
-	$(TARGET).so.$(SOMAJOR).$(SOMINOR)
-
-LIBSYMT=$(TARGET).so \
-	$(TARGET).so.$(SOMAJOR)
-
 INCDIRT=ccs.h
 
 include ../../../make/defines.mk
-
-SHAREDLIB=$(TARGET).so.${SOMAJOR}.${SOMINOR}
-STATICLIB=$(TARGET).a
-
-all: $(STATICLIB) $(SHAREDLIB)
-
+include $(OBJDIR)/make/libs.mk
 include $(OBJDIR)/make/cobj.mk
 include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	$(TARGET).o
-
 CFLAGS += -fPIC
 CFLAGS += -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64
 CFLAGS += -I${openaisincdir} `xml2-config --cflags`
@@ -42,16 +29,3 @@ CFLAGS += -I${incdir}
 
 LDFLAGS += -L${openaislibdir} -lconfdb
 LDFLAGS += `xml2-config --libs`
-
-$(TARGET).a: $(OBJS)
-	${AR} r $@ $^
-	${RANLIB} $@
-
-$(TARGET).so.${SOMAJOR}.${SOMINOR}: $(OBJS)
-	$(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $< $(LDFLAGS)
-	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so
-	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/dlm/libdlm/Makefile b/dlm/libdlm/Makefile
index d164ec9..a1e4a3d 100644
--- a/dlm/libdlm/Makefile
+++ b/dlm/libdlm/Makefile
@@ -48,20 +48,20 @@ CFLAGS += -I$(KERNEL_SRC)/include
 PTHREAD_LDFLAGS += -lpthread 
 
 $(TARGET).a: $(TARGET).o $(AISTARGET).o
-	${AR} r $@ $^
+	${AR} cru $@ $^
 	${RANLIB} $@
 
 $(TARGET)_lt.a: $(TARGET)_lt.o
-	${AR} r $@ $^
+	${AR} cru $@ $^
 	${RANLIB} $@
 
 $(TARGET).so.${SOMAJOR}.${SOMINOR}: $(TARGET).po $(AISTARGET).po
-	$(CC) $(PTHREAD_LDFLAGS) $(LDFLAGS) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $<
+	$(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $< $(PTHREAD_LDFLAGS) $(LDFLAGS)
 	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so
 	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR)
 
 $(TARGET)_lt.so.${SOMAJOR}.${SOMINOR}: $(TARGET)_lt.po
-	$(CC) $(LDFLAGS) -shared -o $@ -Wl,-soname=$(TARGET)_lt.so.$(SOMAJOR) $<
+	$(CC) -shared -o $@ -Wl,-soname=$(TARGET)_lt.so.$(SOMAJOR) $< $(LDFLAGS)
 	ln -sf $(TARGET)_lt.so.$(SOMAJOR).$(SOMINOR) $(TARGET)_lt.so
 	ln -sf $(TARGET)_lt.so.$(SOMAJOR).$(SOMINOR) $(TARGET)_lt.so.$(SOMAJOR)
 
diff --git a/dlm/libdlmcontrol/Makefile b/dlm/libdlmcontrol/Makefile
index 30447f3..4a5b584 100644
--- a/dlm/libdlmcontrol/Makefile
+++ b/dlm/libdlmcontrol/Makefile
@@ -12,42 +12,16 @@
 
 TARGET= libdlmcontrol
 
-LIBDIRT=$(TARGET).a \
-	$(TARGET).so.$(SOMAJOR).$(SOMINOR)
-
-LIBSYMT=$(TARGET).so \
-	$(TARGET).so.$(SOMAJOR)
-
-INCDIRT=$(TARGET).h
+OBJS=	main.o
 
 include ../../make/defines.mk
-
-SHAREDLIB=$(TARGET).so.${SOMAJOR}.${SOMINOR}
-STATICLIB=$(TARGET).a
-
-all: $(STATICLIB) $(SHAREDLIB)
-
+include $(OBJDIR)/make/libs.mk
 include $(OBJDIR)/make/cobj.mk
 include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	main.o
-
 CFLAGS += -fPIC
 CFLAGS += -I$(S)/../../group/dlm_controld
 CFLAGS += -I${incdir}
 CFLAGS += -I$(KERNEL_SRC)/include
-
-$(TARGET).a: $(OBJS)
-	${AR} r $@ $^
-	${RANLIB} $@
-
-$(TARGET).so.${SOMAJOR}.${SOMINOR}: $(OBJS)
-	$(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $< $(LDFLAGS)
-	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so
-	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/fence/libfence/Makefile b/fence/libfence/Makefile
index 94a5064..c751d6b 100644
--- a/fence/libfence/Makefile
+++ b/fence/libfence/Makefile
@@ -12,43 +12,17 @@
 
 TARGET= libfence
 
-LIBDIRT=$(TARGET).a \
-	$(TARGET).so.$(SOMAJOR).$(SOMINOR)
-
-LIBSYMT=$(TARGET).so \
-	$(TARGET).so.$(SOMAJOR)
-
-INCDIRT=$(TARGET).h
+OBJS=	agent.o
 
 include ../../make/defines.mk
-
-SHAREDLIB=$(TARGET).so.${SOMAJOR}.${SOMINOR}
-STATICLIB=$(TARGET).a
-
-all: $(STATICLIB) $(SHAREDLIB)
-
+include $(OBJDIR)/make/libs.mk
 include $(OBJDIR)/make/cobj.mk
 include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	agent.o
-
 CFLAGS += -fPIC
 CFLAGS += -I${ccsincdir}
 CFLAGS += -I${incdir}
 
 LDFLAGS += -L${ccslibdir} -lccs
-
-$(TARGET).a: $(OBJS)
-	${AR} r $@ $^
-	${RANLIB} $@
-
-$(TARGET).so.${SOMAJOR}.${SOMINOR}: $(OBJS)
-	$(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $< $(LDFLAGS)
-	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so
-	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR)
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/fence/libfenced/Makefile b/fence/libfenced/Makefile
index a01062c..3cda0a7 100644
--- a/fence/libfenced/Makefile
+++ b/fence/libfenced/Makefile
@@ -12,24 +12,17 @@
 
 TARGET= libfenced
 
-all: $(TARGET).a
+MAKESTATICLIB = 1
+
+OBJS=	main.o
 
 include ../../make/defines.mk
+include $(OBJDIR)/make/libs.mk
 include $(OBJDIR)/make/cobj.mk
 include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	main.o
-
 CFLAGS += -fPIC
 CFLAGS += -I$(S)/../fenced
 CFLAGS += -I${incdir}
-
-$(TARGET).a: $(OBJS)
-	${AR} r $@ $^
-	${RANLIB} $@
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/gfs/libgfs/Makefile b/gfs/libgfs/Makefile
index 4195226..7d26001 100644
--- a/gfs/libgfs/Makefile
+++ b/gfs/libgfs/Makefile
@@ -2,7 +2,7 @@
 ###############################################################################
 ##
 ##  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-##  Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+##  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 ##
 ##  This copyrighted material is made available to anyone wishing to use,
 ##  modify, copy, or redistribute it subject to the terms and conditions
@@ -11,22 +11,9 @@
 ###############################################################################
 ###############################################################################
 
-TARGET=libgfs.a
+TARGET=libgfs
 
-all: ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
-CFLAGS += -D_GNU_SOURCE -DHELPER_PROGRAM
-CFLAGS += -c
-CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/
-CFLAGS += -I${gfskincdir} -I$(S)/../include
-CFLAGS += -I${incdir}
+MAKESTATICLIB = 1
 
 OBJS=	bio.o \
 	bitmap.o \
@@ -44,13 +31,16 @@ OBJS=	bio.o \
 	super.o \
 	util.o
 
+include ../../make/defines.mk
+include $(OBJDIR)/make/libs.mk
+include $(OBJDIR)/make/cobj.mk
+include $(OBJDIR)/make/clean.mk
+include $(OBJDIR)/make/install.mk
+include $(OBJDIR)/make/uninstall.mk
 
-${TARGET}: ${OBJS}
-	${AR} cru $@ $^
-	${RANLIB} $@
-
-clean: generalclean
-
-.PHONY: all
-
--include $(OBJS:.o=.d)
+CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE
+CFLAGS += -D_GNU_SOURCE -DHELPER_PROGRAM
+CFLAGS += -c
+CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/
+CFLAGS += -I${gfskincdir} -I$(S)/../include
+CFLAGS += -I${incdir}
diff --git a/gfs2/libgfs2/Makefile b/gfs2/libgfs2/Makefile
index d6bbcef..40091fd 100644
--- a/gfs2/libgfs2/Makefile
+++ b/gfs2/libgfs2/Makefile
@@ -2,7 +2,7 @@
 ###############################################################################
 ##
 ##  Copyright (C) Sistina Software, Inc.  1997-2003  All rights reserved.
-##  Copyright (C) 2004-2006 Red Hat, Inc.  All rights reserved.
+##  Copyright (C) 2004-2008 Red Hat, Inc.  All rights reserved.
 ##
 ##  This copyrighted material is made available to anyone wishing to use,
 ##  modify, copy, or redistribute it subject to the terms and conditions
@@ -11,20 +11,9 @@
 ###############################################################################
 ###############################################################################
 
-TARGET= libgfs2.a
+TARGET= libgfs2
 
-all: ${TARGET}
-
-include ../../make/defines.mk
-include $(OBJDIR)/make/cobj.mk
-include $(OBJDIR)/make/clean.mk
-include $(OBJDIR)/make/install.mk
-include $(OBJDIR)/make/uninstall.mk
-
-CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
-CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/
-CFLAGS += -I$(S)/../include
-CFLAGS += -I${incdir}
+MAKESTATICLIB = 1
 
 OBJS=	bitmap.o \
 	block_list.o \
@@ -43,14 +32,14 @@ OBJS=	bitmap.o \
 	super.o \
 	rgrp.o
 
+include ../../make/defines.mk
+include $(OBJDIR)/make/libs.mk
+include $(OBJDIR)/make/cobj.mk
+include $(OBJDIR)/make/clean.mk
+include $(OBJDIR)/make/install.mk
+include $(OBJDIR)/make/uninstall.mk
 
-${TARGET}: ${OBJS}
-	${AR} cru $@ $^
-	${RANLIB} $@
-
-clean: generalclean
-
-.PHONY: all
-
--include $(OBJS:.o=.d)
-
+CFLAGS += -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE -D_GNU_SOURCE
+CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/
+CFLAGS += -I$(S)/../include
+CFLAGS += -I${incdir}
diff --git a/group/lib/Makefile b/group/lib/Makefile
index 25ae3c8..35434de 100644
--- a/group/lib/Makefile
+++ b/group/lib/Makefile
@@ -12,9 +12,10 @@
 
 TARGET=libgroup
 
-all: $(TARGET).a
+MAKESTATICLIB = 1
 
 include ../../make/defines.mk
+include $(OBJDIR)/make/libs.mk
 include $(OBJDIR)/make/cobj.mk
 include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
@@ -23,13 +24,3 @@ include $(OBJDIR)/make/uninstall.mk
 CFLAGS += -fPIC
 CFLAGS += -I$(S) -I$(S)/../daemon
 CFLAGS += -I${incdir}
-
-OBJS= $(TARGET).o
-
-$(TARGET).a: $(OBJS)
-	${AR} r $@ $^
-	${RANLIB} $@
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/group/libgfscontrol/Makefile b/group/libgfscontrol/Makefile
index 451848a..e51a53c 100644
--- a/group/libgfscontrol/Makefile
+++ b/group/libgfscontrol/Makefile
@@ -12,24 +12,17 @@
 
 TARGET= libgfscontrol
 
-all: $(TARGET).a
+MAKESTATICLIB = 1
+
+OBJS= main.o
 
 include ../../make/defines.mk
+include $(OBJDIR)/make/libs.mk
 include $(OBJDIR)/make/cobj.mk
 include $(OBJDIR)/make/clean.mk
 include $(OBJDIR)/make/install.mk
 include $(OBJDIR)/make/uninstall.mk
 
-OBJS=	main.o
-
 CFLAGS += -fPIC
 CFLAGS += -I$(S)/../../group/gfs_controld
 CFLAGS += -I${incdir}
-
-$(TARGET).a: $(OBJS)
-	${AR} r $@ $^
-	${RANLIB} $@
-
-clean: generalclean
-
--include $(OBJS:.o=.d)
diff --git a/make/libs.mk b/make/libs.mk
new file mode 100644
index 0000000..c9221fa
--- /dev/null
+++ b/make/libs.mk
@@ -0,0 +1,47 @@
+# handle objects
+ifndef OBJS
+ OBJS = $(TARGET).o
+endif
+
+# we always build the static version
+ifndef STATICLIB
+ STATICLIB = $(TARGET).a
+endif
+
+# handle the shared version
+ifndef MAKESTATICLIB
+ ifndef LIBDIRT
+  LIBDIRT=$(TARGET).a \
+	  $(TARGET).so.$(SOMAJOR).$(SOMINOR)
+ endif
+ ifndef LIBSYMT
+  LIBSYMT=$(TARGET).so \
+	  $(TARGET).so.$(SOMAJOR)
+ endif
+ ifndef INCDIRT
+  INCDIRT=$(TARGET).h
+ endif
+ ifndef SHAREDLIB
+  SHAREDLIB=$(TARGET).so.${SOMAJOR}.${SOMINOR}
+ endif
+
+all: $(STATICLIB) $(SHAREDLIB)
+
+$(SHAREDLIB): $(OBJS)
+	$(CC) -shared -o $@ -Wl,-soname=$(TARGET).so.$(SOMAJOR) $< $(LDFLAGS)
+	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so
+	ln -sf $(TARGET).so.$(SOMAJOR).$(SOMINOR) $(TARGET).so.$(SOMAJOR)
+
+else
+
+all: $(STATICLIB)
+
+endif
+
+$(STATICLIB): $(OBJS)
+	${AR} cru $@ $^
+	${RANLIB} $@
+
+clean: generalclean
+
+-include $(OBJS:.o=.d)


hooks/post-receive
--
Cluster Project


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