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

include $(TOPDIR)/Preamble.make
else
# We are included by kbuild, and the is pre-"Kbuild"-files.

OUR_TOPDIR	:= $(M)/..

include $(OUR_TOPDIR)/Config.make

CPPFLAGS := -I$(OUR_TOPDIR)/include $(CPPFLAGS)
endif

ifdef BACKING_DEV_CAPABILITIES
EXTRA_CFLAGS += -DBACKING_DEV_CAPABILITIES
endif

ifdef HAVE_GENERIC_READLINK
EXTRA_CFLAGS += -DHAVE_GENERIC_READLINK
endif

ifdef NEW_FOLLOW_LINK_API
EXTRA_CFLAGS += -DNEW_FOLLOW_LINK_API
endif

INSTALL_MOD_DIR := fs/configfs

obj-m		:= configfs.o configfs_example.o bobtest.o
configfs-objs	:= inode.o file.o dir.o symlink.o mount.o item.o
		   
ifeq ($(KERNELRELEASE),)
#
# Called from a regular "make".
#

HEADERS = configfs_internal.h

CONFIGFS_SOURCES = 		\
	dir.c			\
	file.c			\
	inode.c			\
	item.c			\
	mount.c			\
	symlink.c

CONFIGFS_OBJECTS = $(subst .c,.o,$(CONFIGFS_SOURCES))

BOBTEST_SOURCES = bobtest.c
BOBTEST_OBJECTS = $(subst .c,.o,$(BOBTEST_SOURCES))

CONFIGFS_EXAMPLE_SOURCES = configfs_example.c
CONFIGFS_EXAMPLE_OBJECTS = $(subst .c,.o,$(CONFIGFS_EXAMPLE_SOURCES))

DOCS = configfs.txt

DIST_FILES =				\
	$(CONFIGFS_SOURCES)		\
	$(CONFIGFS_EXAMPLE_SOURCES)	\
	$(BOBTEST_SOURCES)		\
	$(HEADERS)			\
	$(DOCS)

ALL_RULES = 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
