Add Makefile to enable external build
[nbd-module.git] / Makefile
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..10f82f8
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,13 @@
+ifneq ($(KERNELRELEASE),)
+# kbuild part of makefile
+obj-m  := nbd.o
+
+else
+
+# normal makefile
+KDIR ?= /lib/modules/`uname -r`/build
+
+default:
+       $(MAKE) -C $(KDIR) M=$$PWD
+
+endif