From 0e0afbd756c0580d361a09072c361e3afe3b53a0 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 2 Aug 2013 14:12:24 +1000 Subject: [PATCH] PX4: allow NuttX tree to be in directory above Firmware tree --- mk/px4_targets.mk | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/mk/px4_targets.mk b/mk/px4_targets.mk index db83c02804..f8ea4961ab 100644 --- a/mk/px4_targets.mk +++ b/mk/px4_targets.mk @@ -3,11 +3,20 @@ ifneq ($(PX4_ROOT),) # try to cope with relative paths -ifeq ($(wildcard $(PX4_ROOT)/NuttX),) +ifeq ($(wildcard $(PX4_ROOT)/nuttx-configs),) PX4_ROOT := $(shell cd $(SKETCHBOOK)/$(PX4_ROOT) && pwd) endif +ifeq ($(wildcard $(PX4_ROOT)/nuttx-configs),) +$(error ERROR: PX4_ROOT not set correctly - no nuttx-configs directory found) +endif + +# allow user to have NuttX git tree in directory above Firmware tree. This +# makes life simpler for git usage ifeq ($(wildcard $(PX4_ROOT)/NuttX),) -$(error ERROR: PX4_ROOT not set correctly - no NuttX directory found) + ifeq ($(wildcard $(PX4_ROOT)/../NuttX),) + $(error ERROR: NuttX git tree not found) + endif +$(shell cd $(PX4_ROOT) && ln -s ../NuttX) endif # we have different config files for V1 and V2