libcgroup.mk names $(LIBCGROUP_O_DIRS) as a regular prerequisite of
cgroup_util.o. The directory's mtime moves whenever an object is
created or replaced in it, so an incremental KVM selftests build that
rebuilt anything in lib/ recompiles cgroup_util.o and relinks every
test on the following run. Make the directory order-only, as
libvfio.mk does.
Fixes: 2c754a84ff16a ("cgroup: selftests: Move cgroup_util into its own
library")
Assisted-by: LLM
Signed-off-by: Fuad Tabba <[email protected]>
---
tools/testing/selftests/cgroup/lib/libcgroup.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/cgroup/lib/libcgroup.mk
b/tools/testing/selftests/cgroup/lib/libcgroup.mk
index 7a73007204c39..bcf6fe2516223 100644
--- a/tools/testing/selftests/cgroup/lib/libcgroup.mk
+++ b/tools/testing/selftests/cgroup/lib/libcgroup.mk
@@ -13,7 +13,7 @@ EXTRA_HDRS := $(selfdir)/clone3/clone3_selftests.h
$(LIBCGROUP_O_DIRS):
mkdir -p $@
-$(LIBCGROUP_O): $(OUTPUT)/%.o : $(CGROUP_DIR)/%.c $(EXTRA_HDRS)
$(LIBCGROUP_O_DIRS)
+$(LIBCGROUP_O): $(OUTPUT)/%.o : $(CGROUP_DIR)/%.c $(EXTRA_HDRS) |
$(LIBCGROUP_O_DIRS)
$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c $< -o $@
EXTRA_CLEAN += $(LIBCGROUP_O)
--
2.39.5