diff mbox series

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

Message ID 20241217114942.2670452-1-tglozar@redhat.com
State New
Headers show
Series rt-tests: Skip feature tests on non-build targets | expand

Commit Message

Tomas Glozar Dec. 17, 2024, 11:49 a.m. UTC
Do not check for dependencies when not building anything, i.e. on clean,
distclean, and tarball targets.

Inspired by a similar check in rtla.

Suggested-by: John Kacur <jkacur@redhat.com>
Signed-off-by: Tomas Glozar <tglozar@redhat.com>
---
 Makefile | 12 ++++++++++++
 1 file changed, 12 insertions(+)
diff mbox series

Patch

diff --git a/Makefile b/Makefile
index 0fa0928..ce7f5c5 100644
--- a/Makefile
+++ b/Makefile
@@ -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},)