[sheepdog] [PATCH RFC 2/2] sheepdev: add kbuild and Makefile.in

levin li levin108 at gmail.com
Thu Dec 27 15:00:42 CET 2012


From: levin li <xingke.lwp at taobao.com>


Signed-off-by: levin li <xingke.lwp at taobao.com>
---
 Makefile.am          |  4 ++++
 configure.ac         |  9 +++++++++
 sheepdev/Kbuild      | 12 ++++++++++++
 sheepdev/Makefile.in |  8 ++++++++
 4 files changed, 33 insertions(+)
 create mode 100644 sheepdev/Kbuild
 create mode 100644 sheepdev/Makefile.in

diff --git a/Makefile.am b/Makefile.am
index 53d18b9..4db40bf 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -23,6 +23,10 @@ if BUILD_SHEEPFS
 SUBDIRS			+= sheepfs
 endif
 
+if BUILD_SHEEPDEV
+SUBDIRS                 += sheepdev
+endif
+
 install-exec-local:
 	$(INSTALL) -d $(DESTDIR)/${localstatedir}/lib/sheepdog
 
diff --git a/configure.ac b/configure.ac
index 9e03e23..0bc8d2e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -130,6 +130,7 @@ AC_CONFIG_FILES([Makefile
 		collie/Makefile
 		sheep/Makefile
 		sheepfs/Makefile
+		sheepdev/Makefile
 		include/Makefile
 		script/Makefile
 		lib/Makefile
@@ -213,6 +214,11 @@ AC_ARG_ENABLE([sheepfs],
 	[ enable_sheepfs=$HAVE_FUSE ],)
 AM_CONDITIONAL(BUILD_SHEEPFS, test x$enable_sheepfs = xyes)
 
+AC_ARG_ENABLE([sheepdev],
+	[  --enable-sheepdev        : enable sheepdev],,
+	[ enable_sheepdev="no" ],)
+AM_CONDITIONAL(BUILD_SHEEPDEV, test x$enable_sheepdev = xyes)
+
 CP=cp
 OS_LDL="-ldl"
 case "$host_os" in
@@ -296,6 +302,9 @@ if test "x${enable_sheepfs}" = xyes; then
 	PACKAGE_FEATURES="$PACKAGE_FEATURES sheepfs"
 fi
 
+if test "x${enable_sheepdev}" = xyes; then
+	PACKAGE_FEATURES="$PACKAGE_FEATURES sheepdev"
+fi
 
 # extra warnings
 EXTRA_WARNINGS=""
diff --git a/sheepdev/Kbuild b/sheepdev/Kbuild
new file mode 100644
index 0000000..5706d7e
--- /dev/null
+++ b/sheepdev/Kbuild
@@ -0,0 +1,12 @@
+
+MODULE_NAME=sheepdev
+
+EXTRA_CFLAGS := -I$(PWD)/../include
+
+obj-m := $(MODULE_NAME).o
+
+sheepdev-objs := module.o sheep.o connect.o
+
+module.o : sheep.h sheepdog_proto.h
+sheep.o : sheep.h sheepdog_proto.h
+connect.o : sheep.h
diff --git a/sheepdev/Makefile.in b/sheepdev/Makefile.in
new file mode 100644
index 0000000..c5fcf4a
--- /dev/null
+++ b/sheepdev/Makefile.in
@@ -0,0 +1,8 @@
+all:
+	$(MAKE) -C /lib/modules/`uname -r`/build M=`pwd` modules
+
+clean:
+	$(MAKE) -C /lib/modules/`uname -r`/build M=`pwd` clean
+
+install:
+	$(MAKE) -C /lib/modules/`uname -r`/build M=`pwd` modules_install
-- 
1.7.11.7




More information about the sheepdog mailing list