[Cluster-devel] cluster/gfs2/tool Makefile util.c

adas at sourceware.org adas at sourceware.org
Thu Jun 15 16:40:49 UTC 2006


CVSROOT:	/cvs/cluster
Module name:	cluster
Changes by:	adas at sourceware.org	2006-06-15 16:40:48

Modified files:
	gfs2/tool      : Makefile util.c 

Log message:
	Edited Makefile to look more like other makefiles, dependent on objects rather than sources, etc. Removed reference to asm/page.h (for PAGE_SIZE) from util.c. Wasn't compiling on x86_64. Instead made PAGE_SIZE a #define

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/tool/Makefile.diff?cvsroot=cluster&r1=1.3&r2=1.4
http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/gfs2/tool/util.c.diff?cvsroot=cluster&r1=1.4&r2=1.5

--- cluster/gfs2/tool/Makefile	2006/05/05 18:06:09	1.3
+++ cluster/gfs2/tool/Makefile	2006/06/15 16:40:48	1.4
@@ -11,22 +11,8 @@
 ###############################################################################
 ###############################################################################
 top_srcdir= ..
-include ${top_srcdir}/make/defines.mk
-
-TARGET= gfs2_tool
-
-SOURCE=	counters.c \
-	df.c \
-	layout.c \
-	main.c \
-	misc.c \
-	ondisk.c \
-	sb.c \
-	tune.c \
-	util.c
 
-CFLAGS+= -O2 -Wall -D_FILE_OFFSET_BITS=64 \
-	-DGFS2_RELEASE_NAME=\"${RELEASE}\"
+include ${top_srcdir}/make/defines.mk
 
 INCLUDE= -I${top_srcdir}/include -I${top_srcdir}/config -I${gfs2kincdir}
 
@@ -40,15 +26,31 @@
 INCLUDE += -I${incdir}
 endif
 
+LIBS=-L${top_srcdir}/libgfs2
+
+.PHONY: all clean copytobin distclean
+
+SOURCES= counters.c df.c layout.c main.c misc.c ondisk.c sb.c tune.c util.c
+
+OBJECTS=$(subst .c,.o,${SOURCES})
+
+TARGET= gfs2_tool
+
+CFLAGS+= -O2 -Wall -D_FILE_OFFSET_BITS=64 -DGFS2_RELEASE_NAME=\"${RELEASE}\"
+
 all: ${TARGET}
 
-gfs2_tool: ${SOURCE}
-	${CC} ${CFLAGS} ${INCLUDE} ${LDFLAGS} ${SOURCE} ${LOADLIBES} ${LDLIBS} -o $@ -L../libgfs2/ -lgfs2
+gfs2_tool: ${OBJECTS} ../libgfs2/libgfs2.a
+	$(CC) $(CFLAGS) $(LIBS) $^ -o $@ -lgfs2
+
+%.o: %.c
+	$(CC) -c $(INCLUDE) $(CFLAGS) $< -o $@
 
 copytobin: ${TARGET}
 	cp ${TARGET} ${top_srcdir}/bin
 
 clean:
-	rm -f *.o ${TARGET}
-
+	@rm -f ${TARGET} *.o *~
 
+distclean: clean
+	@rm -f *.d cscope.* *.orig *.rej
--- cluster/gfs2/tool/util.c	2006/05/05 18:06:09	1.4
+++ cluster/gfs2/tool/util.c	2006/06/15 16:40:48	1.5
@@ -27,13 +27,14 @@
 #include <libgen.h>
 #include <dirent.h>
 #include <string.h>
-#include <asm/page.h>
 
 #define __user
 #include <linux/gfs2_ondisk.h>
 
 #include "gfs2_tool.h"
 
+#define PAGE_SIZE (4096)
+
 static char sysfs_buf[PAGE_SIZE];
 
 char *__get_sysfs(char *fsname, char *filename)




More information about the Cluster-devel mailing list