[PVFS2-CVS] commit by pw in pvfs2/src/kernel/linux-2.6: Makefile.in

CVS commit program cvs at parl.clemson.edu
Wed Mar 10 15:35:01 EST 2004


Update of /projects/cvsroot/pvfs2/src/kernel/linux-2.6
In directory parlweb:/tmp/cvs-serv32003/src/kernel/linux-2.6

Modified Files:
	Makefile.in 
Log Message:

- Kernel module builds:
    - build the module with everything else, if configured
    - clean up properly
    - work out-of-tree


Index: Makefile.in
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/Makefile.in,v
diff -u -p -u -r1.7 -r1.8
--- Makefile.in	13 Jan 2004 14:43:26 -0000	1.7
+++ Makefile.in	10 Mar 2004 20:35:01 -0000	1.8
@@ -1,27 +1,92 @@
-ifneq ($(KERNELRELEASE),)
+#
+# Special Makefile for building kernel module.  Invoked both by user and
+# by kernel build process.
+#
+here = src/kernel/linux-2.6
+top = ../../..
+relative_src_dir = $(top)/@SRC_RELATIVE_TOP@
+absolute_src_dir = @SRC_ABSOLUTE_TOP@
+ifndef V
+  QUIET_COMPILE = @QUIET_COMPILE@
+endif
+
+csrc = \
+    pvfs2-utils.c \
+    devpvfs2-req.c \
+    pvfs2-cache.c \
+    dcache.c \
+    file.c \
+    inode.c \
+    dir.c \
+    namei.c \
+    super.c \
+    pvfs2-mod.c \
+    pvfs2-bufmap.c \
+    symlink.c \
+    waitqueue.c
+hsrc = \
+    pvfs2-kernel.h \
+    pvfs2-dev-proto.h \
+    pvfs2-bufmap.h \
+    upcall.h \
+    downcall.h
+
+objs = $(csrc:.c=.o)
+othergen = pvfs2.o pvfs2.ko pvfs2.mod.c pvfs2.mod.o
+cmds = $(patsubst %,.%.cmd,$(objs) $(othergen))
 
-PVFS2_SRC_DIR = @BUILD_TOP_LEVEL@
+ifneq ($(KERNELRELEASE),)
 
-EXTRA_CFLAGS = -I$(PVFS2_SRC_DIR) -I$(PVFS2_SRC_DIR)/src/io/description/ -I$(PVFS2_SRC_DIR)/src/io/dev/ -I$(PVFS2_SRC_DIR)/include/ -I$(PVFS2_SRC_DIR)/src/client/sysint/ -I$(PVFS2_SRC_DIR)/src/common/quicklist/ -I$(PVFS2_SRC_DIR)/src/common/quickhash/
+EXTRA_CFLAGS = \
+    -I$(absolute_src_dir)/include \
+    -I$(absolute_src_dir)/src/io/dev \
+    -I$(absolute_src_dir)/src/common/quickhash
 
 # uncomment the following line for kernel specific
 # debugging output or features
 #EXTRA_CFLAGS += -DPVFS2_KERNEL_DEBUG
 
 obj-m += pvfs2.o
-
-pvfs2-objs := pvfs2.mod.o pvfs2-utils.o waitqueue.o devpvfs2-req.o \
-pvfs2-cache.o dcache.o file.o inode.o dir.o namei.o \
-super.o pvfs2-mod.o pvfs2-bufmap.o symlink.o
+pvfs2-objs := $(objs)
 
 else
+
 #KDIR	:= /lib/modules/$(shell uname -r)/build
 #KDIR	:= /usr/src/linux-$(shell uname -r)
 KDIR    := @LINUX_KERNEL_SRC@
 PWD	:= $(shell pwd)
 
-default:
-	touch $(PWD)/pvfs2.mod.c
+default: links
+ifdef QUIET_COMPILE
+	@$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+else
 	$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
+endif
+
+# link to real source directory if out-of-tree build
+links:
+	@for i in $(csrc) $(hsrc); do \
+	    if [[ ! -f $$i  &&  ! -L $$i ]] ; then \
+		ln -s $(relative_src_dir)/$(here)/$$i ;\
+	    fi ;\
+	done
+
+clean:
+ifdef QUIET_COMPILE
+	@for i in $(csrc) $(hsrc); do \
+	    if [[ -L $$i ]] ; then \
+		rm -f $$i ;\
+	    fi ;\
+	done
+	@rm -f $(objs) $(othergen) $(cmds)
+else
+	for i in $(csrc) $(hsrc); do \
+	    if [[ -L $$i ]] ; then \
+		rm -f $$i ;\
+	    fi ;\
+	done
+	rm -f $(objs) $(othergen) $(cmds)
+endif
+
 endif
 



More information about the PVFS2-CVS mailing list