2013-02-23 20:05:59 -04:00
|
|
|
#
|
|
|
|
# Copyright (C) 2012 PX4 Development Team. All rights reserved.
|
|
|
|
#
|
|
|
|
# Redistribution and use in source and binary forms, with or without
|
|
|
|
# modification, are permitted provided that the following conditions
|
|
|
|
# are met:
|
|
|
|
#
|
|
|
|
# 1. Redistributions of source code must retain the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer.
|
|
|
|
# 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
# notice, this list of conditions and the following disclaimer in
|
|
|
|
# the documentation and/or other materials provided with the
|
|
|
|
# distribution.
|
|
|
|
# 3. Neither the name PX4 nor the names of its contributors may be
|
|
|
|
# used to endorse or promote products derived from this software
|
|
|
|
# without specific prior written permission.
|
|
|
|
#
|
|
|
|
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
|
|
|
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
|
|
|
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
|
|
|
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
|
|
|
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
|
|
|
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
|
|
|
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
|
|
|
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
|
|
|
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
|
|
|
# POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
#
|
|
|
|
|
2013-02-21 01:12:59 -04:00
|
|
|
#
|
|
|
|
# Path and tool setup
|
|
|
|
#
|
|
|
|
|
|
|
|
#
|
|
|
|
# Some useful paths.
|
|
|
|
#
|
2013-02-23 16:23:34 -04:00
|
|
|
# Note that in general we always keep directory paths with the separator
|
2014-12-03 12:04:15 -04:00
|
|
|
# at the end, and join paths without explicit separators. This reduces
|
2013-02-23 16:23:34 -04:00
|
|
|
# the number of duplicate slashes we have lying around in paths,
|
|
|
|
# and is consistent with joining the results of $(dir) and $(notdir).
|
|
|
|
#
|
2013-04-26 20:14:32 -03:00
|
|
|
export PX4_INCLUDE_DIR = $(abspath $(PX4_BASE)/src/include)/
|
|
|
|
export PX4_MODULE_SRC = $(abspath $(PX4_BASE)/src)/
|
2013-08-21 13:13:01 -03:00
|
|
|
export PX4_LIB_DIR = $(abspath $(PX4_BASE)/src/lib)/
|
2014-12-03 12:04:15 -04:00
|
|
|
export PX4_PLATFORMS_DIR = $(abspath $(PX4_BASE)/src/platforms)/
|
2013-02-23 16:23:34 -04:00
|
|
|
export PX4_MK_DIR = $(abspath $(PX4_BASE)/makefiles)/
|
2013-05-31 20:04:32 -03:00
|
|
|
export NUTTX_SRC = $(abspath $(PX4_BASE)/NuttX/nuttx)/
|
2014-07-07 12:18:54 -03:00
|
|
|
export MAVLINK_SRC = $(abspath $(PX4_BASE)/mavlink/include/mavlink/v1.0)/
|
2013-08-04 23:37:08 -03:00
|
|
|
export NUTTX_APP_SRC = $(abspath $(PX4_BASE)/NuttX/apps)/
|
2013-02-23 16:23:34 -04:00
|
|
|
export MAVLINK_SRC = $(abspath $(PX4_BASE)/mavlink)/
|
2014-05-06 12:30:45 -03:00
|
|
|
export UAVCAN_DIR = $(abspath $(PX4_BASE)/uavcan)/
|
2013-02-23 16:23:34 -04:00
|
|
|
export ROMFS_SRC = $(abspath $(PX4_BASE)/ROMFS)/
|
|
|
|
export IMAGE_DIR = $(abspath $(PX4_BASE)/Images)/
|
|
|
|
export BUILD_DIR = $(abspath $(PX4_BASE)/Build)/
|
|
|
|
export ARCHIVE_DIR = $(abspath $(PX4_BASE)/Archives)/
|
2015-06-12 13:49:15 -03:00
|
|
|
export PX4_VERSIONING_DIR = $(BUILD_DIR)versioning/
|
2013-02-21 01:12:59 -04:00
|
|
|
|
2013-04-26 20:14:32 -03:00
|
|
|
#
|
|
|
|
# Default include paths
|
|
|
|
#
|
|
|
|
export INCLUDE_DIRS := $(PX4_MODULE_SRC) \
|
2013-04-28 04:54:11 -03:00
|
|
|
$(PX4_MODULE_SRC)/modules/ \
|
2013-08-21 13:13:01 -03:00
|
|
|
$(PX4_INCLUDE_DIR) \
|
2014-12-03 12:04:15 -04:00
|
|
|
$(PX4_LIB_DIR) \
|
2015-06-12 13:49:15 -03:00
|
|
|
$(PX4_PLATFORMS_DIR) \
|
|
|
|
$(PX4_VERSIONING_DIR)
|
2013-04-26 20:14:32 -03:00
|
|
|
|
2013-02-21 01:12:59 -04:00
|
|
|
#
|
|
|
|
# Tools
|
|
|
|
#
|
2013-04-26 20:14:32 -03:00
|
|
|
export MKFW = $(PX4_BASE)/Tools/px_mkfw.py
|
|
|
|
export UPLOADER = $(PX4_BASE)/Tools/px_uploader.py
|
|
|
|
export COPY = cp
|
2013-08-03 02:34:55 -03:00
|
|
|
export COPYDIR = cp -Rf
|
2013-04-26 20:14:32 -03:00
|
|
|
export REMOVE = rm -f
|
|
|
|
export RMDIR = rm -rf
|
|
|
|
export GENROMFS = genromfs
|
|
|
|
export TOUCH = touch
|
|
|
|
export MKDIR = mkdir
|
2013-08-23 03:47:55 -03:00
|
|
|
export FIND = find
|
2013-04-26 20:14:32 -03:00
|
|
|
export ECHO = echo
|
|
|
|
export UNZIP_CMD = unzip
|
2013-04-28 16:47:34 -03:00
|
|
|
export PYTHON = python
|
|
|
|
export OPENOCD = openocd
|
2015-01-20 23:36:55 -04:00
|
|
|
export GREP = grep
|
2013-02-21 01:12:59 -04:00
|
|
|
|
|
|
|
#
|
|
|
|
# Host-specific paths, hacks and fixups
|
|
|
|
#
|
2013-04-26 20:14:32 -03:00
|
|
|
export SYSTYPE := $(shell uname -s)
|
2013-02-21 01:12:59 -04:00
|
|
|
|
|
|
|
ifeq ($(SYSTYPE),Darwin)
|
|
|
|
# Eclipse may not have the toolchain on its path.
|
|
|
|
export PATH := $(PATH):/usr/local/bin
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# Makefile debugging.
|
|
|
|
#
|
2013-02-23 03:27:24 -04:00
|
|
|
export Q := $(if $(V),,@)
|