diff --git a/Makefile.include b/Makefile.include index be6f27a580..26aeddd850 100644 --- a/Makefile.include +++ b/Makefile.include @@ -649,11 +649,13 @@ endef # Check if setsid command is available on the system for debug target # This is not the case on MacOSX, so it must be built on the fly -ifneq (,$(filter debug, $(MAKECMDGOALS))) - ifneq (0,$(shell which setsid 2>&1 > /dev/null ; echo $$?)) - SETSID = $(RIOTTOOLS)/setsid/setsid - $(call target-export-variables,debug,$(SETSID)) - DEBUGDEPS += $(SETSID) +ifeq ($(OS),Darwin) + ifneq (,$(filter debug, $(MAKECMDGOALS))) + ifneq (0,$(shell command -v setsid 2>&1 > /dev/null ; echo $$?)) + SETSID = $(RIOTTOOLS)/setsid/setsid + $(call target-export-variables,debug,$(SETSID)) + DEBUGDEPS += $(SETSID) + endif endif endif