[Ocfs2-commits] jlbec commits r1798 - in trunk: cluster src usysfs

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Thu Jan 20 03:12:46 CST 2005


Author: jlbec
Date: 2005-01-20 03:12:44 -0600 (Thu, 20 Jan 2005)
New Revision: 1798

Modified:
   trunk/cluster/Makefile
   trunk/src/Makefile
   trunk/usysfs/Kbuild
Log:

o Migrate src/Makefile to Kbuild-24.make.  Yay!



Modified: trunk/cluster/Makefile
===================================================================
--- trunk/cluster/Makefile	2005-01-20 08:37:31 UTC (rev 1797)
+++ trunk/cluster/Makefile	2005-01-20 09:12:44 UTC (rev 1798)
@@ -10,8 +10,6 @@
 
 include $(OUR_SRC_DIR)/../Config.make
 
-STAMP_DIR = $(OUR_SRC_DIR)
-
 endif
 
 ifdef HAVE_NPTL

Modified: trunk/src/Makefile
===================================================================
--- trunk/src/Makefile	2005-01-20 08:37:31 UTC (rev 1797)
+++ trunk/src/Makefile	2005-01-20 09:12:44 UTC (rev 1798)
@@ -1,94 +1,92 @@
-# See if we are being included by the 2.6 kernel build system.
+
 ifeq ($(KERNELRELEASE),)
-# Normal build that is being called locally
 TOPDIR = ..
 
 include $(TOPDIR)/Preamble.make
+else
+# We are included by kbuild.
 
-else # ifeq ($(KERNELRELEASE),)
-# We are being included by the 2.6.x kernel build system
+OUR_SRC_DIR	:= $(M)
 
-# Global parameter so we know where our stuff is
-OCFS_SRC_DIR	:= $(M)
+include $(OUR_SRC_DIR)/../Config.make
 
-include $(OCFS_SRC_DIR)/../Config.make
+CLUSTERINC := $(OUR_SRC_DIR)/..
+EXTRA_CFLAGS += -I$(CLUSTERINC)
+
 endif
 
-#-*******************************************************
-# Now do stuff which is global for 2.4.x and 2.6.x builds
-
 ifdef OCFS_DEBUG
-OPTS += -g
+MODULE_CFLAGS += -g
+MODULE_DEFINES += -DDEBUG
 endif
 
-GLOBAL_DEFINES = 
-GLOBAL_DEFINES += -DCATCH_BH_JBD_RACES
+MODULE_DEFINES += -DCATCH_BH_JBD_RACES
 
-ifdef OCFS_DEBUG
-GLOBAL_DEFINES += -DDEBUG
+ifdef HAVE_NPTL
+MODULE_DEFINES += -DHAVE_NPTL
 endif
 
 ifdef OCFS_AIO
 ifeq ($(KERNELRELEASE),)
-GLOBAL_DEFINES += -DAIO_ENABLED
+MODULE_DEFINES += -DAIO_ENABLED
 else
-GLOBAL_DEFINES += -DAIO_26_ENABLED
+MODULE_DEFINES += -DAIO_26_ENABLED
 endif
 endif
 
 ifdef OCFS_TRACE
-GLOBAL_DEFINES += -DTRACE
+MODULE_DEFINES += -DTRACE
 endif
 
-ifdef HAVE_NPTL
-GLOBAL_DEFINES += -DHAVE_NPTL
-endif
-
 ifdef COMPAT_SAFE_WRITE
-GLOBAL_DEFINES += -DOCFS_COMPAT_SAFE_WRITE
+MODULE_DEFINES += -DOCFS_COMPAT_SAFE_WRITE
 endif
 
 ifneq ($(QUIET),1)
-GLOBAL_DEFINES += -DVERBOSE_BH_JBD_TRACE
-GLOBAL_DEFINES += -DVERBOSE_LOCKING_TRACE
-GLOBAL_DEFINES += -DVERBOSE_BH_SEQNUM_TRACE
-GLOBAL_DEFINES += -DVERBOSE_PROCESS_VOTE
-GLOBAL_DEFINES += -DVERBOSE_COMMIT_THREAD
-
-ifneq ($(OCFS_PROCESSOR),ia64)
-#GLOBAL_DEFINES += -DOCFS_DBG_TIMING
+MODULE_DEFINES += -DVERBOSE_BH_JBD_TRACE
+MODULE_DEFINES += -DVERBOSE_LOCKING_TRACE
+MODULE_DEFINES += -DVERBOSE_BH_SEQNUM_TRACE
+MODULE_DEFINES += -DVERBOSE_PROCESS_VOTE
+MODULE_DEFINES += -DVERBOSE_COMMIT_THREAD
 endif
 
-endif
+EXTRA_CFLAGS += $(MODULE_CFLAGS) $(MODULE_DEFINES)
 
-CFILES = \
+
+#
+# For OCFS2, SOURCES+HEADERS live even in kbuild-26 because they
+# are needed for VERSION_FILES
+#
+
+SOURCES =			\
 	24io.c			\
-	alloc.c			\
-	aops.c			\
+	alloc.c 		\
+	aops.c 			\
 	buffer_head_io.c	\
-	dcache.c		\
-	dir.c			\
-	dlmglue.c		\
-	extent_map.c		\
-	file.c			\
-	heartbeat.c		\
-	inode.c			\
-	ioctl.c			\
-	journal.c		\
-	localalloc.c		\
-	mmap.c			\
-	namei.c			\
-	ocfs_compat.c		\
-	proc.c			\
-	slot_map.c		\
-	suballoc.c		\
-	super.c			\
-	symlink.c		\
-	sysfile.c		\
-	util.c			\
-	ver.c			\
+	dcache.c 		\
+	dir.c 			\
+	dlmglue.c 		\
+	extent_map.c 		\
+	file.c 			\
+	heartbeat.c 		\
+	inode.c 		\
+	ioctl.c 		\
+	journal.c 		\
+	localalloc.c 		\
+	mmap.c 			\
+	namei.c 		\
+	ocfs_compat.c 		\
+	proc.c 			\
+	slot_map.c 		\
+	suballoc.c 		\
+	super.c 		\
+	symlink.c 		\
+	sysfile.c 		\
+	util.c 			\
+	ver.c 			\
 	vote.c
-HFILES = \
+
+HEADERS = 			\
 	ocfs2_fs.h		\
 	ocfs1_fs_compat.h	\
 	ocfs.h			\
@@ -118,163 +116,64 @@
 	util.h			\
 	ver.h			\
 	vote.h
-VERSION_FILES = $(CFILES) $(HFILES)
+
+OBJECTS = $(subst .c,.o,$(SOURCES))
+VERSION_FILES = $(SOURCES) $(HEADERS)
 VERSION_SRC = ver.c
 VERSION_PREFIX = OCFS
 
-CLEAN_RULES = clean-ocfs
+obj-m := ocfs2.o
 
-OBJS = $(subst .c,.o,$(CFILES))
+ocfs2-objs := $(OBJECTS)
 
-# End of stuff which is global for 2.4.x and 2.6.x kernels
-#-********************************************************
+ifneq ($(KERNELRELEASE),)
+#
+# Argh, Versioning.make has ordering requirements, so we put this here
+#
+STAMP_DIR = $(OUR_SRC_DIR)
+include $(OUR_SRC_DIR)/../Versioning.make
+CFLAGS_$(VERSION_OBJ) += $(VERDEFS)
+endif
 
-# See if we are being included by the 2.6 kernel build system.
 ifeq ($(KERNELRELEASE),)
-# Normal build that is being called locally
-# Preliminary 2.6.x kernel support.  See if we are building for the 2.6.x
-# kernel
-ifndef KERNEL_26
-# Building for a 2.4.x kernel
+#
+# Called from a regular "make".
+#
 
-WARNINGS = -Wall -Wstrict-prototypes
+DIST_FILES = $(SOURCES) $(HEADERS)
 
-ifneq ($(OCFS_PROCESSOR),x86_64)
-WARNINGS += -Wmissing-prototypes -Wmissing-declarations
-endif
+ALL_RULES = build-modules
 
-ifeq ($(KVER),vmware)
-  KERNELINC = /usr/src/linux-2.4/include
-endif
+CLEAN_RULES = clean-modules
 
-ifeq ($(KVER),suse)
-  GLOBAL_DEFINES += -DSUSE
-endif
-ifeq ($(KVER),hugemem)
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_HUGEMEM=1
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_SMP=0
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_UP=0
-endif
-ifeq ($(KVER),smp)
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0 
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_SMP=1 
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_UP=0 
-endif
-ifeq ($(KVER),ent)
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_ENTERPRISE=1 
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_SMP=0 
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_UP=0 
-endif
-ifeq ($(KVER),up)
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_HUGEMEM=0
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_ENTERPRISE=0 
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_SMP=0 
-  GLOBAL_DEFINES += -D__BOOT_KERNEL_UP=1 
-endif
+INSTALL_RULES = install-modules
 
-ifeq ($(OCFS_PROCESSOR),ppc64)
-  MACH_CFLAGS += -m64 -fsigned-char -fno-builtin -msoft-float -mminimal-toc
-  MACH_LDADD += -m elf64ppc
-endif
-ifeq ($(OCFS_PROCESSOR),x86_64)
-  MACH_CFLAGS += -m64 -mcmodel=kernel
-endif
-ifeq ($(OCFS_PROCESSOR),s390x)
-  MACH_CFLAGS += -fno-strength-reduce -fpic
-  MACH_LDADD += -m elf64_s390
-endif
 
-BASE_DEFINES = -DMODULE -DLINUX -D__KERNEL__ 
-DEFINES += $(BASE_DEFINES) $(GLOBAL_DEFINES)
+ifneq ($(KERNEL_26),)
+#
+# This is a 2.6 kernel. Just forward to kbuild.
+#
 
-INCLUDES = -I. -I$(TOPDIR) -I$(KERNELINC) -I$(GCCINC)
-
-CFLAGS = $(OPTS) $(MACH_CFLAGS) -pipe -nostdinc -fno-strict-aliasing \
-	-fno-common -fomit-frame-pointer $(MODVERSIONS) $(WARNINGS)
-LDADD = $(MACH_LDADD) -nostdlib
-
-OPTIMIZE = -O2
-
-CFLAGS += $(OPTIMIZE)
-
-MODULES = ocfs2.o
-
-INSTALL_MODULE = $(MODULES)
-
-# Make dependancies work
-$(CFILES): $(HFILES)
-$(OBJS): $(HFILES)
-
-ocfs2.o: $(OBJS)
-	$(CC) $(OPTS) -Wl,-r -o $@ $^ $(LDADD)
-
-clean-ocfs:
-	rm -f *.o *.p *.s
-
-
-else # ifndef KERNEL_26
-# The 2.6.x kernel makefile
-
-# This Makefile has two ways through it.  They are:
-#   1.	We are being included by the local Makefile to do a 2.6 kernel build.
-#	In this method we will call the kernel make system to build our module.
-#	This will cause the kernel make system to call back into our makefile
-#	(2nd way).
-
-INSTALL_MODULE = ocfs2.ko
-
-ALL_RULES = stamp-md5 build-ocfs
-
-build-ocfs:
+build-modules:
 	$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules
 
-clean-ocfs:
+install-modules:
+	$(MAKE) -C $(KERNELDIR) M=$(CURDIR) modules_install
+
+clean-modules:
 	$(MAKE) -C $(KERNELDIR) M=$(CURDIR) clean
+else
+#
+# This is a 2.4 kernel.  Because Red Hat's source tree is whack, do
+# everything by hand.
+#
 
-endif # OCFS_KERNEL_2_6
+INSTALL_DIR = ocfs2
 
-INSTALL_RULES = install-ocfs
+include $(TOPDIR)/Kbuild-24.make
 
-install-ocfs: $(INSTALL_MODULE)
-	$(TOPDIR)/mkinstalldirs $(DESTDIR)$(MODULEDIR)/ocfs2
-	$(INSTALL_DATA) $< $(DESTDIR)$(MODULEDIR)/ocfs2/$<
+endif
 
 include $(TOPDIR)/Postamble.make
 
-else # ifeq ($(KERNELRELEASE),)
-# We are being included by the 2.6 kernel build system.  So we will include the
-# 2.6.x Makefile and skip everything else.
-# The 2.6.x kernel makefile
-
-# This Makefile has two ways through it.  They are:
-#   1.	We are being included by the local Makefile to do a 2.6 kernel build.
-#	In this method we will call the kernel make system to build our module.
-#	This will cause the kernel make system to call back into our makefile
-#	(2nd way).
-#
-#   2.	We are being included by the kernel make system.  So in this method we
-#	just setup the variables that the make system wants and then the kernel
-#	make system will take care of the build.
-
-# 2nd method.  The kernel make system is including us.  We need to setup the
-# various parameters for the kernel make system and then it will take care of
-# building us.
-
-STAMP_DIR = $(OCFS_SRC_DIR)
-include $(OCFS_SRC_DIR)/../Versioning.make
-
-CLUSTERINC := $(OCFS_SRC_DIR)/..
-EXTRA_CFLAGS += $(GLOBAL_DEFINES) -I$(CLUSTERINC)
-
-CFLAGS_$(VERSION_OBJ) += $(VERDEFS)
-
-# Kernel Module file to produce
-obj-m += ocfs2.o
-
-# list of object files that are used to create our module
-ocfs2-objs := $(OBJS)
-
-endif # ifneq ($(KERNELRELEASE),)
+endif

Modified: trunk/usysfs/Kbuild
===================================================================
--- trunk/usysfs/Kbuild	2005-01-20 08:37:31 UTC (rev 1797)
+++ trunk/usysfs/Kbuild	2005-01-20 09:12:44 UTC (rev 1798)
@@ -2,8 +2,6 @@
 # Makefile for the usysfs virtual filesystem
 #
 
-STAMP_DIR := $(M)
-
 obj-m		:= usysfs.o bobtest.o
 usysfs-objs	:= inode.o file.o dir.o symlink.o mount.o bin.o
 		   



More information about the Ocfs2-commits mailing list