[aravis] module: boilerplate
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] module: boilerplate
- Date: Thu, 21 Aug 2014 13:02:32 +0000 (UTC)
commit ef367a71ee3c5047e97b99953834962a41b39141
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Thu Aug 21 15:02:05 2014 +0200
module: boilerplate
module/.gitignore | 6 ++++
module/Makefile | 73 ++++++++++++++++++++++++++++++++++++++++++++++++
module/aravis-module.c | 18 ++++++++++++
3 files changed, 97 insertions(+), 0 deletions(-)
---
diff --git a/module/.gitignore b/module/.gitignore
new file mode 100644
index 0000000..ea0777d
--- /dev/null
+++ b/module/.gitignore
@@ -0,0 +1,6 @@
+.*.cmd
+.tmp_versions/
+Module.symvers
+modules.order
+*.ko
+*.mod.c
diff --git a/module/Makefile b/module/Makefile
new file mode 100644
index 0000000..8553a66
--- /dev/null
+++ b/module/Makefile
@@ -0,0 +1,73 @@
+ifneq ($(KERNELRELEASE),)
+
+obj-m := aravis-module.o
+
+else
+
+ifeq ($(PREFIX),)
+PREFIX := /usr/local
+endif
+
+MODULE := aravis-module
+KDIR := /lib/modules/$(shell uname -r)/build
+INCLUDE := -isystem $(KDIR)/include
+MODCFLAGS := -DMODULE -D__KERNEL__ -Wall $(INCLUDE)
+
+KMAKE := $(MAKE) -C $(KDIR) SUBDIRS=$$PWD
+
+modules: $(MODULE).o
+
+insert_module: install
+ modprobe -r aravis-module
+ modprobe aravis-module
+
+ifneq ($(shell (uname -r | grep 2.6) > /dev/null ; echo -n $$?),0)
+ echo A 2.6 kernel is required; exit 1
+endif
+
+# build module
+
+$(MODULE).o: $(MODULE).c $(MODULE).h
+ $(KMAKE) modules
+
+
+# Automake rules, as per "Third-Party Makefiles" in the automake manual
+
+all: $(MODULE).o
+
+distdir:
+ cp aravis-module.c $(distdir)
+ cp aravis-module.h $(distdir)
+ cp Makefile $(distdir)
+
+install:
+ $(KMAKE) modules_install
+ [ -e /sbin/depmod ] && /sbin/depmod
+
+install-data:
+install-exec:
+uninstall:
+
+install-info:
+installdirs:
+check:
+installcheck:
+mostlyclean:
+clean:
+ rm -f aravis-module.ko
+ rm -f aravis-module.o
+ rm -f aravis-module.mod.o
+ rm -f aravis-module.mod.c
+ rm -f modules.order
+ rm -f Module.symvers
+distclean: clean
+maintainer-clean:
+dvi:
+pdf:
+info:
+html:
+tags:
+ctags:
+
+endif
+
diff --git a/module/aravis-module.c b/module/aravis-module.c
new file mode 100644
index 0000000..db1ae32
--- /dev/null
+++ b/module/aravis-module.c
@@ -0,0 +1,18 @@
+#include <linux/module.h>
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Emmanuel Pacaud <emmanuel gnome org>");
+
+int
+init_module(void)
+{
+ printk (KERN_ALERT "aravis: loaded\n");
+
+ return 0;
+}
+
+void
+cleanup_module(void)
+{
+ printk (KERN_ALERT "aravis: unloaded\n");
+}
diff --git a/module/aravis-module.h b/module/aravis-module.h
new file mode 100644
index 0000000..e69de29
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]