# Directories building kernel modules should have two files:
#
# Makefile.in:
#
# MODULES := <module-name>
# <module-name>-objs := file1.o file2.o file3.o
# include /home/green/git/lustre-release/Rules
#
# and autoMakefile.am:
#
# if MODULES
# modulefs_DATA = <module-name>$(KMODEXT)
# endif
#
# DIST_SOURCES = $(<module-name>-objs:.o=.c) <other sources>
# MOSTLYCLEANFILES = *.o *.ko *.mod.c

ifeq ($(PATCHLEVEL),)

include autoMakefile

fix-kext-ownership:
	@if test -d $(DESTDIR)$(kextdir) ; then \
		echo chown -R root:wheel $(DESTDIR)$(kextdir) ; \
		chown -R root:wheel $(DESTDIR)$(kextdir) || \
			echo >&2 "*** WARNING: Could not fix kext ownership for $(DESTDIR)$(kextdir)" ; \
	fi

else

include /home/green/bk/linux-3.10.0-1160.59.1.el7-debug/.config

EXTRA_CFLAGS := $(EXTRA_PRE_CFLAGS)
EXTRA_CFLAGS += -include /home/green/git/lustre-release/undef.h -include /home/green/git/lustre-release/config.h  -g -I/home/green/git/lustre-release/libcfs/include -I/home/green/git/lustre-release/libcfs/include/libcfs -I/home/green/git/lustre-release/lnet/include/uapi -I/home/green/git/lustre-release/lnet/include -I/home/green/git/lustre-release/lustre/include/uapi -I/home/green/git/lustre-release/lustre/include -Wno-format-truncation -Wno-stringop-truncation -Wno-stringop-overflow -g -O2 -Wall -Werror
EXTRA_CFLAGS += $(EXTRA_POST_CFLAGS)

KBUILD_EXTRA_SYMBOLS +=  /usr/local/src/zfs-0.8.6/3.10.0-7.9-debug/Module.symvers

obj-m += $(patsubst %,%.o,$(MODULES))

endif # PATCHLEVEL
