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

[Cluster-devel] Re: Problems with recent Makefile changes



Hi Robert,

Robert Peterson wrote:
> Hi Fabio,
> 
> I did find a couple problems with your new changes to the Makefiles
> for cluster suite.  The first problem is that the gfs2 userland tools
> don't have a dependency set for ../libgfs2/libgfs2.a.  So if you
> change a function in libgfs2 and recompile, the userland tools never
> know to link in the modified libgfs2.a library.

could you be so kind to test the patch in attachment and see if it fulfill your
needs in this respect?

the patch is against CVS HEAD and only gfs2/. I still plan to do all the other
subprojects, but I would like comments first on this one.

Thanks
Fabio

-- 
I'm going to make him an offer he can't refuse.
Index: convert/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/convert/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- convert/Makefile	30 Apr 2007 11:22:16 -0000	1.6
+++ convert/Makefile	3 May 2007 07:43:26 -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: edit/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/edit/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- edit/Makefile	30 Apr 2007 11:22:16 -0000	1.5
+++ edit/Makefile	3 May 2007 07:43:26 -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: fsck/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/fsck/Makefile,v
retrieving revision 1.9
diff -u -r1.9 Makefile
--- fsck/Makefile	1 May 2007 16:43:38 -0000	1.9
+++ fsck/Makefile	3 May 2007 07:43:26 -0000
@@ -14,11 +14,24 @@
 
 TARGET= gfs2_fsck
 
-.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=	main.o \
+	initialize.o \
+	pass1.o \
+	pass1b.o \
+	pass1c.o \
+	pass2.o \
+	pass3.o \
+	pass4.o \
+	pass5.o \
+	util.o \
+	fs_recovery.o \
+	lost_n_found.o \
+	link.o \
+	eattr.o \
+	hash.o \
+	inode_hash.o \
+	metawalk.o \
+	rgrepair.o
 
 CFLAGS += -D_FILE_OFFSET_BITS=64 -DHELPER_PROGRAM -DGFS_RELEASE_NAME=\"${RELEASE}\"
 CFLAGS += -MMD -Wall -O2
@@ -27,14 +40,17 @@
 
 LDFLAGS += -L../libgfs2 -lgfs2
 
-all: ${TARGET}
+all: depends ${TARGET}
 
-${TARGET}: $(sources:.c=.o)
+${TARGET}: $(OBJS)
 	$(CC) -o $@ $^ $(LDFLAGS)
 
 %.o: %.c
 	$(CC) $(CFLAGS) -c -o $@ $^
 
+depends:
+	$(MAKE) -C ../libgfs2 all
+
 test_block_list: log.o test_block_list.o
 	$(CC) -o $@ $^ $(LDFLAGS)
 
@@ -42,7 +58,7 @@
 	$(CC) -o $@ $^ $(LDFLAGS)
 
 clean:
-	@rm -f gfs2_fsck *.o *~ *.d
+	rm -f ${TARGET} test_block_list test_bitmap *.o *~ *.d
 
 install: all
 	if [ ! -d ${sbindir} ]; then \
@@ -53,12 +69,11 @@
 uninstall:
 	${UNINSTALL} ${TARGET} ${sbindir}
 
-distclean: clean
-	@rm -f cscope.* test_inode_list *.orig *.rej test_block_list test_bitmap
-
-gfs2_fsck.pot: $(sources)
+gfs2_fsck.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	
 
--include $(sources:.c=.d)
+-include $(OBJS:.o=.d)
+
+.PHONY: all ${TARGET} test_block_list test_bitmap
Index: libgfs2/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/libgfs2/Makefile,v
retrieving revision 1.5
diff -u -r1.5 Makefile
--- libgfs2/Makefile	30 Apr 2007 11:22:16 -0000	1.5
+++ libgfs2/Makefile	3 May 2007 07:43:26 -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: mkfs/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/mkfs/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- mkfs/Makefile	30 Apr 2007 11:22:16 -0000	1.14
+++ mkfs/Makefile	3 May 2007 07:43:26 -0000
@@ -1,7 +1,6 @@
 #
 # Makefile for GFS2 mkfs
 #
-.PHONY: all clean install
 
 include ../../make/defines.mk
 
@@ -21,20 +20,23 @@
 LDFLAGS += -L${volidlibdir} -lvolume_id
 LDFLAGS += -L../libgfs2 -lgfs2
 
-all: ${TARGET1} ${TARGET2}
+all: depends ${TARGET1} ${TARGET2}
 
 ${TARGET1}: ${OBJS}
 	$(CC) -o $@ $^ $(LDFLAGS)
 
 ${TARGET2}: ${TARGET1}
-	ln -s ${TARGET1} ${TARGET2}
+	ln -sf ${TARGET1} ${TARGET2}
 
 %.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 -sf ${sbindir}/${TARGET1} ${sbindir}/${TARGET2}
 
 uninstall:
 	${UNINSTALL} ${TARGET1} ${TARGET2} ${sbindir}
@@ -42,3 +44,4 @@
 clean:
 	rm -f *.o ${TARGET1} ${TARGET2}
 
+.PHONY: all ${TARGET1} ${TARGET2}
Index: quota/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/quota/Makefile,v
retrieving revision 1.7
diff -u -r1.7 Makefile
--- quota/Makefile	30 Apr 2007 11:22:17 -0000	1.7
+++ quota/Makefile	3 May 2007 07:43:26 -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: tool/Makefile
===================================================================
RCS file: /cvs/cluster/cluster/gfs2/tool/Makefile,v
retrieving revision 1.6
diff -u -r1.6 Makefile
--- tool/Makefile	30 Apr 2007 11:22:17 -0000	1.6
+++ tool/Makefile	3 May 2007 07:43:26 -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 *~
 
-.PHONY: all clean distclean
+.PHONY: all ${TARGET}

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