From 74fb936dbd49c61bf3352febd1c57a68888100d0 Mon Sep 17 00:00:00 2001 From: MinetaS Date: Tue, 6 Dec 2022 21:32:42 +0900 Subject: [PATCH] Invoke .depend only on build targets Add a constraint so that the dependency build only occurs when users actually run build tasks. This fixes a bug on some systems where gcc/g++ is not available. closes https://github.com/official-stockfish/Stockfish/pull/4255 No functional change --- src/Makefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 917bd5c0..0c98391b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -512,7 +512,7 @@ endif ### Sometimes gcc is really clang ifeq ($(COMP),gcc) - gccversion = $(shell $(CXX) --version) + gccversion = $(shell $(CXX) --version 2>/dev/null) gccisclang = $(findstring clang,$(gccversion)) ifneq ($(gccisclang),) profile_make = clang-profile-make @@ -1006,4 +1006,6 @@ icc-profile-use: .depend: $(SRCS) -@$(CXX) $(DEPENDFLAGS) -MM $(SRCS) > $@ 2> /dev/null +ifneq (, $(filter $(MAKECMDGOALS), build profile-build)) -include .depend +endif