From 5b265088fe1eef5de166e51992e9c31ea52325b1 Mon Sep 17 00:00:00 2001 From: Alexandre Abadie Date: Fri, 19 Oct 2018 13:27:11 +0200 Subject: [PATCH] Makefile.include: use external setsid with debug target Only when setsid is not provided by the system which is typically the case on MacOSX --- Makefile.include | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.include b/Makefile.include index befb9d8647..18f272c6d6 100644 --- a/Makefile.include +++ b/Makefile.include @@ -570,6 +570,16 @@ define check_cmd exit 1;} 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) + endif +endif + ..compiler-check: $(call check_cmd,$(CC),Compiler) @@ -643,7 +653,7 @@ list-ttys: doc: make -BC $(RIOTBASE) doc -debug: +debug: $(DEBUGDEPS) $(call check_cmd,$(DEBUGGER),Debug program) $(DEBUGGER) $(DEBUGGER_FLAGS)