Skip to contentSkip to conversation

rt-tests: Skip feature tests on non-build targets

PATCH New Tomas Glozar 1 participant 1 message Dec 17, 2024 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 rt-tests: Skip feature tests on non-build targets

Do not check for dependencies when not building anything, i.e. on clean, distclean, and tarball targets.

Inspired by a similar check in rtla.

---
 Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)
Makefile +12 -0
index 0fa0928..ce7f5c5 100644
@@ -39,6 +39,17 @@ LDFLAGS ?=
 
 PYLIB ?= $(shell python3 -m get_pylib)
 
+# Check for dependencies only when building
+NON_CONFIG_TARGETS := clean distclean tarball
+
+config          := 1
+ifdef MAKECMDGOALS
+ifeq ($(filter-out $(NON_CONFIG_TARGETS),$(MAKECMDGOALS)),)
+ config         := 0
+endif
+endif
+
+ifeq ($(config),1)
 # Check for optional libcpupower dependency
 ifneq ($(no_libcpupower), 1)
 ifeq ($(call test-feature,libcpupower), 0)
@@ -51,6 +62,7 @@ endif
 else
 $(warning libcpupower disabled, building without --deepest-idle-state support.)
 endif
+endif
 
 # Check for errors, such as python3 not available
 ifeq (${PYLIB},)
Signature · 1 line
2.47.1