PX4: allow NuttX tree to be in directory above Firmware tree

This commit is contained in:
Andrew Tridgell 2013-08-02 14:12:24 +10:00
parent 4794d90bbb
commit 0e0afbd756

View File

@ -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