[sheepdog] [PATCH v2 4/4] sheepdev: add kbuild and Makefile.in
levin li
levin108 at gmail.com
Mon Jan 7 07:42:48 CET 2013
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 | 13 +++++++++++++
sheepdev/Makefile.in | 8 ++++++++
4 files changed, 34 insertions(+), 0 deletions(-)
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..f1f9dd4
--- /dev/null
+++ b/sheepdev/Kbuild
@@ -0,0 +1,13 @@
+
+MODULE_NAME=sheepdev
+
+EXTRA_CFLAGS := -I$(PWD)/../include
+
+obj-m := $(MODULE_NAME).o
+
+sheepdev-objs := device.o sheep.o connect.o proc.o
+
+device.o : sheep.h sheepdog_proto.h
+sheep.o : sheep.h sheepdog_proto.h
+connect.o : sheep.h
+proc.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.1
More information about the sheepdog
mailing list