Whamcloud - gitweb
blah blah blah
[fs/lustre-release.git] / build / Makefile
diff --git a/build/Makefile b/build/Makefile
new file mode 100644 (file)
index 0000000..db3bd45
--- /dev/null
@@ -0,0 +1,47 @@
+#
+# There are three ways this Makefile can be called:
+#
+# 
+# 1.  As a subdirectory from the toplevel, for automake
+#
+# 2. A wrapper around the kernel's makefile when building modules, to
+#    possibly override the .config file
+#
+# 3.  At configure time, as the toplevel module dir for building
+#     kernel tests
+#
+
+ifeq ($(PATCHLEVEL),)
+
+ifeq ($(LUSTRE_LINUX_CONFIG),)
+
+# case #1
+include autoMakefile
+
+else
+
+# case #2
+include $(LUSTRE_LINUX_CONFIG)
+include Makefile
+
+endif # LUSTRE_LINUX_CONFIG
+
+else # PATCHLEVEL
+
+# case 3
+
+ifneq ($(LUSTRE_KERNEL_TEST),)
+ifeq ($(PATCHLEVEL),4)
+all: $(LUSTRE_KERNEL_TEST)
+else
+extra-y = $(LUSTRE_KERNEL_TEST)
+endif
+endif
+
+obj-m := conftest.o
+
+ifeq ($(PATCHLEVEL),4)
+include $(TOPDIR)/Rules.make
+endif
+
+endif # PATCHLEVEL