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

[Cluster-devel] [PATCH] Makefile cleanup part2




Hi guys,

this patch restore the make dependencies within the same subproject (same as it was before the big rework), do some PHONY clean up, clean up a few Makefiles that were still using an old format.

Please commit or ack and I will apply.

I also noticed the following unused files:

gfs/gfs_edit/ondisk.c
gfs2/edit/ondisk.c

Can I kill them?

Thanks
Fabio

--
I'm going to make him an offer he can't refuse.
? make/defines.mk
Index: ccs/ccs_test/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/ccs/ccs_test/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- ccs/ccs_test/Makefile	3 May 2007 16:55:49 -0000	1.5
+++ ccs/ccs_test/Makefile	15 May 2007 12:48:11 -0000
@@ -27,7 +27,7 @@
 
 LDFLAGS += -L${ccslibdir} -lccs
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -35,6 +35,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../lib all
+
 install: all
 	install -d ${sbindir}
 	install ${TARGET} ${sbindir}
@@ -44,3 +47,5 @@
 
 clean:
 	rm -rf *.o ${TARGET} *~
+
+.PHONY: all ${TARGET}
Index: ccs/ccs_tool/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/ccs/ccs_tool/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- ccs/ccs_tool/Makefile	3 May 2007 16:55:49 -0000	1.10
+++ ccs/ccs_tool/Makefile	15 May 2007 12:48:11 -0000
@@ -34,7 +34,7 @@
 LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
 LDFLAGS += `xml2-config --libs` -L${libdir} -ldl
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -42,6 +42,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../lib all
+
 clean:
 	rm -f *.o ccs_tool *~
 
@@ -51,3 +54,5 @@
 
 uninstall:
 	${UNINSTALL} ccs_tool ${sbindir}
+
+.PHONY: all ${TARGET}
Index: ccs/daemon/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/ccs/daemon/Makefile,v
retrieving revision 1.12
diff -u -r1.12 Makefile
--- ccs/daemon/Makefile	3 May 2007 16:55:50 -0000	1.12
+++ ccs/daemon/Makefile	15 May 2007 12:48:11 -0000
@@ -34,7 +34,7 @@
 LDFLAGS += -L${cmanlibdir} -lcman -L${ccslibdir} -lccs
 LDFLAGS += -L${libdir} `xml2-config --libs` -lpthread -ldl
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -42,6 +42,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	 $(MAKE) -C ../lib all
+
 install: all
 	install -d ${sbindir}
 	install ${TARGET} ${sbindir}
@@ -51,3 +54,5 @@
 
 clean:
 	rm -rf *.o ${TARGET} *~ log.c
+
+.PHONY: all ${TARGET}
Index: cman/cman_tool/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/cman/cman_tool/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- cman/cman_tool/Makefile	3 May 2007 16:55:51 -0000	1.20
+++ cman/cman_tool/Makefile	15 May 2007 12:48:12 -0000
@@ -29,7 +29,7 @@
 
 LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -37,6 +37,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../lib all
+
 install: all
 	install -d ${sbindir}
 	install ${TARGET} ${sbindir}
@@ -46,4 +49,3 @@
 
 clean:
 	rm -f *.o ${TARGET}
-
Index: cman/daemon/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/cman/daemon/Makefile,v
retrieving revision 1.49
diff -u -r1.49 Makefile
--- cman/daemon/Makefile	3 May 2007 16:55:52 -0000	1.49
+++ cman/daemon/Makefile	15 May 2007 12:48:12 -0000
@@ -35,7 +35,7 @@
 	barrier.o \
 	cmanccs.o
 
-all:  ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDFLAGS)
@@ -43,6 +43,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../lib all
+
 install: all
 	install -d ${libexecdir}/lcrso
 	install -s ${TARGET} ${libexecdir}/lcrso
Index: cman/man/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/cman/man/Makefile,v
retrieving revision 1.3
diff -u -r1.3 Makefile
--- cman/man/Makefile	30 Apr 2007 11:22:01 -0000	1.3
+++ cman/man/Makefile	15 May 2007 12:48:13 -0000
@@ -17,8 +17,6 @@
 
 clean:
 
-distclean:
-
 install:
 	install -d ${mandir}/man5
 	install -d ${mandir}/man8
Index: cman/qdisk/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/cman/qdisk/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- cman/qdisk/Makefile	3 May 2007 16:55:52 -0000	1.9
+++ cman/qdisk/Makefile	15 May 2007 12:48:13 -0000
@@ -37,7 +37,7 @@
 	    disk_util.o \
 	    proc.o
 
-all: ${TARGET1} ${TARGET2}
+all: depends ${TARGET1} ${TARGET2}
 
 ${TARGET1}: ${SHAREDOBJS} ${OBJS1}
 	$(CC) -o $@ $^ $(LDFLAGS) $(EXTRA_LDFLAGS)
@@ -52,6 +52,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../lib all
+
 clean:
 	rm -f *.o ${TARGET1} ${TARGET2}
 
Index: gfs/gfs_fsck/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs/gfs_fsck/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- gfs/gfs_fsck/Makefile	3 May 2007 16:55:54 -0000	1.9
+++ gfs/gfs_fsck/Makefile	15 May 2007 12:48:17 -0000
@@ -12,24 +12,52 @@
 
 include ../../make/defines.mk
 
-TARGET= gfs_fsck
+TARGET1= gfs_fsck
+TARGET2= fsck.gfs
 
-sources = main.c initialize.c pass1.c pass1b.c pass1c.c \
-	  pass2.c pass3.c pass4.c pass5.c \
-	  block_list.c super.c bio.c ondisk.c file.c rgrp.c fs_bits.c util.c \
-	  fs_bmap.c fs_inode.c fs_dir.c fs_recovery.c log.c hash.c \
-	  inode_hash.c bitmap.c lost_n_found.c inode.c link.c metawalk.c \
-	  eattr.c
+OBJS=	bio.o \
+	bitmap.o \
+	block_list.o \
+	eattr.o \
+	file.o \
+	fs_bits.o \
+	fs_bmap.o \
+	fs_dir.o \
+	fs_inode.o \
+	fs_recovery.o \
+	hash.o \
+	initialize.o \
+	inode.o \
+	inode_hash.o \
+	link.o \
+	log.o \
+	lost_n_found.o \
+	main.o \
+	metawalk.o \
+	ondisk.o \
+	pass1.o \
+	pass1b.o \
+	pass1c.o \
+	pass2.o \
+	pass3.o \
+	pass4.o \
+	pass5.o \
+	rgrp.o \
+	super.o \
+	util.o
 
 CFLAGS += -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\"
 CFLAGS += -MMD -O2
 CFLAGS += -I../include
 
-all: ${TARGET}
+all: ${TARGET1} ${TARGET2}
 
-${TARGET}: $(sources:.c=.o)
+${TARGET1}: $(OBJS)
 	$(CC) -o $@ $^ $(LDFLAGS)
 
+${TARGET2}: ${TARGET1}
+	ln -s ${TARGET1} ${TARGET2}
+
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
@@ -40,24 +68,21 @@
 	$(CC) -o $@ $^ $(LDFLAGS)
 
 clean:
-	@rm -f *.o *~ *.d gfs_fsck
+	rm -f *.o *~ *.d ${TARGET1} ${TARGET2} cscope.* test_inode_list *.orig *.rej test_block_list test_bitmap
 
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
 	fi
-	install -m755 ${TARGET} ${sbindir}
-	(cd ${sbindir}; ln -sf ${TARGET} fsck.gfs)
+	install -m755 ${TARGET1} ${sbindir}
+	ln -sf ${sbindir}/${TARGET1} ${sbindir}/${TARGET2}
 
 uninstall:
-	${UNINSTALL} ${TARGET} fsck.gfs ${sbindir}
-
-distclean: clean
-	@rm -f cscope.* test_inode_list *.orig *.rej test_block_list test_bitmap
+	${UNINSTALL} ${TARGET1} ${TARGET2} ${sbindir}
 
-gfs_fsck.pot: $(sources)
-	@xgettext -C -F --keyword=print_log --keyword=log_debug --keyword=log_info --keyword=_ \
+${TARGET1}.pot: $(OBJS:.o=.c)
+	xgettext -C -F --keyword=print_log --keyword=log_debug --keyword=log_info --keyword=_ \
 	 --keyword=log_notice --keyword=log_warn --keyword=log_err --keyword=log_crit \
