@@ -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},)
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(+)