* [Cluster-devel] cluster/gfs2/tool Makefile util.c
@ 2006-06-15 16:40 adas
2006-06-17 9:28 ` Fabio Massimo Di Nitto
0 siblings, 1 reply; 2+ messages in thread
From: adas @ 2006-06-15 16:40 UTC (permalink / raw)
To: cluster-devel.redhat.com
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)
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Cluster-devel] cluster/gfs2/tool Makefile util.c
2006-06-15 16:40 [Cluster-devel] cluster/gfs2/tool Makefile util.c adas
@ 2006-06-17 9:28 ` Fabio Massimo Di Nitto
0 siblings, 0 replies; 2+ messages in thread
From: Fabio Massimo Di Nitto @ 2006-06-17 9:28 UTC (permalink / raw)
To: cluster-devel.redhat.com
> --- 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)
I am afraid this change will make portability a problem. Quite a bunch of
architectures have different PAGE_SIZE. Perhaps it's worth to dig on why it
doesn't build on x86_64 instead?
Thanks
Fabio
--
I'm going to make him an offer he can't refuse.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-06-17 9:28 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-15 16:40 [Cluster-devel] cluster/gfs2/tool Makefile util.c adas
2006-06-17 9:28 ` Fabio Massimo Di Nitto
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.