All of lore.kernel.org
 help / color / mirror / Atom feed
* [LTP] [PATCH v2 1/1] Makefile: Add kernel modules related make targets
@ 2025-08-01 10:09 Petr Vorel
  2025-08-01 10:20 ` Petr Vorel
  2025-08-02  3:25 ` Li Wang via ltp
  0 siblings, 2 replies; 9+ messages in thread
From: Petr Vorel @ 2025-08-01 10:09 UTC (permalink / raw)
  To: ltp

LTP contains few kernel modules and tests which are using them.  These
require to be built with the same kernel headers as the running kernel
(SUT). Sometimes the best way to achieve this is to compile them on the
SUT.

Add 'modules', 'modules-clean' and 'modules-install' make targets to
make it easier to build them.

Signed-off-by: Petr Vorel <pvorel@suse.cz>
---
Hi,

I'm sorry for the noise.

Most of the people will need just modules-install, but let's be
consistent with other LTP make targets.

Kind regards,
Petr

Changes v1->v2:
* Add also modules-clean and modules-install
This is needed as 'make modules clean' or 'make modules install'
would be running 2 separate targets.

v1:
https://lore.kernel.org/ltp/20250801094205.965645-1-pvorel@suse.cz/
https://patchwork.ozlabs.org/project/ltp/patch/20250801094205.965645-1-pvorel@suse.cz/

 INSTALL  | 10 ++++++++++
 Makefile | 24 ++++++++++++++++++++++++
 2 files changed, 34 insertions(+)

diff --git a/INSTALL b/INSTALL
index cbe27f32ea..10c19d4105 100644
--- a/INSTALL
+++ b/INSTALL
@@ -165,6 +165,16 @@ PKG_CONFIG_LIBDIR=/usr/lib/i386-linux-gnu/pkgconfig CFLAGS=-m32 LDFLAGS=-m32 ./c
 * Arch Linux
 PKG_CONFIG_LIBDIR=/usr/lib32/pkgconfig CFLAGS=-m32 LDFLAGS=-m32 ./configure
 
+Kernel modules
+--------------
+
+LTP contains few kernel modules and tests which are using them.
+These require to be built with the same kernel headers as the running kernel (SUT).
+Sometimes the best way to achieve this is to compile them on the SUT.
+
+'modules', 'modules-clean' and 'modules-install' make targets are shortcuts
+to build just these modules and tests.
+
 Android Users
 -------------
 
diff --git a/Makefile b/Makefile
index eab40da8a6..933e33ca75 100644
--- a/Makefile
+++ b/Makefile
@@ -212,6 +212,30 @@ endif
 test-metadata: metadata-all
 	$(MAKE) -C $(abs_srcdir)/metadata test
 
+MODULE_DIRS := commands/insmod \
+	testcases/kernel/firmware \
+	testcases/kernel/device-drivers \
+	testcases/kernel/syscalls/delete_module \
+	testcases/kernel/syscalls/finit_module \
+	testcases/kernel/syscalls/init_module
+
+.PHONY: modules modules-clean modules-install
+modules:
+	@$(foreach dir,$(MODULE_DIRS),\
+		echo "Build $(dir)";\
+		$(MAKE) -C $(abs_srcdir)/$(dir); \
+)
+modules-clean:
+	@$(foreach dir,$(MODULE_DIRS),\
+		echo "Build $(dir)";\
+		$(MAKE) -C $(abs_srcdir)/$(dir) clean; \
+)
+modules-install: modules
+	@$(foreach dir,$(MODULE_DIRS),\
+		echo "Build $(dir)";\
+		$(MAKE) -C $(abs_srcdir)/$(dir) install; \
+)
+
 ## Help
 .PHONY: help
 help:
-- 
2.50.1


-- 
Mailing list info: https://lists.linux.it/listinfo/ltp

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

end of thread, other threads:[~2025-08-06 19:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-01 10:09 [LTP] [PATCH v2 1/1] Makefile: Add kernel modules related make targets Petr Vorel
2025-08-01 10:20 ` Petr Vorel
2025-08-02  3:59   ` Li Wang via ltp
2025-08-06 11:47     ` Petr Vorel
2025-08-02  3:25 ` Li Wang via ltp
2025-08-02  4:11   ` Li Wang via ltp
2025-08-06 11:52     ` Petr Vorel
2025-08-06 13:29       ` Cyril Hrubis
2025-08-06 19:49         ` Petr Vorel

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.