From 699e1881107f952c41800dcfed128be38fc27cf9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 26 Aug 2013 23:03:39 +1000 Subject: [PATCH] build: only use a build in $SKETCHBOOK for px4 for others it is more convenient to use /tmp, as quite a few scripts rely on this --- mk/environ.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mk/environ.mk b/mk/environ.mk index 452a0acd54..06c22f57e1 100644 --- a/mk/environ.mk +++ b/mk/environ.mk @@ -64,7 +64,15 @@ endif # Work out where we are going to be building things # TMPDIR ?= /tmp + +ifneq ($(findstring px4, $(MAKECMDGOALS)),) +# when building px4 we need all sources to be inside the sketchbook directory +# as the NuttX build system relies on it BUILDROOT := $(SKETCHBOOK)/Build.$(SKETCH) +else +BUILDROOT := $(abspath $(TMPDIR)/$(SKETCH).build) +endif + ifneq ($(findstring CYGWIN, $(SYSTYPE)),) # Workaround a $(abspath ) bug on cygwin ifeq ($(BUILDROOT),)