
ifeq ($(KERNELRELEASE),)
TOPDIR = ../../..

include $(TOPDIR)/Preamble.make
else
# We are included by kbuild.

OUR_TOPDIR	:= $(M)/..

include $(OUR_TOPDIR)/Config.make
endif

ifdef MISSING_SOCK_CREATE_LITE
EXTRA_CFLAGS += -DMISSING_SOCK_CREATE_LITE
endif

ifdef IDR_GET_NEW_RETURNS_ID
EXTRA_CFLAGS += -DIDR_GET_NEW_RETURNS_ID
endif

ifdef INET_SK_RETURNS_INET_OPT
EXTRA_CFLAGS += -DINET_SK_RETURNS_INET_OPT
endif

SOURCES =			\
	heartbeat.c		\
	masklog.c		\
	net_proc.c		\
	nodemanager.c		\
	quorum.c		\
	tcp.c			\
	ver.c

HEADERS = 			\
	endian.h		\
	heartbeat.h		\
	masklog.h		\
	nodemanager.h		\
	ocfs2_heartbeat.h	\
	ocfs2_nodemanager.h	\
	quorum.h		\
	tcp.h			\
	tcp_internal.h		\
	ver.h

OBJECTS = $(subst .c,.o,$(SOURCES))
VERSION_FILES = $(SOURCES) $(HEADERS)
VERSION_SRC = ver.c
VERSION_PREFIX = CLUSTER

INSTALL_MOD_DIR := fs/ocfs2

obj-m := ocfs2_nodemanager.o

ocfs2_nodemanager-objs := $(OBJECTS)

ifneq ($(KERNELRELEASE),)
#
# Argh, Versioning.make has ordering requirements, so we put this here
#
STAMP_DIR	:= $(OUR_TOPDIR)/fs/ocfs2/cluster
include $(OUR_TOPDIR)/Versioning.make
CFLAGS_$(VERSION_OBJ) += $(VERDEFS)
endif

ifeq ($(KERNELRELEASE),)
#
# Called from a regular "make". Just forward to kbuild.
#

DIST_FILES = $(SOURCES) $(HEADERS)

ALL_RULES = stamp-md5 build-modules

CLEAN_RULES = clean-modules

INSTALL_RULES = install-modules

build-modules:
	$(MAKE) -C $(TOPDIR)/fs build-modules

install-modules:
	$(MAKE) -C $(TOPDIR)/fs install-modules

clean-modules:
	$(MAKE) -C $(TOPDIR)/fs clean-modules

include $(TOPDIR)/Postamble.make

endif