-	 --keyword=log_debug --keyword=log_err --keyword=log_print -d - $(sources) > gfs_fsck.pot	
+	 --keyword=log_debug --keyword=log_err --keyword=log_print -d - $(OBJS:.o=.c) > ${TARGET1}.pot	
 
--include $(sources:.c=.d)
+-include $(OBJS:.o=.d)
Index: gfs/gfs_grow/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs/gfs_grow/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- gfs/gfs_grow/Makefile	3 May 2007 16:55:54 -0000	1.8
+++ gfs/gfs_grow/Makefile	15 May 2007 12:48:17 -0000
@@ -24,7 +24,7 @@
 
 LDFLAGS += -L../libgfs -lgfs
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -32,6 +32,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs all
+
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
@@ -43,3 +46,5 @@
 
 clean:
 	rm -f *.o ${TARGET}
+
+.PHONY: all ${TARGET}
Index: gfs/gfs_jadd/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs/gfs_jadd/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- gfs/gfs_jadd/Makefile	3 May 2007 16:55:55 -0000	1.8
+++ gfs/gfs_jadd/Makefile	15 May 2007 12:48:17 -0000
@@ -24,7 +24,7 @@
 
 LDFLAGS += -L../libgfs -lgfs
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -32,6 +32,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs all
+
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
@@ -44,4 +47,4 @@
 clean:
 	rm -f *.o ${TARGET}
 
-
+.PHONY: all ${TARGET}
Index: gfs/gfs_mkfs/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs/gfs_mkfs/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- gfs/gfs_mkfs/Makefile	3 May 2007 16:55:55 -0000	1.8
+++ gfs/gfs_mkfs/Makefile	15 May 2007 12:48:17 -0000
@@ -13,7 +13,8 @@
 
 include ../../make/defines.mk
 
-TARGET= gfs_mkfs
+TARGET1= gfs_mkfs
+TARGET2= mkfs.gfs
 
 OBJS=	device_geometry.o \
 	fs_geometry.o \
@@ -30,25 +31,31 @@
 LDFLAGS += -L${volidlibdir} -lvolume_id
 LDFLAGS += -L../libgfs -lgfs
 
-all: ${TARGET}
+all: depends ${TARGET1} ${TARGET2}
 
-${TARGET}: ${OBJS}
+${TARGET1}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
 
+${TARGET2}: ${TARGET1}
+	ln -sf ${TARGET1} ${TARGET2}
+
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs all
+
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
 	fi
-	install -m755 ${TARGET} ${sbindir}
-	(cd ${sbindir}; ln -f ${TARGET} mkfs.gfs)
+	install -m755 ${TARGET1} ${sbindir}
+	ln -f ${sbindir}/${TARGET1} ${sbindir}/${TARGET2}
 
 uninstall:
-	${UNINSTALL} ${TARGET} mkfs.gfs ${sbindir}
+	${UNINSTALL} ${TARGET1} ${TARGET2} ${sbindir}
 
 clean:
-	rm -f *.o ${TARGET}
-
+	rm -f *.o ${TARGET1} ${TARGET2}
 
+.PHONY: all ${TARGET1}
Index: gfs/libgfs/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs/libgfs/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- gfs/libgfs/Makefile	3 May 2007 16:55:55 -0000	1.5
+++ gfs/libgfs/Makefile	15 May 2007 12:48:17 -0000
@@ -11,11 +11,9 @@
 ###############################################################################
 ###############################################################################
 
-.PHONY: all clean install
-
 include ../../make/defines.mk
 
-LIBGFS=libgfs.a
+TARGET=libgfs.a
 
 CFLAGS += -I${KERNEL_SRC}/fs/gfs2/ -I${KERNEL_SRC}/include/
 CFLAGS += -I${gfskincdir} -I../include
@@ -23,12 +21,25 @@
 CFLAGS += -D_GNU_SOURCE -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\"
 CFLAGS += -c -Wall -ggdb 
 
