Out of tree builds use local include file
authorAlex Bligh <alex@alex.org.uk>
Wed, 18 May 2011 07:42:57 +0000 (08:42 +0100)
committerAlex Bligh <alex@alex.org.uk>
Wed, 18 May 2011 07:42:57 +0000 (08:42 +0100)
Makefile
nbd.c

index 10f82f8..f4e3cd8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
 ifneq ($(KERNELRELEASE),)
 # kbuild part of makefile
-obj-m  := nbd.o
+obj-m := nbd.o
+ccflags-y := -DNBD_OUTOFTREE
 
 else
 
diff --git a/nbd.c b/nbd.c
index e6fc716..0eeed20 100644 (file)
--- a/nbd.c
+++ b/nbd.c
 #include <asm/system.h>
 #include <asm/types.h>
 
+#ifdef NBD_OUTOFTREE
+#include "nbd.h"
+#else
 #include <linux/nbd.h>
+#endif
 
 #define LO_MAGIC 0x68797548