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@xxxxxxxxxx> Signed-off-by: Tomas Glozar <tglozar@xxxxxxxxxx> --- Makefile | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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},) -- 2.47.1