-OBJS=bio.o bitmap.o block_list.o file.o fs_bits.o fs_bmap.o fs_dir.o \
-	fs_inode.o inode.o log.o ondisk.o rgrp.o size.o super.o util.o
+OBJS=	bio.o \
+	bitmap.o \
+	block_list.o \
+	file.o \
+	fs_bits.o \
+	fs_bmap.o \
+	fs_dir.o \
+	fs_inode.o \
+	inode.o \
+	log.o \
+	ondisk.o \
+	rgrp.o \
+	size.o \
+	super.o \
+	util.o
 
-all: ${LIBGFS}
+all: ${TARGET}
 
-${LIBGFS}: ${OBJS}
+${TARGET}: ${OBJS}
 	ar cru libgfs.a ${OBJS}
 	ranlib libgfs.a
 
@@ -40,4 +51,6 @@
 uninstall:
 
 clean:
-	rm -f *.o ${LIBGFS}
+	rm -f *.o ${TARGET}
+
+.PHONY: all
Index: gfs2/convert/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/convert/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- gfs2/convert/Makefile	3 May 2007 16:55:55 -0000	1.7
+++ gfs2/convert/Makefile	15 May 2007 12:48:18 -0000
@@ -23,7 +23,7 @@
 
 LDFLAGS += -L../libgfs2 -lgfs2
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -31,6 +31,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs2 all
+
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
@@ -41,7 +44,6 @@
 	${UNINSTALL} ${TARGET} ${sbindir}
 
 clean:
-	@rm -f *.o ${TARGET}
+	rm -f *.o ${TARGET}
 
-distclean: clean
-	@rm -f {top_srcdir}/make/defines.mk
+.PHONY: all ${TARGET}
Index: gfs2/edit/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/edit/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- gfs2/edit/Makefile	3 May 2007 16:55:55 -0000	1.6
+++ gfs2/edit/Makefile	15 May 2007 12:48:19 -0000
@@ -26,7 +26,7 @@
 LDFLAGS += -L${ncurseslibdir} -lncurses
 LDFLAGS += -L../libgfs2/ -lgfs2
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -34,6 +34,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs2 all
+
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
@@ -46,4 +49,4 @@
 clean:
 	rm -f *.o ${TARGET}
 
-
+.PHONY: all ${TARGET}
Index: gfs2/fsck/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/fsck/Makefile,v
retrieving revision 1.10
diff -u -r1.10 Makefile
--- gfs2/fsck/Makefile	3 May 2007 16:55:55 -0000	1.10
+++ gfs2/fsck/Makefile	15 May 2007 12:48:19 -0000
@@ -12,13 +12,27 @@
 
 include ../../make/defines.mk
 
-TARGET= gfs2_fsck
+TARGET1= gfs2_fsck
+TARGET2= fsck.gfs2
 
-.PHONY: all clean
-
-sources = main.c initialize.c pass1.c pass1b.c pass1c.c pass2.c pass3.c \
-	  pass4.c pass5.c util.c fs_recovery.c lost_n_found.c link.c \
-	  eattr.c hash.c inode_hash.c metawalk.c rgrepair.c
+OBJS=	eattr.o \
+	fs_recovery.o \
+	hash.o \
+	initialize.o \
+	inode_hash.o \
+	link.o \
+	lost_n_found.o \
+	main.o \
+	metawalk.o \
+	pass1.o \
+	pass1b.o \
+	pass1c.o \
+	pass2.o \
+	pass3.o \
+	pass4.o \
+	pass5.o \
+	rgrepair.o \
+	util.o
 
 CFLAGS += -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\"
 CFLAGS += -MMD -Wall -O2
@@ -27,14 +41,20 @@
 
 LDFLAGS += -L../libgfs2 -lgfs2
 
-all: ${TARGET}
+all: depends ${TARGET1} ${TARGET2}
 
-${TARGET}: $(sources:.c=.o)
+${TARGET1}: $(OBJS)
 	$(CC) -o $@ $^ $(LDFLAGS)
 
+${TARGET2}: ${TARGET1}
+	ln -fs ${TARGET1} ${TARGET2}	
+
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs2 all
+
 test_block_list: log.o test_block_list.o
 	$(CC) -o $@ $^ $(LDFLAGS)
 
@@ -42,23 +62,23 @@
 	$(CC) -o $@ $^ $(LDFLAGS)
 
 clean:
-	@rm -f gfs2_fsck *.o *~ *.d
+	rm -f ${TARGET1} ${TARGET2} *.o *~ *.d cscope.* test_inode_list *.orig *.rej test_block_list test_bitmap
 
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
 	fi
-	install -m755 ${TARGET} ${sbindir}
+	install -m755 ${TARGET1} ${sbindir}
+	ln -sf ${sbindir}/${TARGET1} ${sbindir}/${TARGET2}
 
 uninstall:
-	${UNINSTALL} ${TARGET} ${sbindir}
+	${UNINSTALL} ${TARGET1} ${TARGET2} ${sbindir}
 
-distclean: clean
-	@rm -f cscope.* test_inode_list *.orig *.rej test_block_list test_bitmap
-
-gfs2_fsck.pot: $(sources)
-	@xgettext -C -F --keyword=print_log --keyword=log_debug --keyword=log_info --keyword=_ \
+${TARGET1}.pot: $(OBJS:.o=.c)
+	xgettext -C -F --keyword=print_log --keyword=log_debug --keyword=log_info --keyword=_ \
 	 --keyword=log_notice --keyword=log_warn --keyword=log_err --keyword=log_crit \
-	 --keyword=log_debug --keyword=log_err --keyword=log_print -d - $(sources) > gfs2_fsck.pot	
+	 --keyword=log_debug --keyword=log_err --keyword=log_print -d - $(OBJS:.o=.c) > ${TARGET1}.pot	
+
+-include $(OBJS:.o=.d)
 
--include $(sources:.c=.d)
+.PHONY: all ${TARGET1}
Index: gfs2/libgfs2/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/libgfs2/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- gfs2/libgfs2/Makefile	3 May 2007 16:55:56 -0000	1.6
+++ gfs2/libgfs2/Makefile	15 May 2007 12:48:19 -0000
@@ -11,8 +11,6 @@
 ###############################################################################
 ###############################################################################
 
-.PHONY: all clean install
-
 include ../../make/defines.mk
 
 TARGET= libgfs2.a
@@ -55,3 +53,5 @@
 
 clean:
 	rm -f *.o ${TARGET}
+
+.PHONY: all
Index: gfs2/mkfs/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/mkfs/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- gfs2/mkfs/Makefile	10 May 2007 15:47:45 -0000	1.16
+++ gfs2/mkfs/Makefile	15 May 2007 12:48:19 -0000
@@ -6,8 +6,9 @@
 include ../../make/defines.mk
 
 TARGET1= mkfs.gfs2
-TARGET2= gfs2_jadd
-TARGET3= gfs2_grow
+TARGET2= gfs2_mkfs
+TARGET3= gfs2_jadd
+TARGET4= gfs2_grow
 
 OBJS=	main.o \
 	main_mkfs.o \
@@ -23,28 +24,36 @@
 LDFLAGS += -L${volidlibdir} -lvolume_id
 LDFLAGS += -L../libgfs2 -lgfs2
 
-all: ${TARGET1} ${TARGET2} ${TARGET3}
+all: depends ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4}
 
 ${TARGET1}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
 
 ${TARGET2}: ${TARGET1}
-	ln -s ${TARGET1} ${TARGET2}
+	ln -sf ${TARGET1} ${TARGET2}
 
 ${TARGET3}: ${TARGET1}
-	ln -s ${TARGET1} ${TARGET3}
+	ln -sf ${TARGET1} ${TARGET3}
+
+${TARGET4}: ${TARGET1}
+	ln -sf ${TARGET1} ${TARGET4}
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs2 all
+
 install: all
 	install -m 0755 ${TARGET1} ${sbindir}
-	ln -f ${sbindir}/${TARGET1} ${sbindir}/${TARGET2}
-	ln -f ${sbindir}/${TARGET1} ${sbindir}/${TARGET3}
+	ln -sf ${sbindir}/${TARGET1} ${sbindir}/${TARGET2}
+	ln -sf ${sbindir}/${TARGET1} ${sbindir}/${TARGET3}
+	ln -sf ${sbindir}/${TARGET1} ${sbindir}/${TARGET4}
 
 uninstall:
-	${UNINSTALL} ${TARGET1} ${TARGET2} ${TARGET3} ${sbindir}
+	${UNINSTALL} ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${sbindir}
 
 clean:
-	rm -f *.o ${TARGET1} ${TARGET2} ${TARGET3}
+	rm -f *.o ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4}
 
+.PHONY: all ${TARGET1}
Index: gfs2/quota/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/quota/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- gfs2/quota/Makefile	3 May 2007 16:55:56 -0000	1.8
+++ gfs2/quota/Makefile	15 May 2007 12:48:19 -0000
@@ -24,9 +24,9 @@
 CFLAGS += -O2
 CFLAGS += -I../include -I../libgfs2/
 
-LDFLAGS += -L../libgfs2 -lgfs2 -lgfs2
+LDFLAGS += -L../libgfs2 -lgfs2
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -34,6 +34,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs2 all
+
 install: all
 	install -m 0755 ${TARGET} ${sbindir}
 
@@ -43,4 +46,4 @@
 clean:
 	rm -f *.o ${TARGET}
 
-
+.PHONY: all ${TARGET}
Index: gfs2/tool/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/tool/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- gfs2/tool/Makefile	3 May 2007 16:55:56 -0000	1.7
+++ gfs2/tool/Makefile	15 May 2007 12:48:19 -0000
@@ -31,7 +31,7 @@
 
 LDFLAGS += -L../libgfs2 -lgfs2
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -39,6 +39,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../libgfs2 all
+
 install: all
 	if [ ! -d ${sbindir} ]; then \
 		install -d ${sbindir}; \
@@ -49,9 +52,6 @@
 	${UNINSTALL} ${TARGET} ${sbindir}
 
 clean:
-	@rm -f ${TARGET} *.o *~
-
-distclean: clean
-	@rm -f *.d cscope.* *.orig *.rej
+	rm -f ${TARGET} *.o *~ *.d cscope.* *.orig *.rej
 
-.PHONY: all clean distclean
+.PHONY: all ${TARGET}
Index: group/dlm_controld/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/group/dlm_controld/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- group/dlm_controld/Makefile	30 Apr 2007 11:22:20 -0000	1.5
+++ group/dlm_controld/Makefile	15 May 2007 12:48:20 -0000
@@ -27,7 +27,7 @@
 LDFLAGS += -L${ccslibdir} -L${cmanlibdir} -lccs -lcman
 LDFLAGS += -L../lib -lgroup
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -35,6 +35,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../lib all
+
 install: all
 	install -d ${sbindir}
 	install ${TARGET} ${sbindir}
@@ -45,3 +48,4 @@
 clean:
 	rm -f *.o ${TARGET}
 
+.PHONY: all ${TARGET}
Index: group/gfs_controld/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/group/gfs_controld/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- group/gfs_controld/Makefile	30 Apr 2007 11:22:20 -0000	1.8
+++ group/gfs_controld/Makefile	15 May 2007 12:48:20 -0000
@@ -29,7 +29,7 @@
 LDFLAGS += -L${cmanlibdir} -L${openaislibdir} -L${libdir} -lcman -lcpg -lSaCkpt
 LDFLAGS += -L../lib -lgroup
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -38,6 +38,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../lib all
+
 install: all
 	install -d ${sbindir}
 	install ${TARGET} ${sbindir}
@@ -47,3 +50,5 @@
 
 clean:
 	rm -f *.o ${TARGET}
+
+.PHONY: all ${TARGET}
Index: group/tool/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/group/tool/Makefile,v
retrieving revision 1.8
diff -u -r1.8 Makefile
--- group/tool/Makefile	3 May 2007 16:55:59 -0000	1.8
+++ group/tool/Makefile	15 May 2007 12:48:20 -0000
@@ -20,7 +20,7 @@
 CFLAGS += -I. -I../lib/ -I../daemon/
 LDFLAGS += -L../lib -lgroup
 
-all: ${TARGET}
+all: depends ${TARGET}
 
 ${TARGET}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
@@ -28,6 +28,9 @@
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../lib all
+
 clean:
 	rm -f *.o ${TARGET}
 
@@ -37,3 +40,5 @@
 
 uninstall:
 	${UNINSTALL} ${TARGET} ${sbindir}
+
+.PHONY: all ${TARGET}
Index: rgmanager/src/daemons/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/daemons/Makefile,v
retrieving revision 1.20
diff -u -r1.20 Makefile
--- rgmanager/src/daemons/Makefile	3 May 2007 16:55:59 -0000	1.20
+++ rgmanager/src/daemons/Makefile	15 May 2007 12:48:23 -0000
@@ -66,7 +66,7 @@
 LOCAL_LDFLAGS += -llalloc
 READLINE_LDFLAGS += -L${readlinelibdir} -lreadline
 
-all: ${TARGET1} ${TARGET2} ${TARGET3}
+all: depends ${TARGET1} ${TARGET2} ${TARGET3}
 
 ${TARGET1}: ${OBJS1}
 	$(CC) -o $@ $^ $(LDFLAGS) $(CCS_LDFLAGS) $(CMAN_LDFLAGS) \
@@ -107,6 +107,9 @@
 %-noccs.o: %.c
 	$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $<
 
+depends:
+	$(MAKE) -C ../clulib all
+
 install: all
 	install -d ${sbindir}
 	install -m755 ${TARGET1} ${TARGET2} ${TARGET3} ${sbindir}
@@ -117,3 +120,5 @@
 clean:
 	rm -f *.o ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4}
 	rm -f tests/*.out*
+
+.PHONY: all ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4}
Index: rgmanager/src/utils/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/rgmanager/src/utils/Makefile,v
retrieving revision 1.15
diff -u -r1.15 Makefile
--- rgmanager/src/utils/Makefile	30 Apr 2007 11:22:23 -0000	1.15
+++ rgmanager/src/utils/Makefile	15 May 2007 12:48:24 -0000
@@ -12,8 +12,14 @@
 
 include ../../../make/defines.mk
 
-TARGETS=clubufflush clufindhostname clustat clusvcadm clulog clunfslock
-DISABLEDTARGETS=cluarp
+TARGET1= clubufflush
+TARGET2= clufindhostname
+TARGET3= clustat
+TARGET4= clusvcadm
+TARGET5= clulog
+TARGET6= clunfslock
+
+DISABLEDTARGETS= cluarp
 
 CFLAGS += -DPACKAGE_VERSION=\"${RELEASE}\"
 CFLAGS += -g -Werror -Wstrict-prototypes -Wshadow -fPIC -D_GNU_SOURCE
@@ -24,21 +30,41 @@
 LDFLAGS += -lcman -lpthread -ldl -lncurses -lccs
 LDFLAGS += -L../clulib -lclulib
 
-all: ${TARGETS}
+all: depends ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6}
+
+${TARGET1}: ${TARGET1:=.o}
+	$(CC) -o $@ $^ $(LDFLAGS)
+
+${TARGET2}: ${TARGET2:=.o}
+	$(CC) -o $@ $^ $(LDFLAGS)
+
+${TARGET3}: ${TARGET3:=.o}
+	$(CC) -o $@ $^ $(LDFLAGS)
 
-%: %.c
-	$(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
+${TARGET4}: ${TARGET4:=.o}
+	$(CC) -o $@ $^ $(LDFLAGS)
 
-clunfslock: clunfslock.sh
-	cp clunfslock.sh clunfslock
-	chmod 755 clunfslock
+${TARGET5}: ${TARGET5:=.o}
+	$(CC) -o $@ $^ $(LDFLAGS)
+
+${TARGET6}: ${TARGET6}.sh
+	cp ${TARGET6}.sh ${TARGET6}
+	chmod 755 ${TARGET6}
+
+%.o: %.c
+	$(CC) $(CFLAGS) -c -o $@ $<
+
+depends:
+	$(MAKE) -C ../clulib all
 
 install: all
 	install -d ${sbindir}
-	install $(TARGETS) ${sbindir}
+	install ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6} ${sbindir}
 
 uninstall:
-	${UNINSTALL} $(TARGETS) ${sbindir}
+	${UNINSTALL} ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6} ${sbindir}
 
 clean:
-	rm -f *.o $(TARGETS)
+	rm -f *.o ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6}
+
+.PHONY: all ${TARGET1} ${TARGET2} ${TARGET3} ${TARGET4} ${TARGET5} ${TARGET6}

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