From: "Li Wang (Hieco)" <li.wang@linux.dev>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v4 1/3] build: Fix library prerequisites in testcases.mk
Date: Tue, 24 Nov 2026 17:06:31 +0800 [thread overview]
Message-ID: <20261124090633.840656-2-li.wang@linux.dev> (raw)
In-Reply-To: <20261124090633.840656-1-li.wang@linux.dev>
From: Andrea Cervesato <andrea.cervesato@suse.com>
Fix LTPLIBS_FILES to match the actual libltp<name>.a archive names and
only mark them .PHONY when MAKELEVEL == 0 so recursive leaf sub-makes
do not redundantly rebuild them in parallel.
Also make directory prerequisites order-only so directory mtime updates
do not trigger unnecessary archive rebuilds.
Signed-off-by: Andrea Cervesato <andrea.cervesato@suse.com>
Signed-off-by: Li Wang (Hieco) <li.wang@linux.dev>
Reviewed-by: Li Wang (Hieco) <li.wang@linux.dev>
---
include/mk/testcases.mk | 14 ++++++++------
testcases/kernel/include/lib.mk | 4 ++--
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/include/mk/testcases.mk b/include/mk/testcases.mk
index 2609535ce..5960d7485 100644
--- a/include/mk/testcases.mk
+++ b/include/mk/testcases.mk
@@ -12,11 +12,11 @@ LIBLTP_DIR := $(abs_top_builddir)/lib
LIBLTP := $(LIBLTP_DIR)/libltp.a
-$(APICMDS_DIR)/tst_kvercmp: $(APICMDS_DIR)
- $(MAKE) -C "$^" -f "$(abs_top_srcdir)/tools/apicmds/Makefile" all
+$(APICMDS_DIR)/tst_kvercmp: | $(APICMDS_DIR)
+ $(MAKE) -C "$(APICMDS_DIR)" -f "$(abs_top_srcdir)/tools/apicmds/Makefile" all
-$(LIBLTP): $(LIBLTP_DIR)
- $(MAKE) -C "$^" -f "$(abs_top_srcdir)/lib/Makefile" all
+$(LIBLTP): | $(LIBLTP_DIR)
+ $(MAKE) -C "$(LIBLTP_DIR)" -f "$(abs_top_srcdir)/lib/Makefile" all
MAKE_DEPS := $(LIBLTP)
@@ -27,13 +27,15 @@ LDLIBS += -lltp
ifdef LTPLIBS
LTPLIBS_DIRS = $(addprefix $(abs_top_builddir)/libs/, $(LTPLIBS))
-LTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach LIB,$(LTPLIBS),$(LIB)/lib$(LIB))))
+LTPLIBS_FILES = $(addsuffix .a, $(addprefix $(abs_top_builddir)/libs/, $(foreach LIB,$(LTPLIBS),$(LIB)/libltp$(LIB))))
MAKE_DEPS += $(LTPLIBS_FILES)
+ifeq ($(MAKELEVEL),0)
.PHONY: $(LTPLIBS_FILES)
+endif
-$(LTPLIBS_FILES): $(LTPLIBS_DIRS)
+$(LTPLIBS_FILES): | $(LTPLIBS_DIRS)
$(LTPLIBS_FILES): %:
ifdef VERBOSE
diff --git a/testcases/kernel/include/lib.mk b/testcases/kernel/include/lib.mk
index 40a09b77e..c1a0c6d52 100644
--- a/testcases/kernel/include/lib.mk
+++ b/testcases/kernel/include/lib.mk
@@ -29,8 +29,8 @@ LDFLAGS += -L$(LIBKERNTEST_DIR)
$(LIBKERNTEST_DIR):
mkdir -p "$@"
-$(LIBKERNTEST): $(LIBKERNTEST_DIR)
- $(MAKE) -C $^ -f "$(LIBKERNTEST_SRCDIR)/Makefile" all
+$(LIBKERNTEST): | $(LIBKERNTEST_DIR)
+ $(MAKE) -C "$(LIBKERNTEST_DIR)" -f "$(LIBKERNTEST_SRCDIR)/Makefile" all
MAKE_DEPS += $(LIBKERNTEST)
--
2.56.1
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2026-11-24 9:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-24 9:06 [LTP] [PATCH v4 0/3] Speedup LTP compile time by ~20% on multi-machine Li Wang (Hieco)
2026-11-24 9:06 ` Li Wang (Hieco) [this message]
2026-11-24 9:06 ` [LTP] [PATCH v4 2/3] build: Build shared libraries once when make runs in testcases/ Li Wang (Hieco)
2026-11-24 9:06 ` [LTP] [PATCH v4 3/3] build: Recurse into trunk subdirectories in parallel Li Wang (Hieco)
2026-11-24 11:32 ` [LTP] [PATCH v4 0/3] Speedup LTP compile time by ~20% on multi-machine Cyril Hrubis
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=20261124090633.840656-2-li.wang@linux.dev \
--to=li.wang@linux.dev \
--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 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.