Linux Test Project
 help / color / mirror / Atom feed
From: Petr Vorel <pvorel@suse.cz>
To: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH v2 1/1] Makefile: Add kernel modules related make targets
Date: Fri, 1 Aug 2025 12:20:47 +0200	[thread overview]
Message-ID: <20250801102047.GA974145@pevik> (raw)
In-Reply-To: <20250801100935.974351-1-pvorel@suse.cz>

Hi,

> 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.

Also, I wondered about fail when kernel modules aren't build:

include/mk/module.mk contains:

ifeq ($(WITH_MODULES),no)
SKIP := 1
else
ifeq ($(LINUX_VERSION_MAJOR)$(LINUX_VERSION_PATCH),)
SKIP := 1
else
SKIP ?= $(shell \
	[ "$(LINUX_VERSION_MAJOR)" -gt "$(REQ_VERSION_MAJOR)" ] || \
	[ "$(LINUX_VERSION_MAJOR)" -eq "$(REQ_VERSION_MAJOR)" -a \
	  "$(LINUX_VERSION_PATCH)" -ge "$(REQ_VERSION_PATCH)" ]; echo $$?)
endif
endif

ifneq ($(SKIP),0)
MAKE_TARGETS := $(filter-out %.ko, $(MAKE_TARGETS))
endif

# 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 .dep_modules ;
-----

We could allow to fail build with:
$ make modules FORCE=1

with these changes to include/mk/module.mk:

ifneq ($(SKIP),0)
MAKE_TARGETS := $(filter-out %.ko, $(MAKE_TARGETS))
ifeq ($(FORCE),1)
$(error Modules not built)
endif
endif

ifneq ($(FORCE),1)
%.ko: %.c .dep_modules ;
endif

Kind regards,
Petr

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

  reply	other threads:[~2025-08-01 10:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250801102047.GA974145@pevik \
    --to=pvorel@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox