All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH] mk/module.mk: add Makefile to build kernel modules
@ 2013-09-17 11:22 Alexey Kodanev
  0 siblings, 0 replies; only message in thread
From: Alexey Kodanev @ 2013-09-17 11:22 UTC (permalink / raw
  To: ltp-list; +Cc: vasily.isaenko, Alexey Kodanev

Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
 include/mk/module.mk |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)
 create mode 100644 include/mk/module.mk

diff --git a/include/mk/module.mk b/include/mk/module.mk
new file mode 100644
index 0000000..99d4c0a
--- /dev/null
+++ b/include/mk/module.mk
@@ -0,0 +1,43 @@
+# Copyright (c) 2013 Oracle and/or its affiliates. All Rights Reserved.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it would be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write the Free Software Foundation,
+# Inc.,  51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+# Author: Alexey Kodanev <alexey.kodanev@oracle.com>
+#
+# Include it to build kernel modules.
+# MODULE_NAMES must be defined beforehand.
+#
+
+ifneq ($(KERNELRELEASE),)
+
+obj-m		:= $(addsuffix .o, $(MODULE_NAMES))
+
+else
+
+include $(top_srcdir)/include/mk/env_pre.mk
+
+export abs_srcdir
+
+MAKE_TARGETS	+= $(addsuffix .ko, $(MODULE_NAMES))
+
+# Ignoring the exit status of commands is done to be forward compatible with
+# kernel internal API changes. The user-space test will return TCONF, if it
+# doesn't find the module (i.e. it wasn't built either due to kernel-devel
+# missing or module build failure).
+%.ko: %.c
+	-$(MAKE) -C $(LINUX_DIR) M=$(abs_srcdir)
+	-rm -rf *.mod.c *.o modules.order .tmp* .*.ko .*.cmd Module.symvers
+
+endif
-- 
1.7.1


------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/20/13. 
http://pubads.g.doubleclick.net/gampad/clk?id=58041151&iu=/4140/ostg.clktrk
_______________________________________________
Ltp-list mailing list
Ltp-list@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ltp-list

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-17 11:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-17 11:22 [LTP] [PATCH] mk/module.mk: add Makefile to build kernel modules Alexey Kodanev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.