diff --git a/makefiles/README.txt b/makefiles/README.txt deleted file mode 100644 index 9578793957..0000000000 --- a/makefiles/README.txt +++ /dev/null @@ -1,86 +0,0 @@ -PX4 Build System -================ - -The files in this directory implement the PX4 runtime firmware build system -and configuration for the standard PX4 boards and software, in conjunction -with Makefile in the parent directory. - -../Makefile - - Top-level makefile for the PX4 build system. - This makefile supports building NuttX archives for the NuttX based - configurations, as well as supervising the building of all - of the defined PX4 firmware configurations. - - Try 'make help' in the parent directory for documentation. - -firmware.mk - - Manages the build for one specific firmware configuration. - See the comments at the top of this file for detailed documentation. - - Builds modules, builtin command lists and the ROMFS (if configured). - - This is the makefile directly used by external build systems; it can - be configured to compile modules both inside and outside the PX4 - source tree. When used in this mode, at least BOARD, MODULES and - CONFIG_FILE must be set. - -firmware_nuttx.mk - - Called by firmware.mk to build NuttX based firmware. - -firmware_posix.mk - - Called by firmware.mk to build POSIX (non-ROS) based firmware. - -module.mk - - Called by firmware.mk to build individual modules. - See the comments at the top of this file for detailed documentation. - - Not normally used other than by firmware.mk. - -nuttx.mk - - Called by ../Makefile to build or download the NuttX archives if - PX4_TARGET_OS is set to "nuttx". - -posix.mk - - Called by ../Makefile to set POSIX specific parameters if - PX4_TARGET_OS is set to "posix". - -upload.mk - - Called by ../Makefile to upload files to a target board. Can be used - by external build systems as well. (NuttX targets only) - -setup.mk - - Provides common path and tool definitions. Implements host - system-specific compatibility hacks. Sets PX4_TARGET_OS. - -board_.mk - - Board-specific configuration for . Typically sets - CONFIG_ARCH and then includes the toolchain definition for the board. - -config__.mk - - Parameters for a specific configuration on a specific board. - The board name is derived from the filename. Sets MODULES to select - source modules to be included in the configuration, may also set - ROMFS_ROOT to build a ROMFS and BUILTIN_COMMANDS to include non-module - commands (e.g. from NuttX) - -toolchain_.mk - - Provides macros used to compile and link source files. - Accepts EXTRADEFINES to add additional pre-processor symbol definitions, - EXTRACFLAGS, EXTRACXXFLAGS, EXTRAAFLAGS and EXTRALDFLAGS to pass - additional flags to the C compiler, C++ compiler, assembler and linker - respectively. - - Defines the COMPILE, COMPILEXX, ASSEMBLE, PRELINK, ARCHIVE and LINK - macros that are used elsewhere in the build system. diff --git a/makefiles/firmware.mk b/makefiles/firmware.mk deleted file mode 100644 index b8c8d4a85b..0000000000 --- a/makefiles/firmware.mk +++ /dev/null @@ -1,381 +0,0 @@ -# -# 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. -# - -# -# Generic Makefile for PX4 firmware images. -# -# Requires: -# -# BOARD -# Must be set to a board name known to the PX4 distribution (as -# we need a corresponding NuttX export archive to link with). -# -# Optional: -# -# MODULES -# Contains a list of module paths or path fragments used -# to find modules. The names listed here are searched in -# the following directories: -# -# $(MODULE_SEARCH_DIRS) -# WORK_DIR -# MODULE_SRC -# PX4_MODULE_SRC -# -# Application directories are expected to contain a module.mk -# file which provides build configuration for the module. See -# makefiles/module.mk for more details. -# -# BUILTIN_COMMANDS -# Contains a list of built-in commands not explicitly provided -# by modules / libraries. Each entry in this list is formatted -# as ... -# -# PX4_BASE: -# Points to a PX4 distribution. Normally determined based on the -# path to this file. -# -# CONFIG: -# Used when searching for the configuration file, and available -# to module Makefiles to select optional features. -# If not set, CONFIG_FILE must be set and CONFIG will be derived -# automatically from it. -# -# CONFIG_FILE: -# If set, overrides the configuration file search logic. Sets -# CONFIG to the name of the configuration file, strips any -# leading config_ prefix and any suffix. e.g. config_board_foo.mk -# results in CONFIG being set to 'board_foo'. -# -# WORK_DIR: -# Sets the directory in which the firmware will be built. Defaults -# to the directory 'build' under the directory containing the -# parent Makefile. -# -# -# MODULE_SEARCH_DIRS: -# Extra directories to search first for MODULES before looking in the -# usual places. -# - -################################################################################ -# Paths and configuration -################################################################################ - -# -# Work out where this file is, so we can find other makefiles in the -# same directory. -# -# If PX4_BASE wasn't set previously, work out what it should be -# and set it here now. -# -MK_DIR ?= $(dir $(firstword $(MAKEFILE_LIST))) -ifeq ($(PX4_BASE),) -export PX4_BASE := $(abspath $(MK_DIR)/..) -endif -$(info % PX4_BASE = $(PX4_BASE)) -ifneq ($(words $(PX4_BASE)),1) -$(error Cannot build when the PX4_BASE path contains one or more space characters.) -endif - -# -# Set a default target so that included makefiles or errors here don't -# cause confusion. -# -# XXX We could do something cute here with $(DEFAULT_GOAL) if it's not one -# of the maintenance targets and set CONFIG based on it. -# -all: firmware - -# -# Get path and tool config -# -include $(MK_DIR)/setup.mk - -# -# Locate the configuration file -# -ifneq ($(CONFIG_FILE),) -CONFIG := $(subst config_,,$(basename $(notdir $(CONFIG_FILE)))) -else -CONFIG_FILE := $(wildcard $(PX4_MK_DIR)/$(PX4_TARGET_OS)/config_$(CONFIG).mk) -endif -ifeq ($(CONFIG),) -$(error Missing configuration name or file (specify with CONFIG=)) -endif -export CONFIG -include $(CONFIG_FILE) -$(info % CONFIG = $(CONFIG)) - -# -# Sanity-check the BOARD variable and then get the board config. -# If BOARD was not set by the configuration, extract it automatically. -# -# The board config in turn will fetch the toolchain configuration. -# -ifeq ($(BOARD),) -BOARD := $(firstword $(subst _, ,$(CONFIG))) -endif -BOARD_FILE := $(wildcard $(PX4_MK_DIR)/$(PX4_TARGET_OS)/board_$(BOARD).mk) -ifeq ($(BOARD_FILE),) -$(error Config $(CONFIG) references board $(BOARD), but no board definition file found) -endif -export BOARD -export BOARD_FILE -include $(BOARD_FILE) -$(info % BOARD = $(BOARD)) - -# -# If WORK_DIR is not set, create a 'build' directory next to the -# parent Makefile. -# -PARENT_MAKEFILE := $(lastword $(filter-out $(lastword $(MAKEFILE_LIST)),$(MAKEFILE_LIST))) -ifeq ($(WORK_DIR),) -export WORK_DIR := $(dir $(PARENT_MAKEFILE))build/ -endif -$(info % WORK_DIR = $(WORK_DIR)) - -# -# Things that, if they change, might affect everything -# -GLOBAL_DEPS += $(MAKEFILE_LIST) - -# -# Extra things we should clean -# -EXTRA_CLEANS = - - -# -# Append the per-board driver directory to the header search path. -# -INCLUDE_DIRS += $(PX4_MODULE_SRC)drivers/boards/$(BOARD) - -################################################################################ -# External library includes -################################################################################ - -INCLUDE_DIRS += $(PX4_BASE)src/lib/eigen/ - -################################################################################ -# OS specific libraries and paths -################################################################################ - -include $(PX4_MK_DIR)/$(PX4_TARGET_OS)/$(PX4_TARGET_OS).mk - -################################################################################ -# Modules -################################################################################ - -# where to look for modules -MODULE_SEARCH_DIRS += $(WORK_DIR) $(MODULE_SRC) $(PX4_MODULE_SRC) - -# sort and unique the modules list -MODULES := $(sort $(MODULES)) - -# locate the first instance of a module by full path or by looking on the -# module search path -define MODULE_SEARCH - $(firstword $(abspath $(wildcard $(1)/module.mk)) \ - $(abspath $(foreach search_dir,$(MODULE_SEARCH_DIRS),$(wildcard $(search_dir)/$(1)/module.mk))) \ - MISSING_$1) -endef - -# make a list of module makefiles and check that we found them all -MODULE_MKFILES := $(foreach module,$(MODULES),$(call MODULE_SEARCH,$(module))) -MISSING_MODULES := $(subst MISSING_,,$(filter MISSING_%,$(MODULE_MKFILES))) -ifneq ($(MISSING_MODULES),) -$(error Cant find module(s): $(MISSING_MODULES)) -endif - -# Make a list of the object files we expect to build from modules -# Note that this path will typically contain a double-slash at the WORK_DIR boundary; this must be -# preserved as it is used below to get the absolute path for the module.mk file correct. -# -MODULE_OBJS := $(foreach path,$(dir $(MODULE_MKFILES)),$(WORK_DIR)$(path)module.pre.o) - -# rules to build module objects -.PHONY: $(MODULE_OBJS) -$(MODULE_OBJS): relpath = $(patsubst $(WORK_DIR)%,%,$@) -$(MODULE_OBJS): mkfile = $(patsubst %module.pre.o,%module.mk,$(relpath)) -$(MODULE_OBJS): workdir = $(@D) -$(MODULE_OBJS): $(GLOBAL_DEPS) $(NUTTX_CONFIG_HEADER) - $(Q) $(MKDIR) -p $(workdir) - $(Q) $(MAKE) -r -f $(PX4_MK_DIR)module.mk \ - --no-print-directory -C $(workdir) \ - MODULE_WORK_DIR=$(workdir) \ - MODULE_OBJ=$@ \ - MODULE_MK=$(mkfile) \ - MODULE_NAME=$(lastword $(subst /, ,$(workdir))) \ - module - -# make a list of phony clean targets for modules -MODULE_CLEANS := $(foreach path,$(dir $(MODULE_MKFILES)),$(WORK_DIR)$(path)/clean) - -# rules to clean modules -.PHONY: $(MODULE_CLEANS) -$(MODULE_CLEANS): relpath = $(patsubst $(WORK_DIR)%,%,$@) -$(MODULE_CLEANS): mkfile = $(patsubst %clean,%module.mk,$(relpath)) -$(MODULE_CLEANS): - @$(ECHO) %% cleaning using $(mkfile) - $(Q) $(MAKE) -r -f $(PX4_MK_DIR)module.mk \ - MODULE_WORK_DIR=$(dir $@) \ - MODULE_MK=$(mkfile) \ - clean - -################################################################################ -# Libraries -################################################################################ - -# where to look for libraries -LIBRARY_SEARCH_DIRS += $(WORK_DIR) $(MODULE_SRC) $(PX4_MODULE_SRC) - -# sort and unique the library list -LIBRARIES := $(sort $(LIBRARIES)) - -# locate the first instance of a library by full path or by looking on the -# library search path -define LIBRARY_SEARCH - $(firstword $(abspath $(wildcard $(1)/library.mk)) \ - $(abspath $(foreach search_dir,$(LIBRARY_SEARCH_DIRS),$(wildcard $(search_dir)/$(1)/library.mk))) \ - MISSING_$1) -endef - -# make a list of library makefiles and check that we found them all -LIBRARY_MKFILES := $(foreach library,$(LIBRARIES),$(call LIBRARY_SEARCH,$(library))) -MISSING_LIBRARIES := $(subst MISSING_,,$(filter MISSING_%,$(LIBRARY_MKFILES))) -ifneq ($(MISSING_LIBRARIES),) -$(error Cant find library(s): $(MISSING_LIBRARIES)) -endif - -# Make a list of the archive files we expect to build from libraries -# Note that this path will typically contain a double-slash at the WORK_DIR boundary; this must be -# preserved as it is used below to get the absolute path for the library.mk file correct. -# -LIBRARY_LIBS := $(foreach path,$(dir $(LIBRARY_MKFILES)),$(WORK_DIR)$(path)library.a) - -# rules to build module objects -.PHONY: $(LIBRARY_LIBS) -$(LIBRARY_LIBS): relpath = $(patsubst $(WORK_DIR)%,%,$@) -$(LIBRARY_LIBS): mkfile = $(patsubst %library.a,%library.mk,$(relpath)) -$(LIBRARY_LIBS): workdir = $(@D) -$(LIBRARY_LIBS): $(GLOBAL_DEPS) $(NUTTX_CONFIG_HEADER) - $(Q) $(MKDIR) -p $(workdir) - $(Q) $(MAKE) -r -f $(PX4_MK_DIR)library.mk \ - --no-print-directory -C $(workdir) \ - LIBRARY_WORK_DIR=$(workdir) \ - LIBRARY_LIB=$@ \ - LIBRARY_MK=$(mkfile) \ - LIBRARY_NAME=$(lastword $(subst /, ,$(workdir))) \ - library - -# make a list of phony clean targets for modules -LIBRARY_CLEANS := $(foreach path,$(dir $(LIBRARY_MKFILES)),$(WORK_DIR)$(path)/clean) - -# rules to clean modules -.PHONY: $(LIBRARY_CLEANS) -$(LIBRARY_CLEANS): relpath = $(patsubst $(WORK_DIR)%,%,$@) -$(LIBRARY_CLEANS): mkfile = $(patsubst %clean,%library.mk,$(relpath)) -$(LIBRARY_CLEANS): - @$(ECHO) %% cleaning using $(mkfile) - $(Q) $(MAKE) -r -f $(PX4_MK_DIR)library.mk \ - LIBRARY_WORK_DIR=$(dir $@) \ - LIBRARY_MK=$(mkfile) \ - clean - -################################################################################ -# ROMFS generation -################################################################################ -ifeq ($(PX4_TARGET_OS),nuttx) -include $(MK_DIR)/nuttx/nuttx_romfs.mk -endif - -################################################################################ -# Default SRCS generation -################################################################################ - -# -# If there are no SRCS, the build will fail; in that case, generate an empty -# source file. -# -ifeq ($(SRCS),) -EMPTY_SRC = $(WORK_DIR)empty.c -$(EMPTY_SRC): - $(Q) $(ECHO) '/* this is an empty file */' > $@ - -SRCS += $(EMPTY_SRC) -endif - -################################################################################ -# Build rules -################################################################################ - -# -# Object files we will generate from sources -# -OBJS := $(foreach src,$(SRCS),$(WORK_DIR)$(src).o) - -# -# SRCS -> OBJS rules -# - -$(OBJS): $(GLOBAL_DEPS) - -$(filter %.c.o,$(OBJS)): $(WORK_DIR)%.c.o: %.c $(GLOBAL_DEPS) - $(call COMPILE,$<,$@) - -$(filter %.cpp.o,$(OBJS)): $(WORK_DIR)%.cpp.o: %.cpp $(GLOBAL_DEPS) - $(call COMPILEXX,$<,$@) - -$(filter %.S.o,$(OBJS)): $(WORK_DIR)%.S.o: %.S $(GLOBAL_DEPS) - $(call ASSEMBLE,$<,$@) - -# Include the OS specific build rules -# The rules must define the "firmware" make target -# - -ifeq ($(PX4_TARGET_OS),nuttx) -include $(MK_DIR)/nuttx/nuttx_px4.mk -endif -ifeq ($(PX4_TARGET_OS),posix) -include $(MK_DIR)/posix/posix_elf.mk -endif -ifeq ($(PX4_TARGET_OS),posix-arm) -include $(MK_DIR)/posix/posix_elf.mk -endif -ifeq ($(PX4_TARGET_OS),qurt) -include $(MK_DIR)/qurt/qurt_elf.mk -endif - -# -# DEP_INCLUDES is defined by the toolchain include in terms of $(OBJS) -# --include $(DEP_INCLUDES) diff --git a/makefiles/library.mk b/makefiles/library.mk deleted file mode 100644 index e20fcce941..0000000000 --- a/makefiles/library.mk +++ /dev/null @@ -1,169 +0,0 @@ -# -# Copyright (c) 2013 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. -# - -# -# Framework makefile for PX4 libraries -# -# This makefile is invoked by firmware.mk to build each of the linraries -# that will subsequently be linked into the firmware image. -# -# Applications are built as standard ar archives. Unlike modules, -# all public symbols in library objects are visible across the entire -# firmware stack. -# -# In general, modules should be preferred to libraries when possible. -# Libraries may also be pre-built. -# -# IMPORTANT NOTE: -# -# This makefile assumes it is being invoked in the library's output directory. -# - -# -# Variables that can be set by the library's library.mk: -# -# -# SRCS (optional) -# -# Lists the .c, cpp and .S files that should be compiled/assembled to -# produce the library. -# -# PREBUILT_LIB (optional) -# -# Names the prebuilt library in the source directory that should be -# linked into the firmware. -# -# INCLUDE_DIRS (optional, must be appended, ignored if SRCS not set) -# -# The list of directories searched for include files. If non-standard -# includes (e.g. those from another module) are required, paths to search -# can be added here. -# -# - -# -# Variables visible to the library's library.mk: -# -# CONFIG -# BOARD -# LIBRARY_WORK_DIR -# LIBRARY_LIB -# LIBRARY_MK -# Anything set in setup.mk, board_$(BOARD).mk and the toolchain file. -# Anything exported from config_$(CONFIG).mk -# - -################################################################################ -# No user-serviceable parts below. -################################################################################ - -ifeq ($(LIBRARY_MK),) -$(error No library makefile specified) -endif -$(info %% LIBRARY_MK = $(LIBRARY_MK)) - -# -# Get the board/toolchain config -# -include $(PX4_MK_DIR)/$(PX4_TARGET_OS)/board_$(BOARD).mk - -# -# Get the library's config -# -include $(LIBRARY_MK) -LIBRARY_SRC := $(dir $(LIBRARY_MK)) -$(info % LIBRARY_NAME = $(LIBRARY_NAME)) -$(info % LIBRARY_SRC = $(LIBRARY_SRC)) -$(info % LIBRARY_LIB = $(LIBRARY_LIB)) -$(info % LIBRARY_WORK_DIR = $(LIBRARY_WORK_DIR)) - -# -# Things that, if they change, might affect everything -# -GLOBAL_DEPS += $(MAKEFILE_LIST) - -################################################################################ -# Build rules -################################################################################ - -# -# What we're going to build -# -library: $(LIBRARY_LIB) - -ifneq ($(PREBUILT_LIB),) - -VPATH = $(LIBRARY_SRC) -$(LIBRARY_LIB): $(PREBUILT_LIB) $(GLOBAL_DEPS) - @$(ECHO) "PREBUILT: $(PREBUILT_LIB)" - $(Q) $(COPY) $< $@ - -else - -## -## Object files we will generate from sources -## - -OBJS = $(addsuffix .o,$(SRCS)) - -# -# SRCS -> OBJS rules -# - -$(OBJS): $(GLOBAL_DEPS) - -vpath %.c $(LIBRARY_SRC) -$(filter %.c.o,$(OBJS)): %.c.o: %.c $(GLOBAL_DEPS) - $(call COMPILE,$<,$@) - -vpath %.cpp $(LIBRARY_SRC) -$(filter %.cpp.o,$(OBJS)): %.cpp.o: %.cpp $(GLOBAL_DEPS) - $(call COMPILEXX,$<,$@) - -vpath %.S $(LIBRARY_SRC) -$(filter %.S.o,$(OBJS)): %.S.o: %.S $(GLOBAL_DEPS) - $(call ASSEMBLE,$<,$@) - -# -# Built product rules -# - -$(LIBRARY_LIB): $(OBJS) $(GLOBAL_DEPS) - $(call ARCHIVE,$@,$(OBJS)) - -endif - -# -# Utility rules -# - -clean: - $(Q) $(REMOVE) $(LIBRARY_LIB) $(OBJS) diff --git a/makefiles/module.mk b/makefiles/module.mk deleted file mode 100644 index c92abaec3f..0000000000 --- a/makefiles/module.mk +++ /dev/null @@ -1,234 +0,0 @@ -# -# Copyright (c) 2012, 2013 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. -# - -# -# Framework makefile for PX4 modules -# -# This makefile is invoked by firmware.mk to build each of the modules -# that will subsequently be linked into the firmware image. -# -# Modules are built as prelinked objects with a limited set of exported -# symbols, as the global namespace is shared between all modules. Normally an -# module will just export one or more _main functions. -# -# IMPORTANT NOTE: -# -# This makefile assumes it is being invoked in the module's output directory. -# - -# -# Variables that can be set by the module's module.mk: -# -# -# SRCS (required) -# -# Lists the .c, cpp and .S files that should be compiled/assembled to -# produce the module. -# -# MODULE_COMMAND (optional) -# MODULE_ENTRYPOINT (optional if MODULE_COMMAND is set) -# MODULE_STACKSIZE (optional if MODULE_COMMAND is set) -# MODULE_PRIORITY (optional if MODULE_COMMAND is set) -# -# Defines a single builtin command exported by the module. -# MODULE_COMMAND must be unique for any configuration, but need not be the -# same as the module directory name. -# -# If MODULE_ENTRYPOINT is set, it names the function (which must be exported) -# that will be the entrypoint for the builtin command. It defaults to -# $(MODULE_COMMAND)_main. -# -# If MODULE_STACKSIZE is set, it is the size in bytes of the stack to be -# allocated for the builtin command. If it is not set, it defaults -# to CONFIG_PTHREAD_STACK_DEFAULT. -# -# If MODULE_PRIORITY is set, it is the thread priority for the builtin -# command. If it is not set, it defaults to SCHED_PRIORITY_DEFAULT. -# -# MODULE_COMMANDS (optional if MODULE_COMMAND is not set) -# -# Defines builtin commands exported by the module. Each word in -# the list should be formatted as: -# ... -# -# INCLUDE_DIRS (optional, must be appended) -# -# The list of directories searched for include files. If non-standard -# includes (e.g. those from another module) are required, paths to search -# can be added here. -# -# DEFAULT_VISIBILITY (optional) -# -# If not set, global symbols defined in a module will not be visible -# outside the module. Symbols that should be globally visible must be -# marked __EXPORT. -# If set, global symbols defined in a module will be globally visible. -# - -# -# Variables visible to the module's module.mk: -# -# CONFIG -# BOARD -# BOARD_FILE -# MODULE_WORK_DIR -# MODULE_OBJ -# MODULE_MK -# Anything set in setup.mk, board_$(BOARD).mk and the toolchain file. -# Anything exported from config_$(CONFIG).mk -# - -################################################################################ -# No user-serviceable parts below. -################################################################################ - -ifeq ($(MODULE_MK),) -$(error No module makefile specified) -endif -ifeq ($(V),1) -$(info %% MODULE_MK = $(MODULE_MK)) -endif - -# -# Get the board/toolchain config -# -include $(BOARD_FILE) - -# -# Get the module's config -# -include $(MODULE_MK) -MODULE_SRC := $(dir $(MODULE_MK)) -ifeq ($(V),1) -$(info % MODULE_NAME = $(MODULE_NAME)) -$(info % MODULE_SRC = $(MODULE_SRC)) -$(info % MODULE_OBJ = $(MODULE_OBJ)) -$(info % MODULE_WORK_DIR = $(MODULE_WORK_DIR)) -endif - -# -# Things that, if they change, might affect everything -# -GLOBAL_DEPS += $(MAKEFILE_LIST) - -################################################################################ -# Builtin command definitions -################################################################################ - -ifneq ($(MODULE_COMMAND),) -MODULE_ENTRYPOINT ?= $(MODULE_COMMAND)_main -MODULE_STACKSIZE ?= CONFIG_PTHREAD_STACK_DEFAULT -MODULE_PRIORITY ?= SCHED_PRIORITY_DEFAULT -MODULE_COMMANDS += $(MODULE_COMMAND).$(MODULE_PRIORITY).$(MODULE_STACKSIZE).$(MODULE_ENTRYPOINT) -CXXFLAGS += -DPX4_MAIN=$(MODULE_COMMAND)_app_main -endif - -ifneq ($(MODULE_COMMANDS),) -MODULE_COMMAND_FILES := $(addprefix $(WORK_DIR)/builtin_commands/COMMAND.,$(MODULE_COMMANDS)) - -# Create the command files -# Ensure that there is only one entry for each command -# -.PHONY: $(MODULE_COMMAND_FILES) -$(MODULE_COMMAND_FILES): command = $(word 2,$(subst ., ,$(notdir $(@)))) -$(MODULE_COMMAND_FILES): exclude = $(dir $@)COMMAND.$(command).* -$(MODULE_COMMAND_FILES): $(GLOBAL_DEPS) - @$(REMOVE) -f $(exclude) - @$(MKDIR) -p $(dir $@) - @$(ECHO) "CMD: $(command)" - $(Q) $(TOUCH) $@ -endif - -################################################################################ -# Adjust compilation flags to implement EXPORT -################################################################################ - -ifeq ($(DEFAULT_VISIBILITY),) -DEFAULT_VISIBILITY = hidden -else -DEFAULT_VISIBILITY = default -endif - -CFLAGS += -fvisibility=$(DEFAULT_VISIBILITY) -include $(PX4_INCLUDE_DIR)visibility.h -CXXFLAGS += -fvisibility=$(DEFAULT_VISIBILITY) -include $(PX4_INCLUDE_DIR)visibility.h - -################################################################################ -# Build rules -################################################################################ - -# -# What we're going to build -# -module: $(MODULE_OBJ) $(MODULE_COMMAND_FILES) - -# -# Object files we will generate from sources -# -OBJS = $(addsuffix .o,$(SRCS)) - -# -# Dependency files that will be auto-generated -# -DEPS = $(addsuffix .d,$(SRCS)) - -# -# SRCS -> OBJS rules -# - -$(OBJS): $(GLOBAL_DEPS) - -vpath %.c $(MODULE_SRC) -$(filter %.c.o,$(OBJS)): %.c.o: %.c $(GLOBAL_DEPS) - $(call COMPILE,$<,$@) - -vpath %.cpp $(MODULE_SRC) -$(filter %.cpp.o,$(OBJS)): %.cpp.o: %.cpp $(GLOBAL_DEPS) - $(call COMPILEXX,$<,$@) - -vpath %.S $(MODULE_SRC) -$(filter %.S.o,$(OBJS)): %.S.o: %.S $(GLOBAL_DEPS) - $(call ASSEMBLE,$<,$@) - -# -# Built product rules -# - -$(MODULE_OBJ): $(OBJS) $(GLOBAL_DEPS) - $(call PRELINK,$@,$(OBJS)) - -# -# Utility rules -# - -clean: - $(Q) $(REMOVE) $(MODULE_PRELINK) $(OBJS) - --include $(DEPS) diff --git a/makefiles/nuttx/board_aerocore.mk b/makefiles/nuttx/board_aerocore.mk deleted file mode 100644 index 71a0f264d0..0000000000 --- a/makefiles/nuttx/board_aerocore.mk +++ /dev/null @@ -1,11 +0,0 @@ -# -# Board-specific definitions for the Gumstix AeroCore -# - -# -# Configure the toolchain -# -CONFIG_ARCH = CORTEXM4F -CONFIG_BOARD = AEROCORE - -include $(PX4_MK_DIR)/nuttx/toolchain_gnu-arm-eabi.mk diff --git a/makefiles/nuttx/board_px4-stm32f4discovery.mk b/makefiles/nuttx/board_px4-stm32f4discovery.mk deleted file mode 100644 index 2477f55858..0000000000 --- a/makefiles/nuttx/board_px4-stm32f4discovery.mk +++ /dev/null @@ -1,11 +0,0 @@ -# -# Board-specific definitions for the PX4_STM32F4DISCOVERY -# - -# -# Configure the toolchain -# -CONFIG_ARCH = CORTEXM4F -CONFIG_BOARD = PX4_STM32F4DISCOVERY - -include $(PX4_MK_DIR)/nuttx/toolchain_gnu-arm-eabi.mk diff --git a/makefiles/nuttx/board_px4fmu-v1.mk b/makefiles/nuttx/board_px4fmu-v1.mk deleted file mode 100644 index 45156efcdc..0000000000 --- a/makefiles/nuttx/board_px4fmu-v1.mk +++ /dev/null @@ -1,11 +0,0 @@ -# -# Board-specific definitions for the PX4FMU -# - -# -# Configure the toolchain -# -CONFIG_ARCH = CORTEXM4F -CONFIG_BOARD = PX4FMU_V1 - -include $(PX4_MK_DIR)/nuttx/toolchain_gnu-arm-eabi.mk diff --git a/makefiles/nuttx/board_px4fmu-v2.mk b/makefiles/nuttx/board_px4fmu-v2.mk deleted file mode 100644 index 7c3e00c5d0..0000000000 --- a/makefiles/nuttx/board_px4fmu-v2.mk +++ /dev/null @@ -1,11 +0,0 @@ -# -# Board-specific definitions for the PX4FMUv2 -# - -# -# Configure the toolchain -# -CONFIG_ARCH = CORTEXM4F -CONFIG_BOARD = PX4FMU_V2 - -include $(PX4_MK_DIR)/nuttx/toolchain_gnu-arm-eabi.mk diff --git a/makefiles/nuttx/board_px4io-v1.mk b/makefiles/nuttx/board_px4io-v1.mk deleted file mode 100644 index 66731a5694..0000000000 --- a/makefiles/nuttx/board_px4io-v1.mk +++ /dev/null @@ -1,11 +0,0 @@ -# -# Board-specific definitions for the PX4IO -# - -# -# Configure the toolchain -# -CONFIG_ARCH = CORTEXM3 -CONFIG_BOARD = PX4IO_V1 - -include $(PX4_MK_DIR)/nuttx/toolchain_gnu-arm-eabi.mk diff --git a/makefiles/nuttx/board_px4io-v2.mk b/makefiles/nuttx/board_px4io-v2.mk deleted file mode 100644 index 94c3318199..0000000000 --- a/makefiles/nuttx/board_px4io-v2.mk +++ /dev/null @@ -1,11 +0,0 @@ -# -# Board-specific definitions for the PX4IOv2 -# - -# -# Configure the toolchain -# -CONFIG_ARCH = CORTEXM3 -CONFIG_BOARD = PX4IO_V2 - -include $(PX4_MK_DIR)/nuttx/toolchain_gnu-arm-eabi.mk diff --git a/makefiles/nuttx/config_aerocore_default.mk b/makefiles/nuttx/config_aerocore_default.mk deleted file mode 100644 index ba6bcdccde..0000000000 --- a/makefiles/nuttx/config_aerocore_default.mk +++ /dev/null @@ -1,126 +0,0 @@ -# -# Makefile for the AeroCore *default* configuration -# - -# -# Use the configuration's ROMFS. -# -ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/stm32 -MODULES += drivers/stm32/adc -MODULES += drivers/stm32/tone_alarm -MODULES += drivers/led -MODULES += drivers/px4fmu -MODULES += drivers/boards/aerocore -MODULES += drivers/lsm303d -MODULES += drivers/l3gd20 -MODULES += drivers/ms5611 -MODULES += drivers/gps -MODULES += drivers/pwm_out_sim -MODULES += modules/sensors - -# -# System commands -# -MODULES += systemcmds/ver -MODULES += systemcmds/mixer -MODULES += systemcmds/param -MODULES += systemcmds/perf -MODULES += systemcmds/pwm -MODULES += systemcmds/esc_calib -MODULES += systemcmds/reboot -MODULES += systemcmds/top -MODULES += systemcmds/config -MODULES += systemcmds/nshterm -MODULES += systemcmds/mtd -MODULES += systemcmds/dumpfile - -# -# General system control -# -MODULES += modules/commander -MODULES += modules/navigator -MODULES += modules/mavlink - -# -# Estimation modules (EKF / other filters) -# -# Too high RAM usage due to static allocations -#MODULES += modules/attitude_estimator_ekf -MODULES += modules/ekf_att_pos_estimator -MODULES += modules/attitude_estimator_q -MODULES += modules/position_estimator_inav - -# -# Vehicle Control -# -MODULES += modules/fw_pos_control_l1 -MODULES += modules/fw_att_control -MODULES += modules/mc_att_control -MODULES += modules/mc_pos_control - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/controllib -MODULES += modules/uORB -MODULES += modules/dataman - -# -# Libraries -# -LIBRARIES += lib/mathlib/CMSIS -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/ecl -MODULES += lib/external_lgpl -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion -MODULES += lib/launchdetection - -# -# Demo apps -# -#MODULES += examples/math_demo -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/hello_sky -MODULES += examples/px4_simple_app - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/daemon -#MODULES += examples/px4_daemon_app - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/debug_values -#MODULES += examples/px4_mavlink_debug - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/example_fixedwing_control -#MODULES += examples/fixedwing_control - -# Hardware test -#MODULES += examples/hwtest - -# -# Transitional support - add commands from the NuttX export archive. -# -# In general, these should move to modules over time. -# -# Each entry here is ... but we use a helper macro -# to make the table a bit more readable. -# -define _B - $(strip $1).$(or $(strip $2),SCHED_PRIORITY_DEFAULT).$(or $(strip $3),CONFIG_PTHREAD_STACK_DEFAULT).$(strip $4) -endef - -BUILTIN_COMMANDS := \ - $(call _B, hello, , 2048, hello_main) \ - $(call _B, i2c, , 2048, i2c_main) diff --git a/makefiles/nuttx/config_px4-stm32f4discovery_default.mk b/makefiles/nuttx/config_px4-stm32f4discovery_default.mk deleted file mode 100644 index 8f73a7f047..0000000000 --- a/makefiles/nuttx/config_px4-stm32f4discovery_default.mk +++ /dev/null @@ -1,92 +0,0 @@ -# -# Makefile for the px4fmu_default configuration -# - -# -# Use the configuration's ROMFS, copy the PX4_STM32F4DISCOVERY firmware into -# the ROMFS if it's available -# -ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common -ROMFS_OPTIONAL_FILES = - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/stm32 -MODULES += drivers/led -MODULES += drivers/boards/px4-stm32f4discovery - -# -# System commands -# -MODULES += systemcmds/bl_update -MODULES += systemcmds/mixer -MODULES += systemcmds/param -MODULES += systemcmds/perf -MODULES += systemcmds/reboot -MODULES += systemcmds/top -MODULES += systemcmds/tests -MODULES += systemcmds/config -MODULES += systemcmds/nshterm -MODULES += systemcmds/ver - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/controllib -MODULES += modules/uORB - -# -# Libraries -# -LIBRARIES += lib/mathlib/CMSIS -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/ecl -MODULES += lib/external_lgpl -MODULES += lib/geo -MODULES += lib/conversion -MODULES += platforms/nuttx - -# -# Demo apps -# -#MODULES += examples/math_demo -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/hello_sky -MODULES += examples/px4_simple_app - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/daemon -#MODULES += examples/px4_daemon_app - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/debug_values -#MODULES += examples/px4_mavlink_debug - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/example_fixedwing_control -#MODULES += examples/fixedwing_control - -# Hardware test -#MODULES += examples/hwtest - -# -# Transitional support - add commands from the NuttX export archive. -# -# In general, these should move to modules over time. -# -# Each entry here is ... but we use a helper macro -# to make the table a bit more readable. -# -define _B - $(strip $1).$(or $(strip $2),SCHED_PRIORITY_DEFAULT).$(or $(strip $3),CONFIG_PTHREAD_STACK_DEFAULT).$(strip $4) -endef - -# command priority stack entrypoint -BUILTIN_COMMANDS := \ - $(call _B, sercon, , 2048, sercon_main ) \ - $(call _B, serdis, , 2048, serdis_main ) diff --git a/makefiles/nuttx/config_px4fmu-v1_default.mk b/makefiles/nuttx/config_px4fmu-v1_default.mk deleted file mode 100644 index d7915ee8d0..0000000000 --- a/makefiles/nuttx/config_px4fmu-v1_default.mk +++ /dev/null @@ -1,159 +0,0 @@ -# -# Makefile for the px4fmu_default configuration -# - -# -# Use the configuration's ROMFS. -# -ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common -ROMFS_OPTIONAL_FILES = $(PX4_BASE)/Images/px4io-v1_default.bin - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/stm32 -MODULES += drivers/stm32/adc -MODULES += drivers/stm32/tone_alarm -MODULES += drivers/led -MODULES += drivers/px4io -MODULES += drivers/px4fmu -MODULES += drivers/boards/px4fmu-v1 -MODULES += drivers/ardrone_interface -MODULES += drivers/l3gd20 -MODULES += drivers/mpu6000 -MODULES += drivers/hmc5883 -MODULES += drivers/ms5611 -MODULES += drivers/ll40ls -MODULES += drivers/trone -MODULES += drivers/mb12xx -MODULES += drivers/gps -MODULES += drivers/pwm_out_sim -MODULES += drivers/blinkm -MODULES += drivers/rgbled -MODULES += drivers/mkblctrl -MODULES += drivers/airspeed -MODULES += drivers/ets_airspeed -MODULES += drivers/meas_airspeed -MODULES += drivers/frsky_telemetry -MODULES += modules/sensors -MODULES += drivers/px4flow - -# -# System commands -# -MODULES += systemcmds/mtd -MODULES += systemcmds/mixer -MODULES += systemcmds/param -MODULES += systemcmds/perf -MODULES += systemcmds/pwm -MODULES += systemcmds/esc_calib -MODULES += systemcmds/reboot -MODULES += systemcmds/top -MODULES += systemcmds/config -MODULES += systemcmds/nshterm -MODULES += systemcmds/dumpfile -MODULES += systemcmds/ver - -# -# General system control -# -MODULES += modules/commander -MODULES += modules/navigator -MODULES += modules/mavlink -MODULES += modules/gpio_led -MODULES += modules/land_detector - -# -# Estimation modules (EKF / other filters) -# -# Too high RAM usage due to static allocations -#MODULES += modules/attitude_estimator_ekf -MODULES += modules/ekf_att_pos_estimator -MODULES += modules/attitude_estimator_q -MODULES += modules/position_estimator_inav - -# -# Vehicle Control -# -MODULES += modules/fw_pos_control_l1 -MODULES += modules/fw_att_control -MODULES += modules/mc_att_control -MODULES += modules/mc_pos_control - -# -# Logging -# -MODULES += modules/sdlog2 - -# -# Unit tests -# -#MODULES += modules/unit_test -#MODULES += modules/commander/commander_tests - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/controllib -MODULES += modules/uORB -MODULES += modules/dataman - -# -# Libraries -# -LIBRARIES += lib/mathlib/CMSIS -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/ecl -MODULES += lib/external_lgpl -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion -MODULES += lib/launchdetection -MODULES += platforms/nuttx - -# -# Demo apps -# -#MODULES += examples/math_demo -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/hello_sky -#MODULES += examples/px4_simple_app - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/daemon -#MODULES += examples/px4_daemon_app - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/debug_values -#MODULES += examples/px4_mavlink_debug - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/example_fixedwing_control -#MODULES += examples/fixedwing_control - -# Hardware test -#MODULES += examples/hwtest - -# Generate parameter XML file -GEN_PARAM_XML = 1 - -# -# Transitional support - add commands from the NuttX export archive. -# -# In general, these should move to modules over time. -# -# Each entry here is ... but we use a helper macro -# to make the table a bit more readable. -# -define _B - $(strip $1).$(or $(strip $2),SCHED_PRIORITY_DEFAULT).$(or $(strip $3),CONFIG_PTHREAD_STACK_DEFAULT).$(strip $4) -endef - -# command priority stack entrypoint -BUILTIN_COMMANDS := \ - $(call _B, sercon, , 2048, sercon_main ) \ - $(call _B, serdis, , 2048, serdis_main ) diff --git a/makefiles/nuttx/config_px4fmu-v2_default.mk b/makefiles/nuttx/config_px4fmu-v2_default.mk deleted file mode 100644 index 8d16e538a0..0000000000 --- a/makefiles/nuttx/config_px4fmu-v2_default.mk +++ /dev/null @@ -1,182 +0,0 @@ -# -# Makefile for the px4fmu_default configuration -# - -# -# Use the configuration's ROMFS, copy the px4iov2 firmware into -# the ROMFS if it's available -# -ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common -ROMFS_OPTIONAL_FILES = $(PX4_BASE)/Images/px4io-v2_default.bin - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/stm32 -MODULES += drivers/stm32/adc -MODULES += drivers/stm32/tone_alarm -MODULES += drivers/led -MODULES += drivers/px4fmu -MODULES += drivers/px4io -MODULES += drivers/boards/px4fmu-v2 -MODULES += drivers/rgbled -MODULES += drivers/mpu6000 -MODULES += drivers/mpu9250 -MODULES += drivers/lsm303d -MODULES += drivers/l3gd20 -MODULES += drivers/hmc5883 -MODULES += drivers/ms5611 -MODULES += drivers/mb12xx -MODULES += drivers/sf0x -MODULES += drivers/ll40ls -MODULES += drivers/trone -MODULES += drivers/gps -MODULES += drivers/pwm_out_sim -MODULES += drivers/hott -MODULES += drivers/hott/hott_telemetry -MODULES += drivers/hott/hott_sensors -MODULES += drivers/blinkm -MODULES += drivers/airspeed -MODULES += drivers/ets_airspeed -MODULES += drivers/meas_airspeed -MODULES += drivers/frsky_telemetry -MODULES += modules/sensors -MODULES += drivers/mkblctrl -MODULES += drivers/px4flow -MODULES += drivers/oreoled -MODULES += drivers/gimbal -MODULES += drivers/pwm_input -MODULES += drivers/camera_trigger - -# -# System commands -# -MODULES += systemcmds/bl_update -MODULES += systemcmds/mixer -MODULES += systemcmds/param -MODULES += systemcmds/perf -MODULES += systemcmds/pwm -MODULES += systemcmds/esc_calib -MODULES += systemcmds/reboot -MODULES += systemcmds/top -MODULES += systemcmds/config -MODULES += systemcmds/nshterm -MODULES += systemcmds/mtd -MODULES += systemcmds/dumpfile -MODULES += systemcmds/ver - -# -# General system control -# -MODULES += modules/commander -MODULES += modules/navigator -MODULES += modules/mavlink -MODULES += modules/gpio_led -MODULES += modules/uavcan -MODULES += modules/land_detector - -# -# Estimation modules (EKF/ SO3 / other filters) -# -# Removed from build due to large static allocations -#MODULES += modules/attitude_estimator_ekf -MODULES += modules/attitude_estimator_q -MODULES += modules/ekf_att_pos_estimator -MODULES += modules/position_estimator_inav - -# -# Vehicle Control -# -#MODULES += modules/segway # XXX Needs GCC 4.7 fix -MODULES += modules/fw_pos_control_l1 -MODULES += modules/fw_att_control -MODULES += modules/mc_att_control -MODULES += modules/mc_pos_control -MODULES += modules/vtol_att_control - -# -# Logging -# -MODULES += modules/sdlog2 - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/controllib -MODULES += modules/uORB -MODULES += modules/dataman - -# -# Libraries -# -LIBRARIES += lib/mathlib/CMSIS -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/ecl -MODULES += lib/external_lgpl -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion -MODULES += lib/launchdetection -MODULES += platforms/nuttx - -# -# OBC challenge -# -MODULES += modules/bottle_drop - -# -# PX4 flow estimator, good for indoors -# -MODULES += examples/flow_position_estimator - -# -# Rover apps -# -MODULES += examples/rover_steering_control - -# -# Demo apps -# -#MODULES += examples/math_demo -# Tutorial code from -# https://px4.io/dev/px4_simple_app -#MODULES += examples/px4_simple_app - -# Tutorial code from -# https://px4.io/dev/daemon -#MODULES += examples/px4_daemon_app - -# Tutorial code from -# https://px4.io/dev/debug_values -#MODULES += examples/px4_mavlink_debug - -# Tutorial code from -# https://px4.io/dev/example_fixedwing_control -#MODULES += examples/fixedwing_control - -# Hardware test -#MODULES += examples/hwtest - -# Generate parameter XML file -GEN_PARAM_XML = 1 - -# -# Transitional support - add commands from the NuttX export archive. -# -# In general, these should move to modules over time. -# -# Each entry here is ... but we use a helper macro -# to make the table a bit more readable. -# -define _B - $(strip $1).$(or $(strip $2),SCHED_PRIORITY_DEFAULT).$(or $(strip $3),CONFIG_PTHREAD_STACK_DEFAULT).$(strip $4) -endef - -# command priority stack entrypoint -BUILTIN_COMMANDS := \ - $(call _B, sercon, , 2048, sercon_main ) \ - $(call _B, serdis, , 2048, serdis_main ) diff --git a/makefiles/nuttx/config_px4fmu-v2_multiplatform.mk b/makefiles/nuttx/config_px4fmu-v2_multiplatform.mk deleted file mode 100644 index 41fc34023f..0000000000 --- a/makefiles/nuttx/config_px4fmu-v2_multiplatform.mk +++ /dev/null @@ -1,168 +0,0 @@ -# -# Makefile for the px4fmu_default configuration -# - -# -# Use the configuration's ROMFS, copy the px4iov2 firmware into -# the ROMFS if it's available -# -ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common -ROMFS_OPTIONAL_FILES = $(PX4_BASE)/Images/px4io-v2_default.bin - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/stm32 -MODULES += drivers/stm32/adc -MODULES += drivers/stm32/tone_alarm -MODULES += drivers/led -MODULES += drivers/px4fmu -MODULES += drivers/px4io -MODULES += drivers/boards/px4fmu-v2 -MODULES += drivers/rgbled -MODULES += drivers/mpu6000 -MODULES += drivers/lsm303d -MODULES += drivers/l3gd20 -MODULES += drivers/hmc5883 -MODULES += drivers/ms5611 -MODULES += drivers/mb12xx -# MODULES += drivers/sf0x -MODULES += drivers/ll40ls -# MODULES += drivers/trone -MODULES += drivers/gps -MODULES += drivers/pwm_out_sim -MODULES += drivers/hott -MODULES += drivers/hott/hott_telemetry -MODULES += drivers/hott/hott_sensors -# MODULES += drivers/blinkm -MODULES += drivers/airspeed -MODULES += drivers/ets_airspeed -MODULES += drivers/meas_airspeed -MODULES += drivers/frsky_telemetry -MODULES += modules/sensors -MODULES += drivers/mkblctrl -MODULES += drivers/px4flow - -# -# System commands -# -MODULES += systemcmds/bl_update -MODULES += systemcmds/mixer -MODULES += systemcmds/param -MODULES += systemcmds/perf -MODULES += systemcmds/pwm -MODULES += systemcmds/esc_calib -MODULES += systemcmds/reboot -MODULES += systemcmds/top -MODULES += systemcmds/config -MODULES += systemcmds/nshterm -MODULES += systemcmds/mtd -MODULES += systemcmds/dumpfile -MODULES += systemcmds/ver - -# -# General system control -# -MODULES += modules/commander -MODULES += modules/navigator -MODULES += modules/mavlink -MODULES += modules/gpio_led -# MODULES += modules/uavcan - -# -# Estimation modules (EKF/ SO3 / other filters) -# -MODULES += modules/attitude_estimator_ekf -MODULES += modules/ekf_att_pos_estimator -MODULES += modules/position_estimator_inav - -# -# Vehicle Control -# -#MODULES += modules/segway # XXX Needs GCC 4.7 fix -#MODULES += modules/fw_pos_control_l1 -#MODULES += modules/fw_att_control -# MODULES += modules/mc_att_control -MODULES += modules/mc_att_control_multiplatform -MODULES += examples/subscriber -MODULES += examples/publisher -# MODULES += modules/mc_pos_control -MODULES += modules/mc_pos_control_multiplatform -MODULES += modules/vtol_att_control - -# -# Logging -# -MODULES += modules/sdlog2 - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/controllib -MODULES += modules/uORB -MODULES += modules/dataman - -# -# Libraries -# -LIBRARIES += lib/mathlib/CMSIS -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/ecl -MODULES += lib/external_lgpl -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion -MODULES += lib/launchdetection -MODULES += platforms/nuttx - -# -# OBC challenge -# -MODULES += modules/bottle_drop - -# -# Demo apps -# -#MODULES += examples/math_demo -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/hello_sky -#MODULES += examples/px4_simple_app - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/daemon -#MODULES += examples/px4_daemon_app - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/debug_values -#MODULES += examples/px4_mavlink_debug - -# Tutorial code from -# https://pixhawk.ethz.ch/px4/dev/example_fixedwing_control -#MODULES += examples/fixedwing_control - -# Hardware test -#MODULES += examples/hwtest - -# Generate parameter XML file -GEN_PARAM_XML = 1 - -# -# Transitional support - add commands from the NuttX export archive. -# -# In general, these should move to modules over time. -# -# Each entry here is ... but we use a helper macro -# to make the table a bit more readable. -# -define _B - $(strip $1).$(or $(strip $2),SCHED_PRIORITY_DEFAULT).$(or $(strip $3),CONFIG_PTHREAD_STACK_DEFAULT).$(strip $4) -endef - -# command priority stack entrypoint -BUILTIN_COMMANDS := \ - $(call _B, sercon, , 2048, sercon_main ) \ - $(call _B, serdis, , 2048, serdis_main ) diff --git a/makefiles/nuttx/config_px4fmu-v2_test.mk b/makefiles/nuttx/config_px4fmu-v2_test.mk deleted file mode 100644 index 9c8510e06d..0000000000 --- a/makefiles/nuttx/config_px4fmu-v2_test.mk +++ /dev/null @@ -1,116 +0,0 @@ -# -# Makefile for the px4fmu_default configuration -# - -# -# Use the configuration's ROMFS. -# -ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_test -ROMFS_OPTIONAL_FILES = $(PX4_BASE)/Images/px4io-v2_default.bin - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/stm32 -MODULES += drivers/stm32/adc -MODULES += drivers/stm32/tone_alarm -MODULES += drivers/led -MODULES += drivers/boards/px4fmu-v2 -MODULES += drivers/px4io -MODULES += drivers/rgbled -MODULES += drivers/mpu6000 -MODULES += drivers/lsm303d -MODULES += drivers/l3gd20 -MODULES += drivers/hmc5883 -MODULES += drivers/ms5611 -MODULES += drivers/pca8574 -MODULES += drivers/roboclaw -MODULES += drivers/airspeed -MODULES += drivers/ets_airspeed -MODULES += drivers/meas_airspeed -MODULES += systemcmds/perf -MODULES += systemcmds/reboot -MODULES += systemcmds/tests -MODULES += systemcmds/nshterm -MODULES += systemcmds/mtd -MODULES += systemcmds/ver -MODULES += systemcmds/top -MODULES += modules/sensors - -# -# System commands -# -MODULES += systemcmds/bl_update -MODULES += systemcmds/mixer -MODULES += systemcmds/param -MODULES += systemcmds/perf -MODULES += systemcmds/pwm -MODULES += systemcmds/esc_calib -MODULES += systemcmds/reboot -MODULES += systemcmds/top -MODULES += systemcmds/config -MODULES += systemcmds/nshterm -MODULES += systemcmds/mtd -MODULES += systemcmds/dumpfile -MODULES += systemcmds/ver - -# -# Example modules -# -MODULES += examples/matlab_csv_serial -MODULES += examples/subscriber -MODULES += examples/publisher - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/uORB -LIBRARIES += lib/mathlib/CMSIS -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/conversion -MODULES += platforms/nuttx - -# -# Example modules to test-build -# -MODULES += examples/flow_position_estimator -MODULES += examples/fixedwing_control -MODULES += examples/hwtest -MODULES += examples/matlab_csv_serial -MODULES += examples/px4_daemon_app -MODULES += examples/px4_mavlink_debug -MODULES += examples/px4_simple_app - -# -# Drivers / modules to test build, but not useful for test environment -# -MODULES += drivers/pca8574 - -# -# Tests -# - -MODULES += modules/unit_test -MODULES += modules/mavlink/mavlink_tests -MODULES += modules/commander/commander_tests - -# -# Transitional support - add commands from the NuttX export archive. -# -# In general, these should move to modules over time. -# -# Each entry here is ... but we use a helper macro -# to make the table a bit more readable. -# -define _B - $(strip $1).$(or $(strip $2),SCHED_PRIORITY_DEFAULT).$(or $(strip $3),CONFIG_PTHREAD_STACK_DEFAULT).$(strip $4) -endef - -# command priority stack entrypoint -BUILTIN_COMMANDS := \ - $(call _B, sercon, , 2048, sercon_main ) \ - $(call _B, serdis, , 2048, serdis_main ) diff --git a/makefiles/nuttx/config_px4io-v1_default.mk b/makefiles/nuttx/config_px4io-v1_default.mk deleted file mode 100644 index 73f8adf202..0000000000 --- a/makefiles/nuttx/config_px4io-v1_default.mk +++ /dev/null @@ -1,10 +0,0 @@ -# -# Makefile for the px4io_default configuration -# - -# -# Board support modules -# -MODULES += drivers/stm32 -MODULES += drivers/boards/px4io-v1 -MODULES += modules/px4iofirmware \ No newline at end of file diff --git a/makefiles/nuttx/config_px4io-v2_default.mk b/makefiles/nuttx/config_px4io-v2_default.mk deleted file mode 100644 index dbeaba3d37..0000000000 --- a/makefiles/nuttx/config_px4io-v2_default.mk +++ /dev/null @@ -1,10 +0,0 @@ -# -# Makefile for the px4iov2_default configuration -# - -# -# Board support modules -# -MODULES += drivers/stm32 -MODULES += drivers/boards/px4io-v2 -MODULES += modules/px4iofirmware \ No newline at end of file diff --git a/makefiles/nuttx/firmware_nuttx.mk b/makefiles/nuttx/firmware_nuttx.mk deleted file mode 100644 index ca4831b8bd..0000000000 --- a/makefiles/nuttx/firmware_nuttx.mk +++ /dev/null @@ -1,121 +0,0 @@ -# -# Built products -# -DESIRED_FIRMWARES = $(foreach config,$(CONFIGS),$(IMAGE_DIR)$(config).px4) -STAGED_FIRMWARES = $(foreach config,$(KNOWN_CONFIGS),$(IMAGE_DIR)$(config).px4) -FIRMWARES = $(foreach config,$(KNOWN_CONFIGS),$(BUILD_DIR)$(config).build/firmware.px4) - -all: $(DESIRED_FIRMWARES) - -# -# Copy FIRMWARES into the image directory. -# -# XXX copying the .bin files is a hack to work around the PX4IO uploader -# not supporting .px4 files, and it should be deprecated onced that -# is taken care of. -# -$(STAGED_FIRMWARES): $(IMAGE_DIR)%.px4: $(BUILD_DIR)%.build/firmware.px4 - @$(ECHO) %% Copying $@ - $(Q) $(COPY) $< $@ - $(Q) $(COPY) $(patsubst %.px4,%.bin,$<) $(patsubst %.px4,%.bin,$@) - -# -# Generate FIRMWARES. -# -.PHONY: $(FIRMWARES) -$(BUILD_DIR)%.build/firmware.px4: config = $(patsubst $(BUILD_DIR)%.build/firmware.px4,%,$@) -$(BUILD_DIR)%.build/firmware.px4: work_dir = $(BUILD_DIR)$(config).build/ -$(FIRMWARES): $(BUILD_DIR)%.build/firmware.px4: checkgitversion generateuorbtopicheaders checksubmodules - @$(ECHO) %%%% - @$(ECHO) %%%% Building $(config) in $(work_dir) - @$(ECHO) %%%% - $(Q) $(MKDIR) -p $(work_dir) - $(Q) $(MAKE) -r --no-print-directory -C $(work_dir) \ - -f $(PX4_MK_DIR)firmware.mk \ - CONFIG=$(config) \ - WORK_DIR=$(work_dir) \ - $(FIRMWARE_GOAL) - -# -# Make FMU firmwares depend on the corresponding IO firmware. -# -# This is a pretty vile hack, since it hard-codes knowledge of the FMU->IO dependency -# and forces the _default config in all cases. There has to be a better way to do this... -# -FMU_VERSION = $(patsubst px4fmu-%,%,$(word 1, $(subst _, ,$(1)))) -define FMU_DEP -$(BUILD_DIR)$(1).build/firmware.px4: $(IMAGE_DIR)px4io-$(call FMU_VERSION,$(1))_default.px4 -endef -FMU_CONFIGS := $(filter px4fmu%,$(CONFIGS)) -$(foreach config,$(FMU_CONFIGS),$(eval $(call FMU_DEP,$(config)))) - -# -# Build the NuttX export archives. -# -# Note that there are no explicit dependencies extended from these -# archives. If NuttX is updated, the user is expected to rebuild the -# archives/build area manually. Likewise, when the 'archives' target is -# invoked, all archives are always rebuilt. -# -# XXX Should support fetching/unpacking from a separate directory to permit -# downloads of the prebuilt archives as well... -# -NUTTX_ARCHIVES = $(foreach board,$(BOARDS),$(ARCHIVE_DIR)$(board).export) -.PHONY: archives -archives: checksubmodules $(NUTTX_ARCHIVES) - -# We cannot build these parallel; note that we also force -j1 for the -# sub-make invocations. -ifneq ($(filter archives,$(MAKECMDGOALS)),) -.NOTPARALLEL: -endif - -J?=1 - -$(ARCHIVE_DIR)%.export: board = $(notdir $(basename $@)) -$(ARCHIVE_DIR)%.export: configuration = nsh -$(NUTTX_ARCHIVES): $(ARCHIVE_DIR)%.export: $(NUTTX_SRC) - @$(ECHO) %% Configuring NuttX for $(board) - $(Q) (cd $(NUTTX_SRC) && $(RMDIR) nuttx-export) - $(Q) $(MAKE) -r -j$(J) --no-print-directory -C $(NUTTX_SRC) -r $(MQUIET) distclean - $(Q) (cd $(NUTTX_SRC)/configs && $(COPYDIR) $(PX4_BASE)nuttx-configs/$(board) .) - $(Q) (cd $(NUTTX_SRC)tools && ./configure.sh $(board)/$(configuration)) - @$(ECHO) %% Exporting NuttX for $(board) - $(Q) $(MAKE) -r -j$(J) --no-print-directory -C $(NUTTX_SRC) -r $(MQUIET) CONFIG_ARCH_BOARD=$(board) export - $(Q) $(MKDIR) -p $(dir $@) - $(Q) $(COPY) $(NUTTX_SRC)nuttx-export.zip $@ - $(Q) (cd $(NUTTX_SRC)/configs && $(RMDIR) $(board)) - -# -# The user can run the NuttX 'menuconfig' tool for a single board configuration with -# make BOARDS= menuconfig -# -ifeq ($(MAKECMDGOALS),menuconfig) -ifneq ($(words $(BOARDS)),1) -$(error BOARDS must specify exactly one board for the menuconfig goal) -endif -BOARD = $(BOARDS) -menuconfig: $(NUTTX_SRC) - @$(ECHO) %% Configuring NuttX for $(BOARD) - $(Q) (cd $(NUTTX_SRC) && $(RMDIR) nuttx-export) - $(Q) $(MAKE) -r -j$(J) --no-print-directory -C $(NUTTX_SRC) -r $(MQUIET) distclean - $(Q) (cd $(NUTTX_SRC)/configs && $(COPYDIR) $(PX4_BASE)nuttx-configs/$(BOARD) .) - $(Q) (cd $(NUTTX_SRC)tools && ./configure.sh $(BOARD)/nsh) - @$(ECHO) %% Running menuconfig for $(BOARD) - $(Q) $(MAKE) -r -j$(J) --no-print-directory -C $(NUTTX_SRC) -r $(MQUIET) oldconfig - $(Q) $(MAKE) -r -j$(J) --no-print-directory -C $(NUTTX_SRC) -r $(MQUIET) menuconfig - @$(ECHO) %% Saving configuration file - $(Q)$(COPY) $(NUTTX_SRC).config $(PX4_BASE)nuttx-configs/$(BOARD)/nsh/defconfig -else -menuconfig: - @$(ECHO) "" - @$(ECHO) "The menuconfig goal must be invoked without any other goal being specified" - @$(ECHO) "" - -endif - -$(NUTTX_SRC): checkgitversion checksubmodules - -$(UAVCAN_DIR): - $(Q) (./Tools/check_submodules.sh) - diff --git a/makefiles/nuttx/gumstix-aerocore.cfg b/makefiles/nuttx/gumstix-aerocore.cfg deleted file mode 100644 index ba217c0431..0000000000 --- a/makefiles/nuttx/gumstix-aerocore.cfg +++ /dev/null @@ -1,10 +0,0 @@ -# JTAG for the STM32F4x chip used on the Gumstix AeroCore is available on -# the first interface of a Quad FTDI chip. nTRST is bit 4. -interface ftdi -ftdi_vid_pid 0x0403 0x6011 - -ftdi_layout_init 0x0000 0x001b -ftdi_layout_signal nTRST -data 0x0010 - -source [find target/stm32f4x.cfg] -reset_config trst_only diff --git a/makefiles/nuttx/nuttx.mk b/makefiles/nuttx/nuttx.mk deleted file mode 100644 index 4ca1dc2ac6..0000000000 --- a/makefiles/nuttx/nuttx.mk +++ /dev/null @@ -1,85 +0,0 @@ -# -# 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. -# - -# -# Rules and definitions related to handling the NuttX export archives when -# building firmware. -# - -MODULES += platforms/nuttx/px4_layer platforms/common - -# -# Check that the NuttX archive for the selected board is available. -# -NUTTX_ARCHIVE := $(wildcard $(ARCHIVE_DIR)$(BOARD).export) -ifeq ($(NUTTX_ARCHIVE),) -$(error The NuttX export archive for $(BOARD) is missing from $(ARCHIVE_DIR) - try 'make archives' in $(PX4_BASE)) -endif - -# -# The NuttX config header should always be present in the NuttX archive, and -# if it changes, everything should be rebuilt. So, use it as the trigger to -# unpack the NuttX archive. -# -NUTTX_EXPORT_DIR = $(WORK_DIR)nuttx-export/ -NUTTX_CONFIG_HEADER = $(NUTTX_EXPORT_DIR)include/nuttx/config.h -$(info % NUTTX_EXPORT_DIR = $(NUTTX_EXPORT_DIR)) -$(info % NUTTX_CONFIG_HEADER = $(NUTTX_CONFIG_HEADER)) - - -GLOBAL_DEPS += $(NUTTX_CONFIG_HEADER) - -# -# Use the linker script from the NuttX export -# -LDSCRIPT += $(NUTTX_EXPORT_DIR)build/ld.script - -# -# Add directories from the NuttX export to the relevant search paths -# -INCLUDE_DIRS += $(NUTTX_EXPORT_DIR)include \ - $(NUTTX_EXPORT_DIR)include/cxx \ - $(NUTTX_EXPORT_DIR)arch/chip \ - $(NUTTX_EXPORT_DIR)arch/common - -LIB_DIRS += $(NUTTX_EXPORT_DIR)libs -LIBS += -lapps -lnuttx -NUTTX_LIBS = $(NUTTX_EXPORT_DIR)libs/libapps.a \ - $(NUTTX_EXPORT_DIR)libs/libnuttx.a -LINK_DEPS += $(NUTTX_LIBS) - -$(NUTTX_CONFIG_HEADER): $(NUTTX_ARCHIVE) - @$(ECHO) %% Unpacking $(NUTTX_ARCHIVE) - $(Q) $(UNZIP_CMD) -q -o -d $(WORK_DIR) $(NUTTX_ARCHIVE) - $(Q) $(TOUCH) $@ - - $(LDSCRIPT): $(NUTTX_CONFIG_HEADER) - $(NUTTX_LIBS): $(NUTTX_CONFIG_HEADER) diff --git a/makefiles/nuttx/nuttx_px4.mk b/makefiles/nuttx/nuttx_px4.mk deleted file mode 100644 index 11e50e03ae..0000000000 --- a/makefiles/nuttx/nuttx_px4.mk +++ /dev/null @@ -1,89 +0,0 @@ -# -# 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. -# - -# -# What we're going to build. -# -PRODUCT_BUNDLE = $(WORK_DIR)firmware.px4 -PRODUCT_BIN = $(WORK_DIR)firmware.bin -PRODUCT_ELF = $(WORK_DIR)firmware.elf -PRODUCT_PARAMXML = $(WORK_DIR)/parameters.xml -PRODUCT_AIRFRAMEXML = $(WORK_DIR)/airframes.xml - -.PHONY: firmware -firmware: $(PRODUCT_BUNDLE) - -# -# Built product rules -# - -$(PRODUCT_BUNDLE): $(PRODUCT_BIN) - @$(ECHO) %% Generating $@ -ifdef GEN_PARAM_XML - $(Q) $(PYTHON) $(PX4_BASE)/Tools/px_process_params.py --src-path $(PX4_BASE)/src --board CONFIG_ARCH_BOARD_$(CONFIG_BOARD) --xml - $(Q) $(PYTHON) $(PX4_BASE)/Tools/px_process_airframes.py -a $(PX4_BASE)/ROMFS/px4fmu_common/init.d/ --board CONFIG_ARCH_BOARD_$(CONFIG_BOARD) --xml - $(Q) $(MKFW) --prototype $(IMAGE_DIR)/$(BOARD).prototype \ - --git_identity $(PX4_BASE) \ - --parameter_xml $(PRODUCT_PARAMXML) \ - --airframe_xml $(PRODUCT_AIRFRAMEXML) \ - --image $< > $@ -else - $(Q) $(MKFW) --prototype $(IMAGE_DIR)/$(BOARD).prototype \ - --git_identity $(PX4_BASE) \ - --image $< > $@ -endif - -$(PRODUCT_BIN): $(PRODUCT_ELF) - $(call SYM_TO_BIN,$<,$@) - -$(PRODUCT_ELF): $(OBJS) $(MODULE_OBJS) $(LIBRARY_LIBS) $(GLOBAL_DEPS) $(LINK_DEPS) $(MODULE_MKFILES) - $(call LINK,$@,$(OBJS) $(MODULE_OBJS) $(LIBRARY_LIBS)) - -# -# Utility rules -# - -.PHONY: upload -upload: $(PRODUCT_BUNDLE) $(PRODUCT_BIN) - $(Q) $(MAKE) -f $(PX4_MK_DIR)/nuttx/upload.mk \ - METHOD=serial \ - CONFIG=$(CONFIG) \ - BOARD=$(BOARD) \ - BUNDLE=$(PRODUCT_BUNDLE) \ - BIN=$(PRODUCT_BIN) - -.PHONY: clean -clean: $(MODULE_CLEANS) - @$(ECHO) %% cleaning - $(Q) $(REMOVE) $(PRODUCT_BUNDLE) $(PRODUCT_BIN) $(PRODUCT_ELF) - $(Q) $(REMOVE) $(OBJS) $(DEP_INCLUDES) $(EXTRA_CLEANS) - $(Q) $(RMDIR) $(NUTTX_EXPORT_DIR) - diff --git a/makefiles/nuttx/nuttx_romfs.mk b/makefiles/nuttx/nuttx_romfs.mk deleted file mode 100644 index 9554151360..0000000000 --- a/makefiles/nuttx/nuttx_romfs.mk +++ /dev/null @@ -1,163 +0,0 @@ -# -# 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. -# - -################################################################################ -# ROMFS generation -################################################################################ - -ifneq ($(ROMFS_ROOT),) -ifeq ($(wildcard $(ROMFS_ROOT)),) -$(error ROMFS_ROOT specifies a directory that does not exist) -endif - -# -# Note that there is no support for more than one root directory or constructing -# a root from several templates. That would be a nice feature. -# - -# Add dependencies on anything in the ROMFS root directory -ROMFS_FILES += $(wildcard \ - $(ROMFS_ROOT)/* \ - $(ROMFS_ROOT)/*/* \ - $(ROMFS_ROOT)/*/*/* \ - $(ROMFS_ROOT)/*/*/*/* \ - $(ROMFS_ROOT)/*/*/*/*/* \ - $(ROMFS_ROOT)/*/*/*/*/*/*) -ifeq ($(ROMFS_FILES),) -$(error ROMFS_ROOT $(ROMFS_ROOT) specifies a directory containing no files) -endif -ROMFS_DEPS += $(ROMFS_FILES) - -# Extra files that may be copied into the ROMFS /extras directory -# ROMFS_EXTRA_FILES are required, ROMFS_OPTIONAL_FILES are optional -ROMFS_EXTRA_FILES += $(wildcard $(ROMFS_OPTIONAL_FILES)) -ROMFS_DEPS += $(ROMFS_EXTRA_FILES) - -ROMFS_IMG = romfs.img -ROMFS_SCRATCH = romfs_scratch -ROMFS_CSRC = $(ROMFS_IMG:.img=.c) -ROMFS_OBJ = $(ROMFS_CSRC:.c=.o) -LIBS += $(ROMFS_OBJ) -LINK_DEPS += $(ROMFS_OBJ) - -# Add autostart script -ROMFS_AUTOSTART = $(PX4_BASE)/Tools/px_process_airframes.py - -# Remove all comments from startup and mixer files -ROMFS_PRUNER = $(PX4_BASE)/Tools/px_romfs_pruner.py - -# Turn the ROMFS image into an object file -$(ROMFS_OBJ): $(ROMFS_IMG) $(GLOBAL_DEPS) - $(call BIN_TO_OBJ,$<,$@,romfs_img) - -# Generate the ROMFS image from the root -$(ROMFS_IMG): $(ROMFS_SCRATCH) $(ROMFS_DEPS) $(GLOBAL_DEPS) - @$(ECHO) "ROMFS: $@" - $(Q) $(GENROMFS) -f $@ -d $(ROMFS_SCRATCH) -V "NSHInitVol" - -# Construct the ROMFS scratch root from the canonical root -$(ROMFS_SCRATCH): $(ROMFS_DEPS) $(GLOBAL_DEPS) - $(Q) $(MKDIR) -p $(ROMFS_SCRATCH) - $(Q) $(COPYDIR) $(ROMFS_ROOT)/* $(ROMFS_SCRATCH) -# delete all files in ROMFS_SCRATCH which start with a . or end with a ~ - $(Q) $(RM) $(ROMFS_SCRATCH)/*/.[!.]* $(ROMFS_SCRATCH)/*/*~ -ifneq ($(ROMFS_EXTRA_FILES),) - $(Q) $(MKDIR) -p $(ROMFS_SCRATCH)/extras - $(Q) $(COPY) $(ROMFS_EXTRA_FILES) $(ROMFS_SCRATCH)/extras -endif - $(Q) $(PYTHON) -u $(ROMFS_AUTOSTART) -a $(ROMFS_ROOT)/init.d/ -s $(ROMFS_SCRATCH)/init.d/rc.autostart - # Execute in standard dir as well - # so developers notice the generated file - $(Q) $(PYTHON) -u $(ROMFS_AUTOSTART) -a $(ROMFS_ROOT)/init.d/ -s $(ROMFS_ROOT)/init.d/rc.autostart - $(Q) $(PYTHON) -u $(ROMFS_PRUNER) --folder $(ROMFS_SCRATCH) - -EXTRA_CLEANS += $(ROMGS_OBJ) $(ROMFS_IMG) - -endif - -################################################################################ -# Builtin command list generation -################################################################################ - -# -# Builtin commands can be generated by the configuration, in which case they -# must refer to commands that already exist, or indirectly generated by modules -# when they are built. -# -# The configuration supplies builtin command information in the BUILTIN_COMMANDS -# variable. Applications make empty files in $(WORK_DIR)/builtin_commands whose -# filename contains the same information. -# -# In each case, the command information consists of four fields separated with a -# period. These fields are the command's name, its thread priority, its stack size -# and the name of the function to call when starting the thread. -# -BUILTIN_CSRC = $(WORK_DIR)builtin_commands.c - -# command definitions from modules (may be empty at Makefile parsing time...) -MODULE_COMMANDS = $(subst COMMAND.,,$(notdir $(wildcard $(WORK_DIR)builtin_commands/COMMAND.*))) - -# We must have at least one pre-defined builtin command in order to generate -# any of this. -# -ifneq ($(BUILTIN_COMMANDS),) - -# (BUILTIN_PROTO,,) -define BUILTIN_PROTO - $(ECHO) 'extern int $(word 4,$1)(int argc, char *argv[]);' >> $2; -endef - -# (BUILTIN_DEF,,) -define BUILTIN_DEF - $(ECHO) ' {"$(word 1,$1)", $(word 2,$1), $(word 3,$1), $(word 4,$1)},' >> $2; -endef - -# Don't generate until modules have updated their command files -$(BUILTIN_CSRC): $(GLOBAL_DEPS) $(MODULE_OBJS) $(MODULE_MKFILES) $(BUILTIN_COMMAND_FILES) - @$(ECHO) "CMDS: $@" - $(Q) $(ECHO) '/* builtin command list - automatically generated, do not edit */' > $@ - $(Q) $(ECHO) '#include ' >> $@ - $(Q) $(ECHO) '#include ' >> $@ - $(Q) $(foreach spec,$(BUILTIN_COMMANDS),$(call BUILTIN_PROTO,$(subst ., ,$(spec)),$@)) - $(Q) $(foreach spec,$(MODULE_COMMANDS),$(call BUILTIN_PROTO,$(subst ., ,$(spec)),$@)) - $(Q) $(ECHO) 'const struct builtin_s g_builtins[] = {' >> $@ - $(Q) $(foreach spec,$(BUILTIN_COMMANDS),$(call BUILTIN_DEF,$(subst ., ,$(spec)),$@)) - $(Q) $(foreach spec,$(MODULE_COMMANDS),$(call BUILTIN_DEF,$(subst ., ,$(spec)),$@)) - $(Q) $(ECHO) ' {NULL, 0, 0, NULL}' >> $@ - $(Q) $(ECHO) '};' >> $@ - $(Q) $(ECHO) 'const int g_builtin_count = $(words $(BUILTIN_COMMANDS) $(MODULE_COMMANDS));' >> $@ - -SRCS += $(BUILTIN_CSRC) - -EXTRA_CLEANS += $(BUILTIN_CSRC) - -endif - diff --git a/makefiles/nuttx/toolchain_gnu-arm-eabi.mk b/makefiles/nuttx/toolchain_gnu-arm-eabi.mk deleted file mode 100644 index 868c3d161e..0000000000 --- a/makefiles/nuttx/toolchain_gnu-arm-eabi.mk +++ /dev/null @@ -1,342 +0,0 @@ -# -# Copyright (C) 2012-2014 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. -# - -# -# Definitions for a generic GNU ARM-EABI toolchain -# - -#$(info TOOLCHAIN gnu-arm-eabi) - -# Toolchain commands. Normally only used inside this file. -# -CROSSDEV = arm-none-eabi- - -CC = $(CROSSDEV)gcc -CXX = $(CROSSDEV)g++ -CPP = $(CROSSDEV)gcc -E -LD = $(CROSSDEV)ld -AR = $(CROSSDEV)ar rcs -NM = $(CROSSDEV)nm -OBJCOPY = $(CROSSDEV)objcopy -OBJDUMP = $(CROSSDEV)objdump - -# Check if the right version of the toolchain is available -# -CROSSDEV_VER_SUPPORTED = 4.7.4 4.7.5 4.7.6 4.8.4 4.9.3 -CROSSDEV_VER_FOUND = $(shell $(CC) -dumpversion) - -ifeq (,$(findstring $(CROSSDEV_VER_FOUND), $(CROSSDEV_VER_SUPPORTED))) -$(error Unsupported version of $(CC), found: $(CROSSDEV_VER_FOUND) instead of one in: $(CROSSDEV_VER_SUPPORTED)) -endif - - -# XXX this is pulled pretty directly from the fmu Make.defs - needs cleanup - -MAXOPTIMIZATION ?= -O3 - -# Base CPU flags for each of the supported architectures. -# -ARCHCPUFLAGS_CORTEXM4F = -mcpu=cortex-m4 \ - -mthumb \ - -march=armv7e-m \ - -mfpu=fpv4-sp-d16 \ - -mfloat-abi=hard - -ARCHCPUFLAGS_CORTEXM4 = -mcpu=cortex-m4 \ - -mthumb \ - -march=armv7e-m \ - -mfloat-abi=soft - -ARCHCPUFLAGS_CORTEXM3 = -mcpu=cortex-m3 \ - -mthumb \ - -march=armv7-m \ - -mfloat-abi=soft - -# Enabling stack checks if OS was build with them -# -TEST_FILE_STACKCHECK=$(WORK_DIR)nuttx-export/include/nuttx/config.h -TEST_VALUE_STACKCHECK=CONFIG_ARMV7M_STACKCHECK\ 1 -ENABLE_STACK_CHECKS=$(shell $(GREP) -q "$(TEST_VALUE_STACKCHECK)" $(TEST_FILE_STACKCHECK); echo $$?;) -ifeq ("$(ENABLE_STACK_CHECKS)","0") -ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -finstrument-functions -ffixed-r10 -ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -finstrument-functions -ffixed-r10 -ARCHINSTRUMENTATIONDEFINES_CORTEXM3 = -else -ARCHINSTRUMENTATIONDEFINES_CORTEXM4F = -ARCHINSTRUMENTATIONDEFINES_CORTEXM4 = -ARCHINSTRUMENTATIONDEFINES_CORTEXM3 = -endif - -# Pick the right set of flags for the architecture. -# -ARCHCPUFLAGS = $(ARCHCPUFLAGS_$(CONFIG_ARCH)) -ifeq ($(ARCHCPUFLAGS),) -$(error Must set CONFIG_ARCH to one of CORTEXM4F, CORTEXM4 or CORTEXM3) -endif - -# Set the board flags -# -ifeq ($(CONFIG_BOARD),) -$(error Board config does not define CONFIG_BOARD) -endif -ARCHDEFINES += -DCONFIG_ARCH_BOARD_$(CONFIG_BOARD) -D__PX4_NUTTX - -# optimisation flags -# -ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ - -g3 \ - -fno-strict-aliasing \ - -fno-strength-reduce \ - -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections - -# enable precise stack overflow tracking -# note - requires corresponding support in NuttX -INSTRUMENTATIONDEFINES = $(ARCHINSTRUMENTATIONDEFINES_$(CONFIG_ARCH)) - -LIBC := $(shell ${CC} ${ARCHCPUFLAGS} -print-file-name=libc.a) - -# Language-specific flags -# -ARCHCFLAGS = -std=gnu99 -ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -D__CUSTOM_FILE_IO__ - -# -# Provide defaults, but allow for module override -WFRAME_LARGER_THAN ?= 1024 - - - -# Generic warnings -# -ARCHWARNINGS = -Wall \ - -Wextra \ - -Werror \ - -Wdouble-promotion \ - -Wshadow \ - -Wfloat-equal \ - -Wpointer-arith \ - -Wmissing-declarations \ - -Wpacked \ - -Wno-unused-parameter \ - -Werror=format-security \ - -Werror=array-bounds \ - -Wfatal-errors \ - -Wformat=1 \ - -Werror=unused-but-set-variable \ - -Werror=unused-variable \ - -Werror=double-promotion \ - -Werror=reorder \ - -Werror=uninitialized \ - -Werror=init-self -# -Werror=float-conversion - works, just needs to be phased in with some effort and needs GCC 4.9+ -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -# C-specific warnings -# -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wmissing-prototypes \ - -Wnested-externs - -# C++-specific warnings -# -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-missing-field-initializers - -# pull in *just* libm from the toolchain ... this is grody -LIBM := $(shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a) -EXTRA_LIBS += $(LIBM) - -# Flags we pass to the C compiler -# -CFLAGS = $(ARCHCFLAGS) \ - $(ARCHCWARNINGS) \ - $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) \ - $(ARCHINCLUDES) \ - $(INSTRUMENTATIONDEFINES) \ - $(ARCHDEFINES) \ - $(EXTRADEFINES) \ - $(EXTRACFLAGS) \ - -fno-common \ - $(addprefix -I,$(INCLUDE_DIRS)) - -# Flags we pass to the C++ compiler -# -CXXFLAGS = $(ARCHCXXFLAGS) \ - $(ARCHWARNINGSXX) \ - $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) \ - $(ARCHXXINCLUDES) \ - $(INSTRUMENTATIONDEFINES) \ - $(ARCHDEFINES) \ - -DCONFIG_WCHAR_BUILTIN \ - $(EXTRADEFINES) \ - $(EXTRACXXFLAGS) \ - $(addprefix -I,$(INCLUDE_DIRS)) - -# Flags we pass to the assembler -# -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ \ - $(EXTRADEFINES) \ - $(EXTRAAFLAGS) - -# Flags we pass to the linker -# -LDFLAGS += --warn-common \ - --gc-sections \ - $(EXTRALDFLAGS) \ - $(addprefix -T,$(LDSCRIPT)) \ - $(addprefix -L,$(LIB_DIRS)) - -# Compiler support library -# -LIBGCC := $(shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name) - -# Files that the final link depends on -# -LINK_DEPS += $(LDSCRIPT) - -# Files to include to get automated dependencies -# -DEP_INCLUDES = $(subst .o,.d,$(OBJS)) - -# Compile C source $1 to object $2 -# as a side-effect, generate a dependency file -# -define COMPILE - @$(ECHO) "CC: $1" - @$(MKDIR) -p $(dir $2) - $(Q) $(CCACHE) $(CC) -MD -c $(CFLAGS) $(abspath $1) -o $2 -endef - -# Compile C++ source $1 to $2 -# as a side-effect, generate a dependency file -# -define COMPILEXX - @$(ECHO) "CXX: $1" - @$(MKDIR) -p $(dir $2) - $(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2 -endef - -# Assemble $1 into $2 -# -define ASSEMBLE - @$(ECHO) "AS: $1" - @$(MKDIR) -p $(dir $2) - $(Q) $(CC) -c $(AFLAGS) $(abspath $1) -o $2 -endef - -# Produce partially-linked $1 from files in $2 -# -define PRELINK - @$(ECHO) "PRELINK: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(LD) -Ur -Map $1.map -o $1 $2 && $(OBJCOPY) --localize-hidden $1 -endef - -# Update the archive $1 with the files in $2 -# -define ARCHIVE - @$(ECHO) "AR: $2" - @$(MKDIR) -p $(dir $1) - $(Q) $(AR) $1 $2 -endef - -# Link the objects in $2 into the binary $1 -# -define LINK - @$(ECHO) "LINK: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(LD) $(LDFLAGS) -Map $1.map -o $1 --start-group $2 $(LIBS) $(EXTRA_LIBS) $(LIBGCC) --end-group -endef - -# Convert $1 from a linked object to a raw binary in $2 -# -define SYM_TO_BIN - @$(ECHO) "BIN: $2" - @$(MKDIR) -p $(dir $2) - $(Q) $(OBJCOPY) -O binary $1 $2 -endef - -# Take the raw binary $1 and make it into an object file $2. -# The symbol $3 points to the beginning of the file, and $3_len -# gives its length. -# -# - compile an empty file to generate a suitable object file -# - relink the object and insert the binary file -# - extract the length -# - create const unsigned $3_len with the extracted length as its value and compile it to an object file -# - link the two generated object files together -# - edit symbol names to suit -# -# NOTE: exercise caution using this with absolute pathnames; it looks -# like the MinGW tools insert an extra _ in the binary symbol name; e.g. -# the path: -# -# /d/px4/firmware/Build/px4fmu_default.build/romfs.img -# -# is assigned symbols like: -# -# _binary_d__px4_firmware_Build_px4fmu_default_build_romfs_img_size -# -# when we would expect -# -# _binary__d_px4_firmware_Build_px4fmu_default_build_romfs_img_size -# -define BIN_SYM_PREFIX - _binary_$(subst /,_,$(subst .,_,$1)) -endef -define BIN_TO_OBJ - @$(ECHO) "OBJ: $2" - @$(MKDIR) -p $(dir $2) - $(Q) $(ECHO) > $2.c - $(call COMPILE,$2.c,$2.c.o) - $(Q) $(LD) -r -o $2.bin.o $2.c.o -b binary $1 - $(Q) $(ECHO) "const unsigned int $3_len = 0x`$(NM) -p --radix=x $2.bin.o | $(GREP) $(call BIN_SYM_PREFIX,$1)_size$$ | $(GREP) -o ^[0-9a-fA-F]*`;" > $2.c - $(call COMPILE,$2.c,$2.c.o) - $(Q) $(LD) -r -o $2 $2.c.o $2.bin.o - $(Q) $(OBJCOPY) $2 \ - --redefine-sym $(call BIN_SYM_PREFIX,$1)_start=$3 \ - --strip-symbol $(call BIN_SYM_PREFIX,$1)_size \ - --strip-symbol $(call BIN_SYM_PREFIX,$1)_end \ - --rename-section .data=.rodata - $(Q) $(REMOVE) $2.c $2.c.o $2.bin.o -endef diff --git a/makefiles/nuttx/upload.mk b/makefiles/nuttx/upload.mk deleted file mode 100644 index e73c31dc31..0000000000 --- a/makefiles/nuttx/upload.mk +++ /dev/null @@ -1,50 +0,0 @@ -# -# Rules and tools for uploading firmware to various PX4 boards. -# - -UPLOADER = $(PX4_BASE)/Tools/px_uploader.py - -SYSTYPE := $(shell uname -s) - -# -# Serial port defaults. -# -# XXX The uploader should be smarter than this. -# -ifeq ($(SYSTYPE),Darwin) -SERIAL_PORTS ?= "/dev/tty.usbmodemPX*,/dev/tty.usbmodem*" -endif -ifeq ($(SYSTYPE),Linux) -SERIAL_PORTS ?= "/dev/serial/by-id/usb-3D_Robotics*,/dev/serial/by-id/pci-3D_Robotics*" -endif -ifeq ($(SERIAL_PORTS),) -SERIAL_PORTS = "COM32,COM31,COM30,COM29,COM28,COM27,COM26,COM25,COM24,COM23,COM22,COM21,COM20,COM19,COM18,COM17,COM16,COM15,COM14,COM13,COM12,COM11,COM10,COM9,COM8,COM7,COM6,COM5,COM4,COM3,COM2,COM1,COM0" -endif - -.PHONY: all upload-$(METHOD)-$(BOARD) -all: upload-$(METHOD)-$(BOARD) - -upload-serial-px4fmu-v1: $(BUNDLE) $(UPLOADER) - $(Q) $(PYTHON) -u $(UPLOADER) --port $(SERIAL_PORTS) $(BUNDLE) - -upload-serial-px4fmu-v2: $(BUNDLE) $(UPLOADER) - $(Q) $(PYTHON) -u $(UPLOADER) --port $(SERIAL_PORTS) $(BUNDLE) - -upload-serial-aerocore: - openocd -f $(PX4_BASE)/makefiles/nuttx/gumstix-aerocore.cfg -c 'init; reset halt; flash write_image erase $(PX4_BASE)/../Bootloader/px4aerocore_bl.bin 0x08000000; flash write_image erase $(PX4_BASE)/Build/aerocore_default.build/firmware.bin 0x08004000; reset run; exit' - -upload-serial-px4-stm32f4discovery: $(BUNDLE) $(UPLOADER) - $(Q) $(PYTHON) -u $(UPLOADER) --port $(SERIAL_PORTS) $(BUNDLE) - -# -# JTAG firmware uploading with OpenOCD -# -JTAGCONFIG ?= interface/olimex-jtag-tiny.cfg - -upload-jtag-px4fmu: all - @$(ECHO) Attempting to flash PX4FMU board via JTAG - $(Q) $(OPENOCD) -f $(JTAGCONFIG) -f ../Bootloader/stm32f4x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx/nuttx" -c "flash write_image erase ../Bootloader/px4fmu_bl.elf" -c "reset run" -c shutdown - -upload-jtag-px4io: all - @$(ECHO) Attempting to flash PX4IO board via JTAG - $(Q) $(OPENOCD) -f $(JTAGCONFIG) -f ../Bootloader/stm32f1x.cfg -c init -c "reset halt" -c "flash write_image erase nuttx/nuttx" -c "flash write_image erase ../Bootloader/px4io_bl.elf" -c "reset run" -c shutdown diff --git a/makefiles/posix-arm/board_eagle.mk b/makefiles/posix-arm/board_eagle.mk deleted file mode 100644 index 94dd049367..0000000000 --- a/makefiles/posix-arm/board_eagle.mk +++ /dev/null @@ -1,11 +0,0 @@ -# -# Board-specific definitions for the POSIX port of PX4 -# - -# -# Configure the toolchain -# -CONFIG_ARCH = CORTEXA8 -CONFIG_BOARD = EAGLE - -include $(PX4_MK_DIR)/posix-arm/toolchain_gnu-arm-linux-gnueabihf.mk diff --git a/makefiles/posix-arm/config_eagle_adsp.mk b/makefiles/posix-arm/config_eagle_adsp.mk deleted file mode 100644 index e7e0d8cf6f..0000000000 --- a/makefiles/posix-arm/config_eagle_adsp.mk +++ /dev/null @@ -1,57 +0,0 @@ -# -# Makefile for the EAGLE *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device - -# -# System commands -# -MODULES += systemcmds/param -MODULES += systemcmds/ver - -# -# General system control -# -MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# - -# -# Vehicle Control -# - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/uORB -MODULES += modules/dataman - -# -# Libraries -# -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion -# -# Linux port -# -MODULES += platforms/posix/px4_layer -MODULES += platforms/posix/work_queue - -# -# Unit tests -# - -# -# muorb fastrpc changes. -# -MODULES += modules/muorb/krait diff --git a/makefiles/posix-arm/config_eagle_default.mk b/makefiles/posix-arm/config_eagle_default.mk deleted file mode 100644 index 1f335522cd..0000000000 --- a/makefiles/posix-arm/config_eagle_default.mk +++ /dev/null @@ -1,79 +0,0 @@ -# -# Makefile for the EAGLE *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/blinkm -MODULES += drivers/pwm_out_sim -MODULES += drivers/rgbled -MODULES += drivers/led -MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -MODULES += systemcmds/param -MODULES += systemcmds/mixer -MODULES += systemcmds/ver -#MODULES += systemcmds/topic_listener - -# -# General system control -# -MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -MODULES += modules/attitude_estimator_ekf -MODULES += modules/ekf_att_pos_estimator - -# -# Vehicle Control -# -#MODULES += modules/navigator -MODULES += modules/mc_pos_control -MODULES += modules/mc_att_control - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/uORB -MODULES += modules/dataman -MODULES += modules/sdlog2 -MODULES += modules/simulator -MODULES += modules/commander -MODULES += modules/controllib - -# -# Libraries -# -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion -# -# Linux port -# -MODULES += platforms/posix/px4_layer -MODULES += platforms/posix/work_queue - -# -# Unit tests -# -#MODULES += platforms/posix/tests/hello -#MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue - -# -# muorb fastrpc changes. -# -#MODULES += $(PX4_BASE)../muorb_krait diff --git a/makefiles/posix-arm/config_eagle_hil.mk b/makefiles/posix-arm/config_eagle_hil.mk deleted file mode 100644 index 522549d05b..0000000000 --- a/makefiles/posix-arm/config_eagle_hil.mk +++ /dev/null @@ -1,88 +0,0 @@ -# -# Makefile for the POSIXTEST *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/boards/sitl -#MODULES += drivers/blinkm -#MODULES += drivers/pwm_out_sim -#MODULES += drivers/rgbled -MODULES += drivers/led -#MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -MODULES += systemcmds/param -#MODULES += systemcmds/mixer -#MODULES += systemcmds/topic_listener -MODULES += systemcmds/ver - -# -# General system control -# -MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -#MODULES += modules/attitude_estimator_ekf -#MODULES += modules/ekf_att_pos_estimator - -# -# Vehicle Control -# -#MODULES += modules/navigator -#MODULES += modules/mc_pos_control -#MODULES += modules/mc_att_control - -# -# Library modules -# -MODULES += modules/systemlib -#MODULES += modules/systemlib/mixer -MODULES += modules/uORB -MODULES += modules/dataman -MODULES += modules/sdlog2 -MODULES += modules/simulator -MODULES += modules/commander -#MODULES += modules/controllib - -# -# Libraries -# -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion - -# -# Linux port -# -MODULES += platforms/posix/px4_layer -MODULES += platforms/posix/work_queue -#MODULES += platforms/posix/drivers/accelsim -#MODULES += platforms/posix/drivers/gyrosim -#MODULES += platforms/posix/drivers/adcsim -#MODULES += platforms/posix/drivers/barosim -#MODULES += platforms/posix/drivers/tonealrmsim -#MODULES += platforms/posix/drivers/airspeedsim -#MODULES += platforms/posix/drivers/gpssim - -# -# Unit tests -# -#MODULES += platforms/posix/tests/hello -#MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue - -# -# muorb fastrpc changes. -# -MODULES += modules/muorb/krait diff --git a/makefiles/posix-arm/config_eagle_muorb_test.mk b/makefiles/posix-arm/config_eagle_muorb_test.mk deleted file mode 100644 index bb87cd35fb..0000000000 --- a/makefiles/posix-arm/config_eagle_muorb_test.mk +++ /dev/null @@ -1,90 +0,0 @@ -# -# Makefile for the POSIXTEST *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -#MODULES += drivers/blinkm -#MODULES += drivers/pwm_out_sim -#MODULES += drivers/rgbled -#MODULES += drivers/led -#MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -#MODULES += systemcmds/param -#MODULES += systemcmds/mixer -#MODULES += systemcmds/topic_listener - -# -# General system control -# -#MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -#MODULES += modules/attitude_estimator_ekf -#MODULES += modules/ekf_att_pos_estimator - -# -# Vehicle Control -# -#MODULES += modules/navigator -#MODULES += modules/mc_pos_control -#MODULES += modules/mc_att_control - -# -# Library modules -# -#MODULES += modules/systemlib -#MODULES += modules/systemlib/mixer -MODULES += modules/uORB -#MODULES += modules/dataman -#MODULES += modules/sdlog2 -#MODULES += modules/simulator -#MODULES += modules/commander -#MODULES += modules/controllib - -# -# Libraries -# -#MODULES += lib/mathlib -#MODULES += lib/mathlib/math/filter -#MODULES += lib/geo -#MODULES += lib/geo_lookup -#MODULES += lib/conversion - -# -# Linux port -# -MODULES += platforms/posix/px4_layer -MODULES += platforms/posix/work_queue -#MODULES += platforms/posix/drivers/accelsim -#MODULES += platforms/posix/drivers/gyrosim -#MODULES += platforms/posix/drivers/adcsim -#MODULES += platforms/posix/drivers/barosim -#MODULES += platforms/posix/drivers/tonealrmsim -#MODULES += platforms/posix/drivers/airspeedsim -#MODULES += platforms/posix/drivers/gpssim - -# -# muorb fastrpc changes. -# -MODULES += modules/muorb/krait - - -# -# -# Unit tests -# -#MODULES += platforms/posix/tests/hello -#MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue -MODULES += platforms/posix/tests/muorb - diff --git a/makefiles/posix-arm/ld.script b/makefiles/posix-arm/ld.script deleted file mode 100644 index 32478e1e14..0000000000 --- a/makefiles/posix-arm/ld.script +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** - * ld.script - * - * Copyright (C) 2015 Mark Charlebois. All rights reserved. - * Author: Mark Charlebois - * - * 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. - * - ****************************************************************************/ - -SECTIONS -{ - /* - * Construction data for parameters. - */ - __param : ALIGN(8) { - __param_start = .; - KEEP(*(__param*)) - __param_end = .; - } -} diff --git a/makefiles/posix-arm/posix-arm.mk b/makefiles/posix-arm/posix-arm.mk deleted file mode 100644 index 13cb97f0db..0000000000 --- a/makefiles/posix-arm/posix-arm.mk +++ /dev/null @@ -1,40 +0,0 @@ -# -# 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. -# - -# -# Rules and definitions related to handling the Linux specific impl when -# building firmware. -# - -MODULES += \ - platforms/common \ - platforms/posix/px4_layer - diff --git a/makefiles/posix-arm/toolchain_gnu-arm-linux-gnueabihf.mk b/makefiles/posix-arm/toolchain_gnu-arm-linux-gnueabihf.mk deleted file mode 100644 index 4eb3b0fd19..0000000000 --- a/makefiles/posix-arm/toolchain_gnu-arm-linux-gnueabihf.mk +++ /dev/null @@ -1,305 +0,0 @@ -# -# Copyright (C) 2012-2014 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. -# - -# -# Definitions for a generic GNU ARM-EABI toolchain -# - -#$(info TOOLCHAIN arm-linux-gnueabihf) - -# Toolchain commands. Normally only used inside this file. -# -CROSSDEV = arm-linux-gnueabihf- - -CC ?= $(CROSSDEV)gcc -CXX ?= $(CROSSDEV)g++ -CPP ?= $(CROSSDEV)gcc -E -LD ?= $(CROSSDEV)ld -AR ?= $(CROSSDEV)ar rcs -NM ?= $(CROSSDEV)nm -OBJCOPY ?= $(CROSSDEV)objcopy -OBJDUMP ?= $(CROSSDEV)objdump -ifdef OECORE_NATIVE_SYSROOT -AR := $(AR) rcs -endif - -# Check if the right version of the toolchain is available -# -CROSSDEV_VER_SUPPORTED = 4.7.4 4.7.5 4.7.6 4.8.2 4.8.4 4.9.3 -CROSSDEV_VER_FOUND = $(shell $(CC) -dumpversion) - -ifeq (,$(findstring $(CROSSDEV_VER_FOUND), $(CROSSDEV_VER_SUPPORTED))) -$(error Unsupported version of $(CC), found: $(CROSSDEV_VER_FOUND) instead of one in: $(CROSSDEV_VER_SUPPORTED)) -endif - -ifndef POSIX_EXT_LIB_ROOT -$(error POSIX_EXT_LIB_ROOT is not set) -endif - -# XXX this is pulled pretty directly from the fmu Make.defs - needs cleanup - -MAXOPTIMIZATION ?= -O3 - -# Base CPU flags for each of the supported architectures. -# -ARCHCPUFLAGS_CORTEXA8 = -mtune=cortex-a8 \ - -mthumb-interwork \ - -march=armv7-a \ - -mfloat-abi=hard \ - -mfpu=neon - -# Pick the right set of flags for the architecture. -# -ARCHCPUFLAGS = $(ARCHCPUFLAGS_$(CONFIG_ARCH)) -ifeq ($(ARCHCPUFLAGS),) -$(error Must set CONFIG_ARCH to one of CORTEXA8 CORTEXM4F, CORTEXM4 or CORTEXM3) -endif - -# Set the board flags -# -ifeq ($(CONFIG_BOARD),) -$(error Board config does not define CONFIG_BOARD) -endif -ARCHDEFINES += -DCONFIG_ARCH_BOARD_$(CONFIG_BOARD) \ - -D__PX4_LINUX -D__PX4_POSIX \ - -Dnoreturn_function= \ - -I$(PX4_BASE)/src/modules/systemlib \ - -I$(PX4_BASE)/src/lib/eigen \ - -I$(PX4_BASE)/src/platforms/posix/include \ - -I$(PX4_BASE)/mavlink/include/mavlink \ - -Wno-error=shadow - -# optimisation flags -# -ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ - -g3 \ - -fno-strict-aliasing \ - -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections - -# Language-specific flags -# -ARCHCFLAGS = -std=gnu99 -ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=c++0x -fno-threadsafe-statics -D__CUSTOM_FILE_IO__ - -# Generic warnings -# -ARCHWARNINGS = -Wall \ - -Wextra \ - -Werror \ - -Wfloat-equal \ - -Wpointer-arith \ - -Wmissing-declarations \ - -Wpacked \ - -Wno-unused-parameter \ - -Wno-packed \ - -Werror=format-security \ - -Werror=array-bounds \ - -Wfatal-errors \ - -Werror=unused-variable \ - -Werror=reorder \ - -Werror=uninitialized \ - -Werror=init-self \ - -Wformat=1 \ - -Werror=unused-but-set-variable \ - -Wno-error=double-promotion \ - -fno-strength-reduce \ - -Wno-error=unused-value - -ARCHOPTIMIZATION += -fno-strength-reduce - -# -Werror=float-conversion - works, just needs to be phased in with some effort and needs GCC 4.9+ -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -# C-specific warnings -# -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wmissing-prototypes \ - -Wnested-externs - -# C++-specific warnings -# -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-missing-field-initializers - -# pull in *just* libm from the toolchain ... this is grody -LIBM := $(shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a) -#EXTRA_LIBS += $(LIBM) -EXTRA_LIBS += -lpx4muorb -ladsprpc -EXTRA_LIBS += -pthread -lm -lrt - -LIB_DIRS += $(POSIX_EXT_LIB_ROOT)/libs -INCLUDE_DIRS += $(POSIX_EXT_LIB_ROOT)/inc - -# Flags we pass to the C compiler -# -CFLAGS = $(ARCHCFLAGS) \ - $(ARCHCWARNINGS) \ - $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) \ - $(ARCHINCLUDES) \ - $(INSTRUMENTATIONDEFINES) \ - $(ARCHDEFINES) \ - $(EXTRADEFINES) \ - $(EXTRACFLAGS) \ - -fno-common \ - $(addprefix -I,$(INCLUDE_DIRS)) - -# Flags we pass to the C++ compiler -# -CXXFLAGS = $(ARCHCXXFLAGS) \ - $(ARCHWARNINGSXX) \ - $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) \ - $(ARCHXXINCLUDES) \ - $(INSTRUMENTATIONDEFINES) \ - $(ARCHDEFINES) \ - -DCONFIG_WCHAR_BUILTIN \ - $(EXTRADEFINES) \ - $(EXTRACXXFLAGS) \ - -Wno-effc++ \ - $(addprefix -I,$(INCLUDE_DIRS)) - -# Flags we pass to the assembler -# -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ \ - $(EXTRADEFINES) \ - $(EXTRAAFLAGS) - -LDSCRIPT = $(PX4_BASE)/makefiles/posix-arm/ld.script -# Flags we pass to the linker -# -LDFLAGS += $(EXTRALDFLAGS) \ - $(addprefix -L,$(LIB_DIRS)) - -# Compiler support library -# -LIBGCC := $(shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name) - -# Files that the final link depends on -# -#LINK_DEPS += $(LDSCRIPT) -LINK_DEPS += - -# Files to include to get automated dependencies -# -DEP_INCLUDES = $(subst .o,.d,$(OBJS)) - -# Compile C source $1 to object $2 -# as a side-effect, generate a dependency file -# -define COMPILE - @$(ECHO) "CC: $1" - @$(MKDIR) -p $(dir $2) - $(Q) $(CCACHE) $(CC) -MD -c $(CFLAGS) $(abspath $1) -o $2 -endef - -# Compile C++ source $1 to $2 -# as a side-effect, generate a dependency file -# -define COMPILEXX - @$(ECHO) "CXX: $1" - @$(MKDIR) -p $(dir $2) - @echo $(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2 - $(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2 -endef - -# Assemble $1 into $2 -# -define ASSEMBLE - @$(ECHO) "AS: $1" - @$(MKDIR) -p $(dir $2) - $(Q) $(CC) -c $(AFLAGS) $(abspath $1) -o $2 -endef - -# Produce partially-linked $1 from files in $2 -# -#$(Q) $(LD) -Ur -o $1 $2 # -Ur not supported in ld.gold -define PRELINK - @$(ECHO) "PRELINK: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(LD) -Ur -o $1 $2 - -endef -# Produce partially-linked $1 from files in $2 -# -#$(Q) $(LD) -Ur -o $1 $2 # -Ur not supported in ld.gold -define PRELINKF - @$(ECHO) "PRELINK: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(LD) -Ur -T$(LDSCRIPT) -o $1 $2 - -endef -# $(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1 - -# Update the archive $1 with the files in $2 -# -define ARCHIVE - @$(ECHO) "AR: $2" - @$(MKDIR) -p $(dir $1) - $(Q) $(AR) $1 $2 -endef - -# Link the objects in $2 into the shared library $1 -# -define LINK_A - @$(ECHO) "LINK_A: $1" - @$(MKDIR) -p $(dir $1) - echo "$(Q) $(AR) $1 $2" - $(Q) $(AR) $1 $2 -endef - -# Link the objects in $2 into the shared library $1 -# -define LINK_SO - @$(ECHO) "LINK_SO: $1" - @$(MKDIR) -p $(dir $1) - echo "$(Q) $(CXX) $(LDFLAGS) -shared -Wl,-soname,`basename $1`.1 -o $1 $2 $(LIBS) $(EXTRA_LIBS)" - $(Q) $(CXX) $(LDFLAGS) -shared -Wl,-soname,`basename $1`.1 -o $1 $2 $(LIBS) -pthread -lc -endef - -# Link the objects in $2 into the application $1 -# -define LINK - @$(ECHO) "LINK: $1" - @$(MKDIR) -p $(dir $1) - echo "$(Q) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $1 $2 $(LIBS) $(EXTRA_LIBS) $(LIBGCC)" - $(Q) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $1 $2 $(LIBS) $(EXTRA_LIBS) $(LIBGCC) - -endef - diff --git a/makefiles/posix/DISABLE_config_posix_muorb_test.mk b/makefiles/posix/DISABLE_config_posix_muorb_test.mk deleted file mode 100644 index 5f0074e2ba..0000000000 --- a/makefiles/posix/DISABLE_config_posix_muorb_test.mk +++ /dev/null @@ -1,78 +0,0 @@ -# -# Makefile for the Foo *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -#MODULES += drivers/blinkm -#MODULES += drivers/pwm_out_sim -#MODULES += drivers/led -#MODULES += drivers/rgbled -#MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -MODULES += systemcmds/param - -# -# General system control -# -#MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -#MODULES += modules/attitude_estimator_ekf -#MODULES += modules/ekf_att_pos_estimator - -# -# Vehicle Control -# -#MODULES += modules/mc_att_control - -# -# Library modules -# -MODULES += modules/systemlib -#MODULES += modules/systemlib/mixer -MODULES += modules/uORB -#MODULES += modules/dataman -#MODULES += modules/sdlog2 -#MODULES += modules/simulator -#MODULES += modules/commander - -# -# Libraries -# -#MODULES += lib/mathlib -#MODULES += lib/mathlib/math/filter -#MODULES += lib/geo -#MODULES += lib/geo_lookup -#MODULES += lib/conversion - -# -# posix port -# -MODULES += platforms/posix/px4_layer -#MODULES += platforms/posix/drivers/accelsim -#MODULES += platforms/posix/drivers/gyrosim -#MODULES += platforms/posix/drivers/adcsim -#MODULES += platforms/posix/drivers/barosim - -# -# muorb fastrpc changes. -# -#MODULES += $(PX4_BASE)../muorb_krait - -# -# Unit tests -# -MODULES += platforms/posix/tests/muorb -#MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue - diff --git a/makefiles/posix/board_posix.mk b/makefiles/posix/board_posix.mk deleted file mode 100644 index 4e8c9e9f58..0000000000 --- a/makefiles/posix/board_posix.mk +++ /dev/null @@ -1,12 +0,0 @@ -# -# Board-specific definitions for the POSIX port of PX4 -# for use in SITL testing -# - -# -# Configure the toolchain -# -CONFIG_ARCH = NATIVE -CONFIG_BOARD = SITL - -include $(PX4_MK_DIR)/posix/toolchain_native.mk diff --git a/makefiles/posix/config_posix_sitl.mk b/makefiles/posix/config_posix_sitl.mk deleted file mode 100644 index b745d0e263..0000000000 --- a/makefiles/posix/config_posix_sitl.mk +++ /dev/null @@ -1,107 +0,0 @@ -# -# Makefile for the SITL configuration -# - -# -# Board support modules -# -MODULES += drivers/boards/sitl -MODULES += drivers/device -MODULES += drivers/blinkm -MODULES += drivers/pwm_out_sim -MODULES += drivers/rgbled -MODULES += drivers/led -MODULES += modules/sensors -MODULES += drivers/ms5611 - -# -# System commands -# -MODULES += systemcmds/param -MODULES += systemcmds/mixer -#MODULES += systemcmds/esc_calib -MODULES += systemcmds/tests -#MODULES += systemcmds/reboot -MODULES += systemcmds/topic_listener -MODULES += systemcmds/ver -MODULES += systemcmds/esc_calib -MODULES += systemcmds/reboot - -# -# General system control -# -MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -MODULES += modules/attitude_estimator_ekf -MODULES += modules/attitude_estimator_q -MODULES += modules/ekf_att_pos_estimator -MODULES += modules/attitude_estimator_q -MODULES += modules/position_estimator_inav - -# -# Vehicle Control -# -MODULES += modules/navigator -MODULES += modules/mc_pos_control -MODULES += modules/mc_att_control -MODULES += modules/mc_pos_control_multiplatform -MODULES += modules/mc_att_control_multiplatform -MODULES += modules/land_detector -MODULES += modules/fw_att_control -MODULES += modules/fw_pos_control_l1 - - - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/uORB -MODULES += modules/dataman -MODULES += modules/sdlog2 -MODULES += modules/simulator -MODULES += modules/commander -MODULES += modules/controllib - -# -# Libraries -# -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/ecl -MODULES += lib/external_lgpl -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion -MODULES += lib/launchdetection - - -# -# POSIX port -# -MODULES += platforms/posix/px4_layer -MODULES += platforms/posix/work_queue -MODULES += platforms/posix/drivers/accelsim -MODULES += platforms/posix/drivers/gyrosim -MODULES += platforms/posix/drivers/adcsim -MODULES += platforms/posix/drivers/barosim -MODULES += platforms/posix/drivers/tonealrmsim -MODULES += platforms/posix/drivers/airspeedsim -MODULES += platforms/posix/drivers/gpssim - -# -# Unit tests -# -#MODULES += platforms/posix/tests/hello -MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue - -# -# muorb fastrpc changes. -# -#MODULES += $(PX4_BASE)../muorb_krait diff --git a/makefiles/posix/firmware_posix.mk b/makefiles/posix/firmware_posix.mk deleted file mode 100644 index f6f087d449..0000000000 --- a/makefiles/posix/firmware_posix.mk +++ /dev/null @@ -1,56 +0,0 @@ -# -# Copyright (c) 2012-2015 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. -# - -# -# Built products -# -FIRMWARES = $(foreach config,$(CONFIGS),$(BUILD_DIR)$(config).build/firmware.a) - -all: $(FIRMWARES) - -# -# Generate FIRMWARES. -# -.PHONY: $(FIRMWARES) -$(BUILD_DIR)%.build/firmware.a: config = $(patsubst $(BUILD_DIR)%.build/firmware.a,%,$@) -$(BUILD_DIR)%.build/firmware.a: work_dir = $(BUILD_DIR)$(config).build/ -$(FIRMWARES): $(BUILD_DIR)%.build/firmware.a: checkgitversion generateuorbtopicheaders - @$(ECHO) %%%% - @$(ECHO) %%%% Building $(config) in $(work_dir) - @$(ECHO) %%%% - $(Q) $(MKDIR) -p $(work_dir) - $(Q) $(MAKE) -r --no-print-directory -C $(work_dir) \ - -f $(PX4_MK_DIR)firmware.mk \ - CONFIG=$(config) \ - WORK_DIR=$(work_dir) \ - $(FIRMWARE_GOAL) - - diff --git a/makefiles/posix/ld.script b/makefiles/posix/ld.script deleted file mode 100644 index 32478e1e14..0000000000 --- a/makefiles/posix/ld.script +++ /dev/null @@ -1,46 +0,0 @@ -/**************************************************************************** - * ld.script - * - * Copyright (C) 2015 Mark Charlebois. All rights reserved. - * Author: Mark Charlebois - * - * 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. - * - ****************************************************************************/ - -SECTIONS -{ - /* - * Construction data for parameters. - */ - __param : ALIGN(8) { - __param_start = .; - KEEP(*(__param*)) - __param_end = .; - } -} diff --git a/makefiles/posix/posix.mk b/makefiles/posix/posix.mk deleted file mode 100644 index 13cb97f0db..0000000000 --- a/makefiles/posix/posix.mk +++ /dev/null @@ -1,40 +0,0 @@ -# -# 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. -# - -# -# Rules and definitions related to handling the Linux specific impl when -# building firmware. -# - -MODULES += \ - platforms/common \ - platforms/posix/px4_layer - diff --git a/makefiles/posix/posix_elf.mk b/makefiles/posix/posix_elf.mk deleted file mode 100644 index bbc7545a5e..0000000000 --- a/makefiles/posix/posix_elf.mk +++ /dev/null @@ -1,75 +0,0 @@ -# -# 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. -# - -# -# Makefile for PX4 POSIX based firmware images. -# - -################################################################################ -# Build rules -################################################################################ - -# -# What we're going to build. -# -PRODUCT_SHARED_LIB = $(WORK_DIR)firmware.a -PRODUCT_SHARED_PRELINK = $(WORK_DIR)firmware.o - -.PHONY: firmware -firmware: $(PRODUCT_SHARED_LIB) $(WORK_DIR)mainapp - -# -# Built product rules -# - -$(PRODUCT_SHARED_PRELINK): $(OBJS) $(MODULE_OBJS) $(LIBRARY_LIBS) $(GLOBAL_DEPS) $(LINK_DEPS) $(MODULE_MKFILES) - $(call PRELINKF,$@,$(OBJS) $(MODULE_OBJS) $(LIBRARY_LIBS)) - -$(PRODUCT_SHARED_LIB): $(PRODUCT_SHARED_PRELINK) - $(call LINK_A,$@,$(PRODUCT_SHARED_PRELINK)) - -$(WORK_DIR)apps.h: $(WORK_DIR)builtin_commands - $(PX4_BASE)/Tools/posix_apps.py > $(WORK_DIR)apps.h - -MAIN = $(PX4_BASE)/src/platforms/posix/main.cpp -$(WORK_DIR)mainapp: $(PRODUCT_SHARED_LIB) $(WORK_DIR)apps.h - $(call LINK,$@, -I. $(MAIN) $(PRODUCT_SHARED_LIB)) - -# -# Utility rules -# - -.PHONY: clean -clean: $(MODULE_CLEANS) - @$(ECHO) %% cleaning - $(Q) $(REMOVE) $(PRODUCT_ELF) - $(Q) $(REMOVE) $(OBJS) $(DEP_INCLUDES) $(EXTRA_CLEANS) - diff --git a/makefiles/posix/toolchain_native.mk b/makefiles/posix/toolchain_native.mk deleted file mode 100644 index c3a766d5ef..0000000000 --- a/makefiles/posix/toolchain_native.mk +++ /dev/null @@ -1,369 +0,0 @@ -# -# Copyright (C) 2012-2014 PX4 Development Team. All rights reuint32_tserved. -# -# 2005 Modified for clang and GCC on POSIX: -# Author: Mark Charlebois -# -# 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. -# - -# -# Definitions for a native GCC toolchain -# - -#$(info TOOLCHAIN native) - -# Toolchain commands. Normally only used inside this file. -# - -# Set to 1 for GCC-4.8.2 and to 0 for Clang-3.5 (Ubuntu 14.04) -USE_GCC?=0 - -ifeq ($(PX4_DEBUG_LEVEL),) -VERBOSITY_LEVEL= -else -VERBOSITY_LEVEL=-D$(PX4_DEBUG_LEVEL) -endif - -ifneq ($(USE_GCC),1) - -HAVE_CLANG35:=$(shell clang-3.5 -dumpversion 2>/dev/null) - -# Clang will report 4.2.1 as GCC version -HAVE_CLANG:=$(shell clang -dumpversion 2> /dev/null) - -#If using ubuntu 14.04 and packaged clang 3.5 -ifeq ($(HAVE_CLANG35),4.2.1) -USE_GCC=0 -CLANGVER=-3.5 -else - -#If using ubuntu 12.04 and downloaded clang 3.4.2 -ifeq ($(HAVE_CLANG),4.2.1) -USE_GCC=0 -CLANGVER= -endif -endif - -# If no version of clang was found -ifeq ($(HAVE_CLANG35),) -ifeq ($(HAVE_CLANG),) -$(error Clang not found. Try make USE_GCC=1) -endif -endif -endif # USE_GCC is not 1 - -ifeq ($(USE_GCC),1) -# GCC Options: -CC = gcc -CXX = g++ -CPP = gcc -E - -# GCC Version -DEV_VER_SUPPORTED = 4.8.1 4.8.2 4.9.1 - -else -# Clang options -CC = clang$(CLANGVER) -CXX = clang++$(CLANGVER) -CPP = clang$(CLANGVER) -E - -# Clang GCC reported version -DEV_VER_SUPPORTED = 4.2.1 -endif - -#LD = ld.gold -LD = ld.bfd -AR = ar rcs -NM = nm -OBJCOPY = objcopy -OBJDUMP = objdump - -# Check if the right version of the toolchain is available -# -DEV_VER_FOUND = $(shell $(CC) -dumpversion) - -ifeq (,$(findstring $(DEV_VER_FOUND), $(DEV_VER_SUPPORTED))) -$(error Unsupported version of $(CC), found: $(DEV_VER_FOUND) instead of one in: $(DEV_VER_SUPPORTED)) -endif - - -# XXX this is pulled pretty directly from the fmu Make.defs - needs cleanup - -MAXOPTIMIZATION ?= -O3 - -# Enabling stack checks if OS was build with them -# - -# Set the board flags -# -ifeq ($(CONFIG_BOARD),) -$(error Board config does not define CONFIG_BOARD) -endif -ARCHDEFINES += -DCONFIG_ARCH_BOARD_$(CONFIG_BOARD) \ - -Dnoreturn_function=__attribute__\(\(noreturn\)\) \ - $(VERBOSITY_LEVEL)\ - -I$(PX4_BASE)/src/modules/systemlib \ - -I$(PX4_BASE)/src/lib/eigen \ - -I$(PX4_BASE)/src/platforms/posix/include \ - -I$(PX4_BASE)/mavlink/include/mavlink \ - -Wno-error=shadow - -UNAME_S := $(shell uname -s) -ifeq ($(UNAME_S),Linux) - ARCHDEFINES += -D__PX4_POSIX -D__PX4_LINUX -endif -ifeq ($(UNAME_S),Darwin) - ARCHDEFINES += -D__PX4_POSIX -D__PX4_DARWIN -endif - -# optimisation flags -# -ARCHOPTIMIZATION = $(MAXOPTIMIZATION) \ - -g3 \ - -fno-strict-aliasing \ - -fomit-frame-pointer \ - -funsafe-math-optimizations \ - -fno-builtin-printf \ - -ffunction-sections \ - -fdata-sections - -# Language-specific flags -# -ARCHCFLAGS = -std=gnu99 -g -ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=c++11 -fno-threadsafe-statics -D__CUSTOM_FILE_IO__ -g - -# Generic warnings -# -# Disabled -# -Wshadow - Breaks for the libeigen package headers -# -Wframe-larger-than=1024 - Only needed for embedded - -ARCHWARNINGS = -Wall \ - -Wextra \ - -Werror \ - -Wfloat-equal \ - -Wpointer-arith \ - -Wmissing-declarations \ - -Wpacked \ - -Wno-unused-parameter \ - -Wno-packed \ - -Werror=format-security \ - -Werror=array-bounds \ - -Wfatal-errors \ - -Werror=unused-variable \ - -Werror=reorder \ - -Werror=uninitialized \ - -Werror=init-self - -# Add compiler specific options -ifeq ($(USE_GCC),1) -ARCHDEFINES += -ARCHWARNINGS += -Wdouble-promotion \ - -Wformat=1 \ - -Werror=unused-but-set-variable \ - -Werror=double-promotion -ARCHOPTIMIZATION += -fno-strength-reduce -else -ARCHWARNINGS += -Wno-gnu-array-member-paren-init -endif - -# -Werror=float-conversion - works, just needs to be phased in with some effort and needs GCC 4.9+ -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -# C-specific warnings -# -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wbad-function-cast \ - -Wstrict-prototypes \ - -Wmissing-prototypes \ - -Wnested-externs - -# Add compiler specific options -ifeq ($(USE_GCC),1) -ARCHCWARNINGS += -Wold-style-declaration \ - -Wmissing-parameter-type \ - -Wno-error=unused-local-typedefs \ - -Wno-error=enum-compare \ - -Wno-error=float-equal -endif - -# C++-specific warnings -# -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-missing-field-initializers - -# pull in *just* libm from the toolchain ... this is grody -LIBM := $(shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a) -#EXTRA_LIBS += $(LIBM) -#EXTRA_LIBS += ${PX4_BASE}../muorb_krait/lib/libmuorb.so -EXTRA_LIBS += -pthread -lm -lrt - -# Flags we pass to the C compiler -# -CFLAGS = $(ARCHCFLAGS) \ - $(ARCHCWARNINGS) \ - $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) \ - $(ARCHINCLUDES) \ - $(INSTRUMENTATIONDEFINES) \ - $(ARCHDEFINES) \ - $(EXTRADEFINES) \ - $(EXTRACFLAGS) \ - -fno-common \ - $(addprefix -I,$(INCLUDE_DIRS)) - -# Flags we pass to the C++ compiler -# -CXXFLAGS = $(ARCHCXXFLAGS) \ - $(ARCHWARNINGSXX) \ - $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) \ - $(ARCHXXINCLUDES) \ - $(INSTRUMENTATIONDEFINES) \ - $(ARCHDEFINES) \ - -DCONFIG_WCHAR_BUILTIN \ - $(EXTRADEFINES) \ - $(EXTRACXXFLAGS) \ - -Wno-effc++ \ - $(addprefix -I,$(INCLUDE_DIRS)) - -ifeq ($(USE_GCC),0) -CXXFLAGS += -Wno-deprecated-register \ - -Wno-tautological-constant-out-of-range-compare \ - -Wno-unused-private-field \ - -Wno-unused-const-variable -endif - -# Flags we pass to the assembler -# -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ \ - $(EXTRADEFINES) \ - $(EXTRAAFLAGS) - -LDSCRIPT = $(PX4_BASE)/makefiles/posix/ld.script -# Flags we pass to the linker -# -LDFLAGS += $(EXTRALDFLAGS) \ - $(addprefix -L,$(LIB_DIRS)) - -# Compiler support library -# -LIBGCC := $(shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name) - -# Files that the final link depends on -# -#LINK_DEPS += $(LDSCRIPT) -LINK_DEPS += - -# Files to include to get automated dependencies -# -DEP_INCLUDES = $(subst .o,.d,$(OBJS)) - -# Compile C source $1 to object $2 -# as a side-effect, generate a dependency file -# -define COMPILE - @$(ECHO) "CC: $1" - @$(MKDIR) -p $(dir $2) - $(Q) $(CCACHE) $(CC) -MD -c $(CFLAGS) $(abspath $1) -o $2 -endef - -# Compile C++ source $1 to $2 -# as a side-effect, generate a dependency file -# -define COMPILEXX - @$(ECHO) "CXX: $1" - @$(MKDIR) -p $(dir $2) - @$(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2 - $(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2 -endef - -# Assemble $1 into $2 -# -define ASSEMBLE - @$(ECHO) "AS: $1" - @$(MKDIR) -p $(dir $2) - $(Q) $(CC) -c $(AFLAGS) $(abspath $1) -o $2 -endef - -# Produce partially-linked $1 from files in $2 -# -#$(Q) $(LD) -Ur -o $1 $2 # -Ur not supported in ld.gold -define PRELINK - @$(ECHO) "PRELINK: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(LD) -Ur -o $1 $2 - -endef -# Produce partially-linked $1 from files in $2 -# -#$(Q) $(LD) -Ur -o $1 $2 # -Ur not supported in ld.gold -define PRELINKF - @$(ECHO) "PRELINK: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(LD) -Ur -T$(LDSCRIPT) -o $1 $2 - -endef -# $(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1 - -# Update the archive $1 with the files in $2 -# -define ARCHIVE - @$(ECHO) "AR: $2" - @$(MKDIR) -p $(dir $1) - $(Q) $(AR) $1 $2 -endef - -# Link the objects in $2 into the shared library $1 -# -define LINK_A - @$(ECHO) "LINK_A: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(AR) $1 $2 -endef - -# Link the objects in $2 into the shared library $1 -# -define LINK_SO - @$(ECHO) "LINK_SO: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(CXX) $(LDFLAGS) -shared -Wl,-soname,`basename $1`.1 -o $1 $2 $(LIBS) -pthread -lc -endef - -# Link the objects in $2 into the application $1 -# -define LINK - @$(ECHO) "LINK: $1" - @$(MKDIR) -p $(dir $1) - $(Q) $(CXX) $(CXXFLAGS) $(LDFLAGS) -o $1 $2 $(LIBS) $(EXTRA_LIBS) $(LIBGCC) - -endef - diff --git a/makefiles/qurt/DISABLE_config_qurt_muorb_test.mk b/makefiles/qurt/DISABLE_config_qurt_muorb_test.mk deleted file mode 100644 index 07f4355073..0000000000 --- a/makefiles/qurt/DISABLE_config_qurt_muorb_test.mk +++ /dev/null @@ -1,77 +0,0 @@ -# -# Makefile for the Foo *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -#MODULES += drivers/blinkm -#MODULES += drivers/pwm_out_sim -#MODULES += drivers/led -#MODULES += drivers/rgbled -#MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -#MODULES += systemcmds/param - -# -# General system control -# -#MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -#MODULES += modules/attitude_estimator_ekf -#MODULES += modules/ekf_att_pos_estimator - -# -# Vehicle Control -# -#MODULES += modules/mc_att_control - -# -# Library modules -# -#MODULES += modules/systemlib -#MODULES += modules/systemlib/mixer -MODULES += modules/uORB -#MODULES += modules/dataman -#MODULES += modules/sdlog2 -#MODULES += modules/simulator -#MODULES += modules/commander - -# -# Libraries -# -#MODULES += lib/mathlib -#MODULES += lib/mathlib/math/filter -#MODULES += lib/geo -#MODULES += lib/geo_lookup -#MODULES += lib/conversion - -# -# QuRT port -# -MODULES += platforms/qurt/px4_layer -#MODULES += platforms/posix/drivers/accelsim -#MODULES += platforms/posix/drivers/gyrosim -#MODULES += platforms/posix/drivers/adcsim -#MODULES += platforms/posix/drivers/barosim - -# -# Unit tests -# -MODULES += platforms/qurt/tests/muorb -#MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue - -# -# sources for muorb over fastrpc -# -MODULES += $(PX4_BASE)/../muorb_qurt/ diff --git a/makefiles/qurt/board_qurt.mk b/makefiles/qurt/board_qurt.mk deleted file mode 100644 index 1038a90b76..0000000000 --- a/makefiles/qurt/board_qurt.mk +++ /dev/null @@ -1,11 +0,0 @@ -# -# Board-specific definitions for the Linux port of PX4 -# - -# -# Configure the toolchain -# -CONFIG_ARCH = HEXAGON -CONFIG_BOARD = QURTTEST - -include $(PX4_MK_DIR)/qurt/toolchain_hexagon.mk diff --git a/makefiles/qurt/config_qurt_adsp.mk b/makefiles/qurt/config_qurt_adsp.mk deleted file mode 100644 index fcd63eef57..0000000000 --- a/makefiles/qurt/config_qurt_adsp.mk +++ /dev/null @@ -1,87 +0,0 @@ -#Added configuration specific flags here. - -ifndef HEXAGON_DRIVERS_ROOT -$(error HEXAGON_DRIVERS_ROOT is not set) -endif -ifndef EAGLE_DRIVERS_SRC -$(error EAGLE_DRIVERS_SRC is not set) -endif - -INCLUDE_DIRS += $(HEXAGON_DRIVERS_ROOT)/inc - -# For Actual flight we need to link against the driver dynamic libraries -LDFLAGS += -L${HEXAGON_DRIVERS_ROOT}/libs -lmpu9x50 -LDFLAGS += -luart_esc -LDFLAGS += -lcsr_gps -LDFLAGS += -lrc_receiver - -# -# Makefile for the EAGLE QuRT *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -MODULES += modules/sensors -MODULES += $(EAGLE_DRIVERS_SRC)/mpu9x50 -MODULES += $(EAGLE_DRIVERS_SRC)/uart_esc -MODULES += $(EAGLE_DRIVERS_SRC)/rc_receiver -MODULES += $(EAGLE_DRIVERS_SRC)/csr_gps - -# -# System commands -# -MODULES += systemcmds/param - - -# -# General system control -# - -# -# Estimation modules (EKF/ SO3 / other filters) -# -MODULES += modules/ekf_att_pos_estimator -MODULES += modules/attitude_estimator_q -MODULES += modules/position_estimator_inav - -# -# Vehicle Control -# -MODULES += modules/mc_att_control -MODULES += modules/mc_pos_control - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/uORB -#MODULES += modules/dataman -MODULES += modules/commander -MODULES += modules/controllib - -# -# Libraries -# -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion - -# -# QuRT port -# -MODULES += platforms/qurt/px4_layer -MODULES += platforms/posix/work_queue - -# -# Unit tests -# - -# -# sources for muorb over fastrpc -# -MODULES += modules/muorb/adsp/ diff --git a/makefiles/qurt/config_qurt_default.mk b/makefiles/qurt/config_qurt_default.mk deleted file mode 100644 index e09754ab7b..0000000000 --- a/makefiles/qurt/config_qurt_default.mk +++ /dev/null @@ -1,83 +0,0 @@ -# -# Makefile for the Foo *default* configuration -# - -# -# Use the configuration's ROMFS. -# -#ROMFS_ROOT = $(PX4_BASE)/ROMFS/px4fmu_common - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/blinkm -MODULES += drivers/pwm_out_sim -MODULES += drivers/led -MODULES += drivers/rgbled -MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -MODULES += systemcmds/param - -# -# General system control -# -#MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -#MODULES += modules/attitude_estimator_ekf -#MODULES += modules/ekf_att_pos_estimator - -# -# Vehicle Control -# -#MODULES += modules/mc_att_control - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/uORB -#MODULES += modules/dataman -#MODULES += modules/sdlog2 -#MODULES += modules/simulator -#MODULES += modules/commander - -# -# Libraries -# -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -#MODULES += lib/geo -#MODULES += lib/geo_lookup -MODULES += lib/conversion - -# -# QuRT port -# -MODULES += platforms/qurt/px4_layer -MODULES += platforms/posix/work_queue -MODULES += platforms/posix/drivers/accelsim -MODULES += platforms/posix/drivers/gyrosim -MODULES += platforms/posix/drivers/adcsim -MODULES += platforms/posix/drivers/barosim - -# -# Unit tests -# -MODULES += platforms/qurt/tests/hello -MODULES += platforms/posix/tests/vcdev_test -MODULES += platforms/posix/tests/hrt_test -MODULES += platforms/posix/tests/wqueue - -# -# sources for muorb over fastrpc -# -#MODULES += $(PX4_BASE)/../muorb_qurt/ diff --git a/makefiles/qurt/config_qurt_hello.mk b/makefiles/qurt/config_qurt_hello.mk deleted file mode 100644 index 2ec18b7fce..0000000000 --- a/makefiles/qurt/config_qurt_hello.mk +++ /dev/null @@ -1,74 +0,0 @@ -# -# Makefile for the Foo *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -#MODULES += drivers/blinkm -#MODULES += drivers/pwm_out_sim -#MODULES += drivers/led -#MODULES += drivers/rgbled -#MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -MODULES += systemcmds/param - -# -# General system control -# -#MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -#MODULES += modules/attitude_estimator_ekf -#MODULES += modules/ekf_att_pos_estimator - -# -# Vehicle Control -# -#MODULES += modules/mc_att_control - -# -# Library modules -# -MODULES += modules/systemlib -#MODULES += modules/systemlib/mixer -MODULES += modules/uORB -#MODULES += modules/dataman -#MODULES += modules/sdlog2 -#MODULES += modules/simulator -#MODULES += modules/commander - -# -# Libraries -# -#MODULES += lib/mathlib -#MODULES += lib/mathlib/math/filter -#MODULES += lib/geo -#MODULES += lib/geo_lookup -#MODULES += lib/conversion - -# -# QuRT port -# -MODULES += platforms/qurt/px4_layer -MODULES += platforms/posix/work_queue -#MODULES += platforms/posix/drivers/accelsim -#MODULES += platforms/posix/drivers/gyrosim -#MODULES += platforms/posix/drivers/adcsim -#MODULES += platforms/posix/drivers/barosim - -# -# Unit tests -# -MODULES += platforms/qurt/tests/hello -#MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue - diff --git a/makefiles/qurt/config_qurt_hil.mk b/makefiles/qurt/config_qurt_hil.mk deleted file mode 100644 index 6f14dd6a00..0000000000 --- a/makefiles/qurt/config_qurt_hil.mk +++ /dev/null @@ -1,84 +0,0 @@ -# -# Makefile for the Foo *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -MODULES += drivers/boards/sitl -#MODULES += drivers/blinkm -MODULES += drivers/pwm_out_sim -MODULES += drivers/led -MODULES += drivers/rgbled -MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -MODULES += systemcmds/param -MODULES += systemcmds/mixer - -# -# General system control -# -#MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -#MODULES += modules/attitude_estimator_ekf -MODULES += modules/ekf_att_pos_estimator -MODULES += modules/attitude_estimator_q -MODULES += modules/position_estimator_inav - -# -# Vehicle Control -# -MODULES += modules/mc_att_control -MODULES += modules/mc_pos_control - -# -# Library modules -# -MODULES += modules/systemlib -MODULES += modules/systemlib/mixer -MODULES += modules/uORB -#MODULES += modules/dataman -#MODULES += modules/sdlog2 -#MODULES += modules/simulator -MODULES += modules/commander - -# -# Libraries -# -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion -MODULES += modules/controllib - -# -# QuRT port -# -MODULES += platforms/qurt/px4_layer -MODULES += platforms/posix/work_queue -#MODULES += platforms/posix/drivers/accelsim -#MODULES += platforms/posix/drivers/gyrosim -#MODULES += platforms/posix/drivers/adcsim -#MODULES += platforms/posix/drivers/barosim - -# -# Unit tests -# -#MODULES += platforms/qurt/tests/muorb -#MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue - -# -# sources for muorb over fastrpc -# -MODULES += modules/muorb/adsp/ diff --git a/makefiles/qurt/config_qurt_muorb_test.mk b/makefiles/qurt/config_qurt_muorb_test.mk deleted file mode 100644 index 57a961734f..0000000000 --- a/makefiles/qurt/config_qurt_muorb_test.mk +++ /dev/null @@ -1,80 +0,0 @@ -# -# Makefile for the Foo *default* configuration -# - -# -# Board support modules -# -MODULES += drivers/device -#MODULES += drivers/blinkm -#MODULES += drivers/pwm_out_sim -#MODULES += drivers/led -#MODULES += drivers/rgbled -#MODULES += modules/sensors -#MODULES += drivers/ms5611 - -# -# System commands -# -#MODULES += systemcmds/param -#MODULES += systemcmds/mixer - -# -# General system control -# -#MODULES += modules/mavlink - -# -# Estimation modules (EKF/ SO3 / other filters) -# -#MODULES += modules/attitude_estimator_ekf -#MODULES += modules/ekf_att_pos_estimator - -# -# Vehicle Control -# -#MODULES += modules/mc_att_control -#MODULES += modules/mc_pos_control - -# -# Library modules -# -MODULES += modules/systemlib -#MODULES += modules/systemlib/mixer -MODULES += modules/uORB -#MODULES += modules/dataman -#MODULES += modules/sdlog2 -#MODULES += modules/simulator -#MODULES += modules/commander - -# -# Libraries -# -MODULES += lib/mathlib -MODULES += lib/mathlib/math/filter -MODULES += lib/geo -MODULES += lib/geo_lookup -MODULES += lib/conversion - -# -# QuRT port -# -MODULES += platforms/qurt/px4_layer -MODULES += platforms/posix/work_queue -#MODULES += platforms/posix/drivers/accelsim -#MODULES += platforms/posix/drivers/gyrosim -#MODULES += platforms/posix/drivers/adcsim -#MODULES += platforms/posix/drivers/barosim - -# -# Unit tests -# -MODULES += platforms/qurt/tests/muorb -#MODULES += platforms/posix/tests/vcdev_test -#MODULES += platforms/posix/tests/hrt_test -#MODULES += platforms/posix/tests/wqueue - -# -# sources for muorb over fastrpc -# -MODULES += modules/muorb/adsp/ diff --git a/makefiles/qurt/firmware_qurt.mk b/makefiles/qurt/firmware_qurt.mk deleted file mode 100644 index ac87683487..0000000000 --- a/makefiles/qurt/firmware_qurt.mk +++ /dev/null @@ -1,62 +0,0 @@ -# -# Copyright (c) 2012-2015 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. -# - -# -# Built products -# -FIRMWARES = $(foreach config,$(CONFIGS),$(BUILD_DIR)$(config).build/firmware.a) - -all: $(FIRMWARES) - -# -# Generate FIRMWARES. -# -.PHONY: $(FIRMWARES) -$(BUILD_DIR)%.build/firmware.a: config = $(patsubst $(BUILD_DIR)%.build/firmware.a,%,$@) -$(BUILD_DIR)%.build/firmware.a: work_dir = $(BUILD_DIR)$(config).build/ -$(FIRMWARES): $(BUILD_DIR)%.build/firmware.a: generateuorbtopicheaders - @$(ECHO) %%%% - @$(ECHO) %%%% Building $(config) in $(work_dir) - @$(ECHO) %%%% - $(Q) $(MKDIR) -p $(work_dir) - $(Q) $(MAKE) -r --no-print-directory -C $(work_dir) \ - -f $(PX4_MK_DIR)firmware.mk \ - CONFIG=$(config) \ - WORK_DIR=$(work_dir) \ - $(FIRMWARE_GOAL) - -HEXAGON_TOOLS_ROOT ?= /opt/6.4.03 -V_ARCH = v5 -HEXAGON_CLANG_BIN = $(addsuffix /qc/bin,$(HEXAGON_TOOLS_ROOT)) -SIM = $(HEXAGON_CLANG_BIN)/hexagon-sim -SIMFLAGS+= -m$(V_ARCH) -sim: - $(SIM) $(SIMFLAGS) Build/qurt_default.build/mainapp diff --git a/makefiles/qurt/qurt.mk b/makefiles/qurt/qurt.mk deleted file mode 100644 index 00bbe8dc8f..0000000000 --- a/makefiles/qurt/qurt.mk +++ /dev/null @@ -1,39 +0,0 @@ -# -# Copyright (C) 2015 Mark Charlebois. 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. -# - -# -# Rules and definitions related to handling the Linux specific impl when -# building firmware. -# - -MODULES += \ - platforms/common - diff --git a/makefiles/qurt/qurt_eigen.patch b/makefiles/qurt/qurt_eigen.patch deleted file mode 100644 index 9ea57403ba..0000000000 --- a/makefiles/qurt/qurt_eigen.patch +++ /dev/null @@ -1,17 +0,0 @@ -This patch is required for QuRT. complex.h defines "I" and it replaces "I" in the -enum definition without this patch creating an error. - -diff --git a/Eigen/src/Core/SolveTriangular.h b/Eigen/src/Core/SolveTriangular.h -index ef17f28..1116270 100644 ---- a/Eigen/src/Core/SolveTriangular.h -+++ b/Eigen/src/Core/SolveTriangular.h -@@ -112,6 +112,9 @@ template - struct triangular_solver_unroller; - -+#ifdef __PX4_QURT -+#undef I -+#endif - template - struct triangular_solver_unroller { - enum { diff --git a/makefiles/qurt/qurt_elf.mk b/makefiles/qurt/qurt_elf.mk deleted file mode 100644 index 73f1cd4ece..0000000000 --- a/makefiles/qurt/qurt_elf.mk +++ /dev/null @@ -1,85 +0,0 @@ -# -# 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. -# - -# -# Makefile for PX4 Linux based firmware images. -# - -################################################################################ -# Build rules -################################################################################ - -# -# What we're going to build. -# - -EXTRALDFLAGS = -Wl,-soname=libpx4.so -PRODUCT_SHARED_LIB = $(WORK_DIR)firmware.a -PRODUCT_SHARED_PRELINK = $(WORK_DIR)firmware.o - -.PHONY: firmware -firmware: $(PRODUCT_SHARED_LIB) $(WORK_DIR)libpx4.so $(WORK_DIR)mainapp - -# -# Built product rules -# - -$(PRODUCT_SHARED_PRELINK): $(OBJS) $(MODULE_OBJS) $(LIBRARY_LIBS) $(GLOBAL_DEPS) $(LINK_DEPS) $(MODULE_MKFILES) - $(call PRELINKF,$@,$(OBJS) $(MODULE_OBJS) $(LIBRARY_LIBS)) - -$(PRODUCT_SHARED_LIB): $(PRODUCT_SHARED_PRELINK) - $(call LINK_A,$@,$(PRODUCT_SHARED_PRELINK)) - -$(WORK_DIR)apps.cpp: $(PX4_BASE)/Tools/qurt_apps.py - $(PX4_BASE)/Tools/qurt_apps.py > $@ - -$(WORK_DIR)apps.o: $(WORK_DIR)apps.cpp - $(call COMPILEXX,$<, $@) - mv $(WORK_DIR)apps.cpp $(WORK_DIR)apps.cpp_sav - -$(WORK_DIR)libpx4.so: $(WORK_DIR)apps.o $(PRODUCT_SHARED_LIB) - $(call LINK_SO,$@, $^) - -$(WORK_DIR)dspal_stub.o: $(PX4_BASE)/src/platforms/qurt/dspal/dspal_stub.c - $(call COMPILENOSHARED,$^, $@) - -$(WORK_DIR)mainapp: $(WORK_DIR)dspal_stub.o - $(call LINK,$@, $^) - -# -# Utility rules -# - -.PHONY: clean -clean: $(MODULE_CLEANS) - @$(ECHO) %% cleaning - $(Q) $(REMOVE) $(PRODUCT_ELF) - $(Q) $(REMOVE) $(OBJS) $(DEP_INCLUDES) $(EXTRA_CLEANS) diff --git a/makefiles/qurt/setup.sh b/makefiles/qurt/setup.sh deleted file mode 100755 index 8ffb13cc4b..0000000000 --- a/makefiles/qurt/setup.sh +++ /dev/null @@ -1,48 +0,0 @@ -############################################################################ -# -# Copyright (c) 2015 Mark Charlebois. 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. -# -# ########################################################################### - -# -# This file is required to modify the PX4 project so it can be build with -# the Hexagon toolchain. -# -# 1. Downgrade Eigen to 3.2 because the C++11 features of latest version -# are not supported -# 2. Patch Eigen because the Hexagon toolchain complex.h defines "I" -# - -cd $1 -cd src/lib/eigen/ -git checkout . -git checkout e7850ed81f9c469e02df496ef09ae32ec0379b71 -patch -p1 < ../../../makefiles/qurt/qurt_eigen.patch - diff --git a/makefiles/qurt/toolchain_hexagon.mk b/makefiles/qurt/toolchain_hexagon.mk deleted file mode 100644 index 77a9d4e838..0000000000 --- a/makefiles/qurt/toolchain_hexagon.mk +++ /dev/null @@ -1,345 +0,0 @@ -# -# Copyright (C) 2015 Mark Charlebois. 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. -# - -# -# Definitions for a generic GNU ARM-EABI toolchain -# - -#$(info TOOLCHAIN gnu-arm-eabi) - -# Toolchain commands. Normally only used inside this file. -# -HEXAGON_TOOLS_ROOT ?= /opt/6.4.03 -#HEXAGON_TOOLS_ROOT = /opt/6.4.05 -HEXAGON_SDK_ROOT ?= /opt/Hexagon_SDK/2.0 -V_ARCH = v5 -CROSSDEV = hexagon- -HEXAGON_BIN = $(addsuffix /gnu/bin,$(HEXAGON_TOOLS_ROOT)) -HEXAGON_CLANG_BIN = $(addsuffix /qc/bin,$(HEXAGON_TOOLS_ROOT)) -HEXAGON_LIB_DIR = $(HEXAGON_TOOLS_ROOT)/gnu/hexagon/lib -HEXAGON_ISS_DIR = $(HEXAGON_TOOLS_ROOT)/qc/lib/iss -TOOLSLIB = $(HEXAGON_TOOLS_ROOT)/dinkumware/lib/$(V_ARCH)/G0 -QCTOOLSLIB = $(HEXAGON_TOOLS_ROOT)/qc/lib/$(V_ARCH)/G0 -QURTLIB = $(HEXAGON_SDK_ROOT)/lib/common/qurt/ADSP$(V_ARCH)MP/lib -DSPAL_INCS ?= $(PX4_BASE)/src/lib/dspal - - -CC = $(HEXAGON_CLANG_BIN)/$(CROSSDEV)clang -CXX = $(HEXAGON_CLANG_BIN)/$(CROSSDEV)clang++ -CPP = $(HEXAGON_CLANG_BIN)/$(CROSSDEV)clang -E -LD = $(HEXAGON_BIN)/$(CROSSDEV)ld -AR = $(HEXAGON_BIN)/$(CROSSDEV)ar rcs -NM = $(HEXAGON_BIN)/$(CROSSDEV)nm -OBJCOPY = $(HEXAGON_BIN)/$(CROSSDEV)objcopy -OBJDUMP = $(HEXAGON_BIN)/$(CROSSDEV)objdump -HEXAGON_GCC = $(HEXAGON_BIN)/$(CROSSDEV)gcc - -QURTLIBS = \ - $(QCTOOLSLIB)/libdl.a \ - $(TOOLSLIB)/init.o \ - $(TOOLSLIB)/libc.a \ - $(TOOLSLIB)/libqcc.a \ - $(TOOLSLIB)/libstdc++.a \ - $(QURTLIB)/crt0.o \ - $(QURTLIB)/libqurt.a \ - $(QURTLIB)/libqurtkernel.a \ - $(QURTLIB)/libqurtcfs.a \ - $(QURTLIB)/libqube_compat.a \ - $(QURTLIB)/libtimer.a \ - $(QURTLIB)/libposix.a \ - $(QURTLIB)/../examples/cust_config.o \ - $(QCTOOLSLIB)/libhexagon.a \ - $(TOOLSLIB)/fini.o - -DYNAMIC_LIBS = \ - -Wl,$(TOOLSLIB)/pic/libstdc++.a - - -# Check if the right version of the toolchain is available -# -CROSSDEV_VER_SUPPORTED = 6.4.03 6.4.05 -CROSSDEV_VER_FOUND = $(shell $(CC) --version | sed -n 's/^.*version \([\. 0-9]*\),.*$$/\1/p') - -ifeq (,$(findstring $(CROSSDEV_VER_FOUND), $(CROSSDEV_VER_SUPPORTED))) -$(error Unsupported version of $(CC), found: $(CROSSDEV_VER_FOUND) instead of one in: $(CROSSDEV_VER_SUPPORTED)) -endif - - -# XXX this is pulled pretty directly from the fmu Make.defs - needs cleanup - -MAXOPTIMIZATION := -O0 - -# Base CPU flags for each of the supported architectures. -# -ARCHCPUFLAGS = -m$(V_ARCH) -G0 - - -# Set the board flags -# -ifeq ($(CONFIG_BOARD),) -$(error Board config does not define CONFIG_BOARD) -endif -ARCHDEFINES += -DCONFIG_ARCH_BOARD_$(CONFIG_BOARD) \ - -D__PX4_QURT -D__PX4_POSIX \ - -D_PID_T -D_UID_T -D_TIMER_T\ - -Dnoreturn_function= \ - -D__EXPORT= \ - -Drestrict= \ - -D_DEBUG \ - -I$(DSPAL_INCS)/include \ - -I$(DSPAL_INCS)/sys \ - -I$(HEXAGON_TOOLS_ROOT)/gnu/hexagon/include \ - -I$(PX4_BASE)/src/lib/eigen \ - -I$(PX4_BASE)/src/platforms/qurt/include \ - -I$(PX4_BASE)/src/platforms/posix/include \ - -I$(PX4_BASE)/mavlink/include/mavlink \ - -I$(PX4_BASE)/../inc \ - -I$(QURTLIB)/..//include \ - -I$(HEXAGON_SDK_ROOT)/inc \ - -I$(HEXAGON_SDK_ROOT)/inc/stddef \ - -Wno-error=shadow - - - -# optimisation flags -# -ARCHOPTIMIZATION = \ - -O0 \ - -g \ - -fno-strict-aliasing \ - -fdata-sections \ - -fpic \ - -fno-zero-initialized-in-bss - -#-fomit-frame-pointer \ -#-funsafe-math-optimizations \ -#-ffunction-sections -#$(MAXOPTIMIZATION) - -# enable precise stack overflow tracking -# note - requires corresponding support in NuttX -INSTRUMENTATIONDEFINES = $(ARCHINSTRUMENTATIONDEFINES_$(CONFIG_ARCH)) - -# Language-specific flags -# -ARCHCFLAGS = -std=gnu99 -D__CUSTOM_FILE_IO__ -ARCHCXXFLAGS = -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -D__CUSTOM_FILE_IO__ - -# Generic warnings -# -ARCHWARNINGS = -Wall \ - -Wextra \ - -Werror \ - -Wno-unused-parameter \ - -Wno-unused-function \ - -Wno-unused-variable \ - -Wno-gnu-array-member-paren-init \ - -Wno-cast-align \ - -Wno-missing-braces \ - -Wno-strict-aliasing -# -Werror=float-conversion - works, just needs to be phased in with some effort and needs GCC 4.9+ -# -Wcast-qual - generates spurious noreturn attribute warnings, try again later -# -Wconversion - would be nice, but too many "risky-but-safe" conversions in the code -# -Wcast-align - would help catch bad casts in some cases, but generates too many false positives - -# C-specific warnings -# -ARCHCWARNINGS = $(ARCHWARNINGS) \ - -Wstrict-prototypes \ - -Wnested-externs - -# C++-specific warnings -# -ARCHWARNINGSXX = $(ARCHWARNINGS) \ - -Wno-missing-field-initializers - -# pull in *just* libm from the toolchain ... this is grody -LIBM := $(shell $(CC) $(ARCHCPUFLAGS) -print-file-name=libm.a) -EXTRA_LIBS += $(LIBM) - -# Flags we pass to the C compiler -# -CFLAGS = $(ARCHCFLAGS) \ - $(ARCHCWARNINGS) \ - $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) \ - $(ARCHINCLUDES) \ - $(INSTRUMENTATIONDEFINES) \ - $(ARCHDEFINES) \ - $(EXTRADEFINES) \ - $(EXTRACFLAGS) \ - $(addprefix -I,$(INCLUDE_DIRS)) - - #-fno-common -# Flags we pass to the C++ compiler -# -CXXFLAGS = $(ARCHCXXFLAGS) \ - $(ARCHWARNINGSXX) \ - $(ARCHOPTIMIZATION) \ - $(ARCHCPUFLAGS) \ - $(ARCHXXINCLUDES) \ - $(INSTRUMENTATIONDEFINES) \ - $(ARCHDEFINES) \ - -DCONFIG_WCHAR_BUILTIN \ - $(EXTRADEFINES) \ - $(EXTRACXXFLAGS) \ - $(addprefix -I,$(INCLUDE_DIRS)) - -# Flags we pass to the assembler -# -AFLAGS = $(CFLAGS) -D__ASSEMBLY__ \ - $(EXTRADEFINES) \ - $(EXTRAAFLAGS) - -LDSCRIPT = $(PX4_BASE)/makefiles/posix/ld.script -# Flags we pass to the linker -# -LDFLAGS += -g -mv5 -mG0lib -G0 -fpic -shared \ - -Wl,-Bsymbolic \ - -Wl,--wrap=malloc \ - -Wl,--wrap=calloc \ - -Wl,--wrap=free \ - -Wl,--wrap=realloc \ - -Wl,--wrap=memalign \ - -Wl,--wrap=__stack_chk_fail \ - -lc \ - $(EXTRALDFLAGS) \ - $(addprefix -L,$(LIB_DIRS)) - -# Compiler support library -# -LIBGCC := $(shell $(CC) $(ARCHCPUFLAGS) -print-libgcc-file-name) - -# Files that the final link depends on -# -LINK_DEPS += $(LDSCRIPT) - -# Files to include to get automated dependencies -# -DEP_INCLUDES = $(subst .o,.d,$(OBJS)) - -# Compile C source $1 to object $2 -# as a side-effect, generate a dependency file -# -define COMPILENOSHARED - @$(ECHO) "CC: $1" - @$(MKDIR) -p $(dir $2) - @echo $(Q) $(CCACHE) $(CC) -MD -c $(CFLAGS) $(abspath $1) -o $2 - $(Q) $(CCACHE) $(CC) -MD -c $(CFLAGS) $(abspath $1) -o $2 -endef - -# Compile C source $1 to object $2 for use in shared library -# as a side-effect, generate a dependency file -# -define COMPILE - @$(ECHO) "CC: $1" - @$(MKDIR) -p $(dir $2) - @echo $(Q) $(CCACHE) $(CC) -MD -c $(CFLAGS) $(abspath $1) -o $2 - #$(Q) $(CCACHE) $(CC) -MD -c $(CFLAGS) -D__V_DYNAMIC__ -fPIC $(abspath $1) -o $2 - #$(CCACHE) $(CC) -MD -c $(CFLAGS) -D__V_DYNAMIC__ -D__FILENAME__=\"$(notdir $1)\" -fPIC $(abspath $1) -o $2 - $(CCACHE) $(CC) -c $(CFLAGS) -D__V_DYNAMIC__ -D__FILENAME__=\"$(notdir $1)\" $(abspath $1) -o $2 -endef - -# Compile C++ source $1 to $2 for use in shared library -# as a side-effect, generate a dependency file -# -define COMPILEXX - @$(ECHO) "CXX: $1" - @$(MKDIR) -p $(dir $2) - @echo $(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) $(abspath $1) -o $2 - #$(Q) $(CCACHE) $(CXX) -MD -c $(CXXFLAGS) -D__V_DYNAMIC__ -fPIC $(abspath $1) -o $2 - #$(CCACHE) $(CXX) -MD -c $(CXXFLAGS) -D__V_DYNAMIC__ -D__FILENAME__=\"$(notdir $1)\" -fPIC $(abspath $1) -o $2 - $(CCACHE) $(CXX) -c $(CXXFLAGS) -D__V_DYNAMIC__ -D__FILENAME__=\"$(notdir $1)\" $(abspath $1) -o $2 -endef - -# Assemble $1 into $2 -# -define ASSEMBLE - @$(ECHO) "AS: $1" - @$(MKDIR) -p $(dir $2) - $(Q) $(CC) -c $(AFLAGS) $(abspath $1) -o $2 -endef - -# Produce partially-linked $1 from files in $2 -# -#$(Q) $(LD) -Ur -o $1 $2 # -Ur not supported in ld.gold -define PRELINK - @$(ECHO) "PRELINK: $1" - @$(MKDIR) -p $(dir $1) - @echo $(Q) $(LD) -Ur -o $1 $2 - $(Q) $(LD) -Ur -o $1 $2 - -endef -# Produce partially-linked $1 from files in $2 -# -#$(Q) $(LD) -Ur -o $1 $2 # -Ur not supported in ld.gold -define PRELINKF - @$(ECHO) "PRELINKF: $1" - @$(MKDIR) -p $(dir $1) - @echo $(Q) $(LD) -Ur -T$(LDSCRIPT) -o $1 $2 - $(Q) $(LD) -Ur -T$(LDSCRIPT) -o $1 $2 - -endef -# $(Q) $(LD) -Ur -o $1 $2 && $(OBJCOPY) --localize-hidden $1 - -# Update the archive $1 with the files in $2 -# -define ARCHIVE - @$(ECHO) "AR: $2" - @$(MKDIR) -p $(dir $1) - $(Q) $(AR) $1 $2 -endef - -# Link the objects in $2 into the shared library $1 -# -define LINK_A - @$(ECHO) "LINK_A: $1" - @$(MKDIR) -p $(dir $1) - echo "$(Q) $(AR) $1 $2" - $(Q) $(AR) $1 $2 -endef - -# Link the objects in $2 into the shared library $1 -# -define LINK_SO - @$(ECHO) "LINK_SO: $1" - @$(MKDIR) -p $(dir $1) - $(HEXAGON_GCC) $(LDFLAGS) -o $1 -Wl,--whole-archive $2 -Wl,--no-whole-archive $(LIBS) $(DYNAMIC_LIBS) -endef - -# Link the objects in $2 into the application $1 -# -define LINK - @$(ECHO) "LINK: $1" - @$(MKDIR) -p $(dir $1) - $(LD) --section-start .start=0x1d000000 -o $1 --start-group $2 $(EXTRA_LIBS) $(QURTLIBS) --end-group --dynamic-linker= -E --force-dynamic -endef - diff --git a/makefiles/setup.mk b/makefiles/setup.mk deleted file mode 100644 index dd5637bcd9..0000000000 --- a/makefiles/setup.mk +++ /dev/null @@ -1,110 +0,0 @@ -# -# 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. -# - -# -# Path and tool setup -# - -export PX4_TARGET_OS ?= nuttx - -# PX4_TARGET_OS can be nuttx, posix, or qurt -ifeq ($(PX4_TARGET_OS),) -$(error Use: make PX4_TARGET_OS= where is nuttx, posix, or qurt) -endif - -# -# Some useful paths. -# -# Note that in general we always keep directory paths with the separator -# at the end, and join paths without explicit separators. This reduces -# the number of duplicate slashes we have lying around in paths, -# and is consistent with joining the results of $(dir) and $(notdir). -# -export PX4_INCLUDE_DIR = $(abspath $(PX4_BASE)/src/include)/ -export PX4_MODULE_SRC = $(abspath $(PX4_BASE)/src)/ -export PX4_LIB_DIR = $(abspath $(PX4_BASE)/src/lib)/ -export PX4_PLATFORMS_DIR = $(abspath $(PX4_BASE)/src/platforms)/ -export PX4_MK_DIR = $(abspath $(PX4_BASE)/makefiles)/ -export NUTTX_SRC = $(abspath $(PX4_BASE)/NuttX/nuttx)/ -export NUTTX_APP_SRC = $(abspath $(PX4_BASE)/NuttX/apps)/ -#export MAVLINK_SRC = $(abspath $(PX4_BASE)/mavlink/include/mavlink/v1.0)/ -export MAVLINK_SRC = $(abspath $(PX4_BASE)/mavlink)/ -export UAVCAN_DIR = $(abspath $(PX4_BASE)/uavcan)/ -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)/ -export PX4_VERSIONING_DIR = $(BUILD_DIR)versioning/ - -# -# Default include paths -# -export INCLUDE_DIRS := $(PX4_MODULE_SRC) \ - $(PX4_MODULE_SRC)/modules/ \ - $(PX4_INCLUDE_DIR) \ - $(PX4_LIB_DIR) \ - $(PX4_PLATFORMS_DIR) \ - $(PX4_VERSIONING_DIR) - -# -# Tools -# -export MKFW = $(PX4_BASE)/Tools/px_mkfw.py -export UPLOADER = $(PX4_BASE)/Tools/px_uploader.py -export COPY = cp -export COPYDIR = cp -Rf -export REMOVE = rm -f -export RMDIR = rm -rf -export GENROMFS = genromfs -export TOUCH = touch -export MKDIR = mkdir -export FIND = find -export ECHO = echo -export UNZIP_CMD = unzip -export PYTHON = python -export OPENOCD = openocd -export GREP = grep -export SIZE = size - -# -# Host-specific paths, hacks and fixups -# -export SYSTYPE := $(shell uname -s) - -ifeq ($(SYSTYPE),Darwin) -# Eclipse may not have the toolchain on its path. -export PATH := $(PATH):/usr/local/bin -endif - -# -# Makefile debugging. -# -export Q := $(if $(V),,@)