public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 1/3] example-module: improve Makefile to be more realistic
@ 2022-08-27  8:59 Henning Schild
  2022-08-27  8:59 ` [PATCH v2 2/3] linux-module: honor modules Makefile Henning Schild
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Henning Schild @ 2022-08-27  8:59 UTC (permalink / raw)
  To: isar-users; +Cc: Pingfang Liao, Florian Bezdeka, Henning Schild

A real out-of-tree module would be able to "make" on its own, finding
its own KDIR and not rely on some external entity to provide that. But
of cause allow KDIR to be provided from outside.

Fixes: 8d9e4e3c0857 ("Add exemplary kernel module")
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
 .../example-module/files/src/Makefile              | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/meta-isar/recipes-kernel/example-module/files/src/Makefile b/meta-isar/recipes-kernel/example-module/files/src/Makefile
index 2561cfd410e5..df3241652cf1 100644
--- a/meta-isar/recipes-kernel/example-module/files/src/Makefile
+++ b/meta-isar/recipes-kernel/example-module/files/src/Makefile
@@ -1,8 +1,20 @@
 # Example module
 #
 # This software is a part of ISAR.
-# Copyright (c) Siemens AG, 2018
+# Copyright (c) Siemens AG, 2018-2022
 #
 # SPDX-License-Identifier: GPL-2.0
 
 obj-m := example-module.o
+
+INSTALL_MOD_PATH ?= $(DESTDIR)
+export INSTALL_MOD_PATH
+
+KDIR ?= /lib/modules/$(shell uname -r)/build
+
+modules modules_install clean:
+	$(MAKE) -C $(KDIR) M=$(PWD) $@
+
+install: modules_install
+
+.PHONY: modules modules_install install clean
-- 
2.35.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-09-01 19:47 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-27  8:59 [PATCH v2 1/3] example-module: improve Makefile to be more realistic Henning Schild
2022-08-27  8:59 ` [PATCH v2 2/3] linux-module: honor modules Makefile Henning Schild
2022-09-01 16:08   ` Jan Kiszka
2022-09-01 17:17     ` Henning Schild
2022-09-01 19:46       ` Jan Kiszka
2022-08-27  8:59 ` [PATCH v2 3/3] linux-module: call the install target of external modules Henning Schild
2022-09-01 16:08 ` [PATCH v2 1/3] example-module: improve Makefile to be more realistic Jan Kiszka

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox