2011-05-09 01:14:50 +02:00
|
|
|
# Set up a default goal
|
|
|
|
.DEFAULT_GOAL := help
|
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
# Set up some macros for common directories within the tree
|
|
|
|
ROOT_DIR=$(CURDIR)
|
|
|
|
TOOLS_DIR=$(ROOT_DIR)/tools
|
|
|
|
BUILD_DIR=$(ROOT_DIR)/build
|
|
|
|
DL_DIR=$(ROOT_DIR)/downloads
|
|
|
|
|
2012-10-06 02:52:07 +02:00
|
|
|
# Function for converting an absolute path to one relative
|
|
|
|
# to the top of the source tree.
|
|
|
|
toprel = $(subst $(realpath $(ROOT_DIR))/,,$(abspath $(1)))
|
|
|
|
|
2011-04-25 00:21:26 +02:00
|
|
|
# Clean out undesirable variables from the environment and command-line
|
|
|
|
# to remove the chance that they will cause problems with our build
|
|
|
|
define SANITIZE_VAR
|
|
|
|
$(if $(filter-out undefined,$(origin $(1))),
|
|
|
|
$(info *NOTE* Sanitized $(2) variable '$(1)' from $(origin $(1)))
|
|
|
|
MAKEOVERRIDES = $(filter-out $(1)=%,$(MAKEOVERRIDES))
|
|
|
|
override $(1) :=
|
|
|
|
unexport $(1)
|
|
|
|
)
|
|
|
|
endef
|
|
|
|
|
|
|
|
# These specific variables can influence gcc in unexpected (and undesirable) ways
|
|
|
|
SANITIZE_GCC_VARS := TMPDIR GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH
|
|
|
|
SANITIZE_GCC_VARS += CFLAGS CPATH C_INCLUDE_PATH CPLUS_INCLUDE_PATH OBJC_INCLUDE_PATH DEPENDENCIES_OUTPUT
|
|
|
|
$(foreach var, $(SANITIZE_GCC_VARS), $(eval $(call SANITIZE_VAR,$(var),disallowed)))
|
|
|
|
|
|
|
|
# These specific variables used to be valid but now they make no sense
|
|
|
|
SANITIZE_DEPRECATED_VARS := USE_BOOTLOADER
|
|
|
|
$(foreach var, $(SANITIZE_DEPRECATED_VARS), $(eval $(call SANITIZE_VAR,$(var),deprecated)))
|
|
|
|
|
2012-12-16 01:32:38 +01:00
|
|
|
# Deal with unreasonable requests
|
|
|
|
# See: http://xkcd.com/149/
|
|
|
|
ifeq ($(MAKECMDGOALS),me a sandwich)
|
|
|
|
ifeq ($(shell whoami),root)
|
|
|
|
$(error Okay)
|
|
|
|
else
|
|
|
|
$(error What? Make it yourself)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
# Make sure this isn't being run as root
|
|
|
|
ifeq ($(shell whoami),root)
|
|
|
|
$(error You should not be running this as root)
|
|
|
|
endif
|
|
|
|
|
2012-11-28 04:43:02 +01:00
|
|
|
# Decide on a verbosity level based on the V= parameter
|
|
|
|
export AT := @
|
|
|
|
|
|
|
|
ifndef V
|
|
|
|
export V0 :=
|
|
|
|
export V1 := $(AT)
|
|
|
|
else ifeq ($(V), 0)
|
|
|
|
export V0 := $(AT)
|
|
|
|
export V1 := $(AT)
|
|
|
|
else ifeq ($(V), 1)
|
|
|
|
endif
|
|
|
|
|
2012-12-16 06:18:07 +01:00
|
|
|
# Make sure we know a few things about the architecture before including
|
|
|
|
# the tools.mk to ensure that we download/install the right tools.
|
|
|
|
UNAME := $(shell uname)
|
|
|
|
ARCH := $(shell uname -m)
|
|
|
|
|
2012-11-28 04:43:02 +01:00
|
|
|
include $(ROOT_DIR)/make/tools.mk
|
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
# We almost need to consider autoconf/automake instead of this
|
|
|
|
# I don't know if windows supports uname :-(
|
|
|
|
QT_SPEC=win32-g++
|
|
|
|
UAVOBJGENERATOR="$(BUILD_DIR)/ground/uavobjgenerator/debug/uavobjgenerator.exe"
|
|
|
|
ifeq ($(UNAME), Linux)
|
|
|
|
QT_SPEC=linux-g++
|
|
|
|
UAVOBJGENERATOR="$(BUILD_DIR)/ground/uavobjgenerator/uavobjgenerator"
|
|
|
|
endif
|
|
|
|
ifeq ($(UNAME), Darwin)
|
|
|
|
QT_SPEC=macx-g++
|
|
|
|
UAVOBJGENERATOR="$(BUILD_DIR)/ground/uavobjgenerator/uavobjgenerator"
|
|
|
|
endif
|
|
|
|
|
2011-03-06 14:41:46 +01:00
|
|
|
# OpenPilot GCS build configuration (debug | release)
|
|
|
|
GCS_BUILD_CONF ?= debug
|
2011-02-23 05:18:56 +01:00
|
|
|
|
|
|
|
# Set up misc host tools
|
|
|
|
RM=rm
|
|
|
|
|
2011-05-09 01:14:50 +02:00
|
|
|
.PHONY: help
|
|
|
|
help:
|
|
|
|
@echo
|
2011-05-09 02:03:22 +02:00
|
|
|
@echo " This Makefile is known to work on Linux and Mac in a standard shell environment."
|
|
|
|
@echo " It also works on Windows by following the instructions in make/winx86/README.txt."
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo
|
2011-05-09 01:14:50 +02:00
|
|
|
@echo " Here is a summary of the available targets:"
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo
|
|
|
|
@echo " [Tool Installers]"
|
2012-03-23 03:11:01 +01:00
|
|
|
@echo " qt_sdk_install - Install the QT v4.7.3 tools"
|
2012-05-07 00:33:01 +02:00
|
|
|
@echo " arm_sdk_install - Install the GNU ARM gcc toolchain"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " openocd_install - Install the OpenOCD JTAG daemon"
|
2011-06-08 04:48:46 +02:00
|
|
|
@echo " stm32flash_install - Install the stm32flash tool for unbricking boards"
|
2012-01-14 04:43:40 +01:00
|
|
|
@echo " dfuutil_install - Install the dfu-util tool for unbricking F4-based boards"
|
2012-10-05 20:38:39 +02:00
|
|
|
@echo " android_sdk_install - Install the Android SDK tools"
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo
|
|
|
|
@echo " [Big Hammer]"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " all - Generate UAVObjects, build openpilot firmware and gcs"
|
|
|
|
@echo " all_flight - Build all firmware, bootloaders and bootloader updaters"
|
|
|
|
@echo " all_fw - Build only firmware for all boards"
|
|
|
|
@echo " all_bl - Build only bootloaders for all boards"
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
@echo " all_bu - Build only bootloader updaters for all boards"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo
|
|
|
|
@echo " all_clean - Remove your build directory ($(BUILD_DIR))"
|
|
|
|
@echo " all_flight_clean - Remove all firmware, bootloaders and bootloader updaters"
|
|
|
|
@echo " all_fw_clean - Remove firmware for all boards"
|
|
|
|
@echo " all_bl_clean - Remove bootlaoders for all boards"
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
@echo " all_bu_clean - Remove bootloader updaters for all boards"
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo
|
2011-05-24 04:04:54 +02:00
|
|
|
@echo " all_<board> - Build all available images for <board>"
|
|
|
|
@echo " all_<board>_clean - Remove all available images for <board>"
|
|
|
|
@echo
|
2012-12-20 08:02:35 +01:00
|
|
|
@echo " all_ut - Build all unit tests"
|
|
|
|
@echo " all_ut_tap - Run all unit tests and capture all TAP output to files"
|
|
|
|
@echo " all_ut_run - Run all unit tests and dump TAP output to console"
|
|
|
|
@echo
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo " [Firmware]"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " <board> - Build firmware for <board>"
|
2011-05-24 04:04:54 +02:00
|
|
|
@echo " supported boards are ($(ALL_BOARDS))"
|
|
|
|
@echo " fw_<board> - Build firmware for <board>"
|
2011-06-08 04:47:07 +02:00
|
|
|
@echo " supported boards are ($(FW_BOARDS))"
|
2011-05-24 04:04:54 +02:00
|
|
|
@echo " fw_<board>_clean - Remove firmware for <board>"
|
|
|
|
@echo " fw_<board>_program - Use OpenOCD + JTAG to write firmware to <board>"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo
|
|
|
|
@echo " [Bootloader]"
|
|
|
|
@echo " bl_<board> - Build bootloader for <board>"
|
2011-06-08 04:47:07 +02:00
|
|
|
@echo " supported boards are ($(BL_BOARDS))"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " bl_<board>_clean - Remove bootloader for <board>"
|
|
|
|
@echo " bl_<board>_program - Use OpenOCD + JTAG to write bootloader to <board>"
|
|
|
|
@echo
|
|
|
|
@echo " [Bootloader Updater]"
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
@echo " bu_<board> - Build bootloader updater for <board>"
|
2011-06-08 04:47:07 +02:00
|
|
|
@echo " supported boards are ($(BU_BOARDS))"
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
@echo " bu_<board>_clean - Remove bootloader updater for <board>"
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo
|
2011-06-08 04:53:08 +02:00
|
|
|
@echo " [Unbrick a board]"
|
|
|
|
@echo " unbrick_<board> - Use the STM32's built in boot ROM to write a bootloader to <board>"
|
|
|
|
@echo " supported boards are ($(BL_BOARDS))"
|
2012-12-20 08:02:35 +01:00
|
|
|
@echo " [Unittests]"
|
|
|
|
@echo " ut_<test> - Build unit test <test>"
|
|
|
|
@echo " ut_<test>_tap - Run test and capture TAP output into a file"
|
|
|
|
@echo " ut_<test>_run - Run test and dump TAP output to console"
|
2011-06-08 04:53:08 +02:00
|
|
|
@echo
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo " [Simulation]"
|
2012-03-11 13:40:58 +01:00
|
|
|
@echo " sim_osx - Build OpenPilot simulation firmware for OSX"
|
|
|
|
@echo " sim_osx_clean - Delete all build output for the osx simulation"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " sim_win32 - Build OpenPilot simulation firmware for"
|
|
|
|
@echo " Windows using mingw and msys"
|
|
|
|
@echo " sim_win32_clean - Delete all build output for the win32 simulation"
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo
|
|
|
|
@echo " [GCS]"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " gcs - Build the Ground Control System (GCS) application"
|
|
|
|
@echo " gcs_clean - Remove the Ground Control System (GCS) application"
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo
|
|
|
|
@echo " [UAVObjects]"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " uavobjects - Generate source files from the UAVObject definition XML files"
|
|
|
|
@echo " uavobjects_test - parse xml-files - check for valid, duplicate ObjId's, ... "
|
|
|
|
@echo " uavobjects_<group> - Generate source files from a subset of the UAVObject definition XML files"
|
|
|
|
@echo " supported groups are ($(UAVOBJ_TARGETS))"
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo
|
2012-10-20 21:06:18 +02:00
|
|
|
@echo " Hint: Add V=1 to your command line to see verbose build output."
|
|
|
|
@echo
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo " Note: All tools will be installed into $(TOOLS_DIR)"
|
|
|
|
@echo " All build output will be placed in $(BUILD_DIR)"
|
|
|
|
@echo
|
|
|
|
|
|
|
|
.PHONY: all
|
|
|
|
all: uavobjects all_ground all_flight
|
|
|
|
|
|
|
|
.PHONY: all_clean
|
|
|
|
all_clean:
|
2011-02-28 11:25:56 +01:00
|
|
|
[ ! -d "$(BUILD_DIR)" ] || $(RM) -rf "$(BUILD_DIR)"
|
2011-02-23 05:18:56 +01:00
|
|
|
|
|
|
|
$(DL_DIR):
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(TOOLS_DIR):
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
$(BUILD_DIR):
|
|
|
|
mkdir -p $@
|
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Set up paths to tools
|
|
|
|
#
|
|
|
|
##############################
|
|
|
|
|
|
|
|
ifeq ($(shell [ -d "$(QT_SDK_DIR)" ] && echo "exists"), exists)
|
2012-12-16 08:14:34 +01:00
|
|
|
QMAKE = $(QT_SDK_QMAKE_PATH)
|
2011-02-23 05:18:56 +01:00
|
|
|
else
|
|
|
|
# not installed, hope it's in the path...
|
2012-12-16 08:14:34 +01:00
|
|
|
QMAKE = qmake
|
2011-02-23 05:18:56 +01:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(shell [ -d "$(ARM_SDK_DIR)" ] && echo "exists"), exists)
|
|
|
|
ARM_SDK_PREFIX := $(ARM_SDK_DIR)/bin/arm-none-eabi-
|
|
|
|
else
|
|
|
|
# not installed, hope it's in the path...
|
|
|
|
ARM_SDK_PREFIX ?= arm-none-eabi-
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(shell [ -d "$(OPENOCD_DIR)" ] && echo "exists"), exists)
|
|
|
|
OPENOCD := $(OPENOCD_DIR)/bin/openocd
|
|
|
|
else
|
|
|
|
# not installed, hope it's in the path...
|
|
|
|
OPENOCD ?= openocd
|
|
|
|
endif
|
|
|
|
|
2012-10-06 00:47:10 +02:00
|
|
|
ifeq ($(shell [ -d "$(ANDROID_SDK_DIR)" ] && echo "exists"), exists)
|
|
|
|
ANDROID := $(ANDROID_SDK_DIR)/tools/android
|
2012-10-10 07:10:53 +02:00
|
|
|
ANDROID_DX := $(ANDROID_SDK_DIR)/platform-tools/dx
|
2012-10-06 00:47:10 +02:00
|
|
|
else
|
|
|
|
# not installed, hope it's in the path...
|
|
|
|
ANDROID ?= android
|
2012-10-10 07:10:53 +02:00
|
|
|
ANDROID_DX ?= dx
|
2012-10-06 00:47:10 +02:00
|
|
|
endif
|
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# GCS related components
|
|
|
|
#
|
|
|
|
##############################
|
|
|
|
|
|
|
|
.PHONY: all_ground
|
|
|
|
all_ground: openpilotgcs
|
|
|
|
|
|
|
|
# Convenience target for the GCS
|
2011-04-25 00:22:50 +02:00
|
|
|
.PHONY: gcs gcs_clean
|
2011-02-23 05:18:56 +01:00
|
|
|
gcs: openpilotgcs
|
2011-04-25 00:22:50 +02:00
|
|
|
gcs_clean: openpilotgcs_clean
|
2011-02-23 05:18:56 +01:00
|
|
|
|
2012-10-20 19:19:16 +02:00
|
|
|
ifeq ($(V), 1)
|
|
|
|
GCS_SILENT :=
|
|
|
|
else
|
|
|
|
GCS_SILENT := silent
|
|
|
|
endif
|
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
.PHONY: openpilotgcs
|
|
|
|
openpilotgcs: uavobjects_gcs
|
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/ground/$@
|
2011-05-12 22:21:56 +02:00
|
|
|
$(V1) ( cd $(BUILD_DIR)/ground/$@ && \
|
2012-10-20 19:19:16 +02:00
|
|
|
$(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/openpilotgcs.pro -spec $(QT_SPEC) -r CONFIG+="$(GCS_BUILD_CONF) $(GCS_SILENT)" $(GCS_QMAKE_OPTS) && \
|
2011-02-23 05:18:56 +01:00
|
|
|
$(MAKE) -w ; \
|
|
|
|
)
|
|
|
|
|
2011-04-25 00:22:50 +02:00
|
|
|
.PHONY: openpilotgcs_clean
|
|
|
|
openpilotgcs_clean:
|
2011-06-08 04:42:59 +02:00
|
|
|
$(V0) @echo " CLEAN $@"
|
2011-04-25 00:22:50 +02:00
|
|
|
$(V1) [ ! -d "$(BUILD_DIR)/ground/openpilotgcs" ] || $(RM) -r "$(BUILD_DIR)/ground/openpilotgcs"
|
|
|
|
|
2012-10-20 19:25:24 +02:00
|
|
|
ifeq ($(V), 1)
|
|
|
|
UAVOGEN_SILENT :=
|
|
|
|
else
|
|
|
|
UAVOGEN_SILENT := silent
|
|
|
|
endif
|
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
.PHONY: uavobjgenerator
|
|
|
|
uavobjgenerator:
|
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/ground/$@
|
2011-05-12 22:21:56 +02:00
|
|
|
$(V1) ( cd $(BUILD_DIR)/ground/$@ && \
|
2012-10-20 19:25:24 +02:00
|
|
|
$(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro -spec $(QT_SPEC) -r CONFIG+="debug $(UAVOGEN_SILENT)" && \
|
2011-02-23 05:18:56 +01:00
|
|
|
$(MAKE) --no-print-directory -w ; \
|
|
|
|
)
|
|
|
|
|
2012-06-19 04:23:38 +02:00
|
|
|
UAVOBJ_TARGETS := gcs flight python matlab java wireshark
|
2011-02-23 05:18:56 +01:00
|
|
|
.PHONY:uavobjects
|
2011-05-08 18:37:56 +02:00
|
|
|
uavobjects: $(addprefix uavobjects_, $(UAVOBJ_TARGETS))
|
2011-02-23 05:18:56 +01:00
|
|
|
|
|
|
|
UAVOBJ_XML_DIR := $(ROOT_DIR)/shared/uavobjectdefinition
|
|
|
|
UAVOBJ_OUT_DIR := $(BUILD_DIR)/uavobject-synthetics
|
|
|
|
|
|
|
|
$(UAVOBJ_OUT_DIR):
|
|
|
|
$(V1) mkdir -p $@
|
|
|
|
|
|
|
|
uavobjects_%: $(UAVOBJ_OUT_DIR) uavobjgenerator
|
2011-05-12 22:21:56 +02:00
|
|
|
$(V1) ( cd $(UAVOBJ_OUT_DIR) && \
|
2011-02-23 05:18:56 +01:00
|
|
|
$(UAVOBJGENERATOR) -$* $(UAVOBJ_XML_DIR) $(ROOT_DIR) ; \
|
|
|
|
)
|
|
|
|
|
|
|
|
uavobjects_test: $(UAVOBJ_OUT_DIR) uavobjgenerator
|
|
|
|
$(V1) $(UAVOBJGENERATOR) -v -none $(UAVOBJ_XML_DIR) $(ROOT_DIR)
|
|
|
|
|
|
|
|
uavobjects_clean:
|
2011-06-08 04:42:59 +02:00
|
|
|
$(V0) @echo " CLEAN $@"
|
2011-02-23 05:18:56 +01:00
|
|
|
$(V1) [ ! -d "$(UAVOBJ_OUT_DIR)" ] || $(RM) -r "$(UAVOBJ_OUT_DIR)"
|
|
|
|
|
2012-10-06 00:47:10 +02:00
|
|
|
################################
|
|
|
|
#
|
|
|
|
# Android GCS related components
|
|
|
|
#
|
|
|
|
################################
|
|
|
|
|
2012-10-10 06:34:22 +02:00
|
|
|
|
|
|
|
# Build the output directory for the Android GCS build
|
2012-10-06 00:47:10 +02:00
|
|
|
ANDROIDGCS_OUT_DIR := $(BUILD_DIR)/androidgcs
|
2012-10-10 06:34:22 +02:00
|
|
|
$(ANDROIDGCS_OUT_DIR):
|
|
|
|
$(V1) mkdir -p $@
|
|
|
|
|
|
|
|
# Build the asset directory for the android assets
|
|
|
|
ANDROIDGCS_ASSETS_DIR := $(ANDROIDGCS_OUT_DIR)/assets
|
|
|
|
$(ANDROIDGCS_ASSETS_DIR)/uavos:
|
|
|
|
$(V1) mkdir -p $@
|
|
|
|
|
2012-10-06 00:47:10 +02:00
|
|
|
ifeq ($(V), 1)
|
2012-10-10 06:46:20 +02:00
|
|
|
ANT_QUIET :=
|
|
|
|
ANDROID_SILENT :=
|
2012-10-06 00:47:10 +02:00
|
|
|
else
|
2012-10-10 06:46:20 +02:00
|
|
|
ANT_QUIET := -q
|
|
|
|
ANDROID_SILENT := -s
|
2012-10-06 00:47:10 +02:00
|
|
|
endif
|
|
|
|
.PHONY: androidgcs
|
2012-10-10 06:34:22 +02:00
|
|
|
androidgcs: uavo-collections_java
|
2012-10-10 06:46:20 +02:00
|
|
|
$(V0) @echo " ANDROID $(call toprel, $(ANDROIDGCS_OUT_DIR))"
|
2012-10-06 00:47:10 +02:00
|
|
|
$(V1) mkdir -p $(ANDROIDGCS_OUT_DIR)
|
2012-10-10 06:46:20 +02:00
|
|
|
$(V1) $(ANDROID) $(ANDROID_SILENT) update project --target 'Google Inc.:Google APIs:16' --name androidgcs --path ./androidgcs
|
2012-10-06 00:47:10 +02:00
|
|
|
$(V1) ant -f ./androidgcs/build.xml \
|
2012-10-10 06:46:20 +02:00
|
|
|
$(ANT_QUIET) \
|
2012-10-06 00:47:10 +02:00
|
|
|
-Dout.dir="../$(call toprel, $(ANDROIDGCS_OUT_DIR)/bin)" \
|
|
|
|
-Dgen.absolute.dir="$(ANDROIDGCS_OUT_DIR)/gen" \
|
|
|
|
debug
|
|
|
|
|
|
|
|
.PHONY: androidgcs_clean
|
|
|
|
androidgcs_clean:
|
|
|
|
$(V0) @echo " CLEAN $@"
|
|
|
|
$(V1) [ ! -d "$(ANDROIDGCS_OUT_DIR)" ] || $(RM) -r "$(ANDROIDGCS_OUT_DIR)"
|
|
|
|
|
2012-10-10 06:34:22 +02:00
|
|
|
# We want to take snapshots of the UAVOs at each point that they change
|
|
|
|
# to allow the GCS to be compatible with as many versions as possible.
|
|
|
|
#
|
|
|
|
# Find the git hashes of each commit that changes uavobjects with:
|
|
|
|
# git log --format=%h -- shared/uavobjectdefinition/ | head -n 2
|
|
|
|
UAVO_GIT_VERSIONS := 684620d 43f85d9
|
|
|
|
|
|
|
|
# All versions includes a pseudo collection called "working" which represents
|
|
|
|
# the UAVOs in the source tree
|
|
|
|
UAVO_ALL_VERSIONS := $(UAVO_GIT_VERSIONS) srctree
|
|
|
|
|
|
|
|
# This is where the UAVO collections are stored
|
|
|
|
UAVO_COLLECTION_DIR := $(BUILD_DIR)/uavo-collections
|
|
|
|
|
|
|
|
# $(1) git hash of a UAVO snapshot
|
|
|
|
define UAVO_COLLECTION_GIT_TEMPLATE
|
|
|
|
|
|
|
|
# Make the output directory that will contain all of the synthetics for the
|
|
|
|
# uavo collection referenced by the git hash $(1)
|
|
|
|
$$(UAVO_COLLECTION_DIR)/$(1):
|
|
|
|
$$(V1) mkdir -p $$(UAVO_COLLECTION_DIR)/$(1)
|
|
|
|
|
|
|
|
# Extract the snapshot of shared/uavobjectdefinition from git hash $(1)
|
|
|
|
$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar: | $$(UAVO_COLLECTION_DIR)/$(1)
|
|
|
|
$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar:
|
|
|
|
$$(V0) @echo " UAVOTAR $(1)"
|
|
|
|
$$(V1) git archive $(1) -o $$@ -- shared/uavobjectdefinition/
|
|
|
|
|
|
|
|
# Extract the uavo xml files from our snapshot
|
|
|
|
$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml: $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml.tar
|
|
|
|
$$(V0) @echo " UAVOUNTAR $(1)"
|
|
|
|
$$(V1) rm -rf $$@
|
|
|
|
$$(V1) mkdir -p $$@
|
2012-10-13 04:49:16 +02:00
|
|
|
$$(V1) tar -C $$(call toprel, $$@) -xf $$(call toprel, $$<) || rm -rf $$@
|
2012-10-10 06:34:22 +02:00
|
|
|
endef
|
|
|
|
|
|
|
|
# Map the current working directory into the set of UAVO collections
|
|
|
|
$(UAVO_COLLECTION_DIR)/srctree:
|
|
|
|
$(V1) mkdir -p $@
|
|
|
|
|
|
|
|
$(UAVO_COLLECTION_DIR)/srctree/uavo-xml: | $(UAVO_COLLECTION_DIR)/srctree
|
|
|
|
$(UAVO_COLLECTION_DIR)/srctree/uavo-xml: $(UAVOBJ_XML_DIR)
|
|
|
|
$(V1) ln -sf $(ROOT_DIR) $(UAVO_COLLECTION_DIR)/srctree/uavo-xml
|
|
|
|
|
|
|
|
# $(1) git hash (or symbolic name) of a UAVO snapshot
|
|
|
|
define UAVO_COLLECTION_BUILD_TEMPLATE
|
|
|
|
|
|
|
|
# This leaves us with a (broken) symlink that points to the full sha1sum of the collection
|
|
|
|
$$(UAVO_COLLECTION_DIR)/$(1)/uavohash: $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml
|
|
|
|
# Compute the sha1 hash for this UAVO collection
|
2012-10-13 05:57:02 +02:00
|
|
|
# The sed bit truncates the UAVO hash to 16 hex digits
|
2012-10-10 06:34:22 +02:00
|
|
|
$$(V1) python $$(ROOT_DIR)/make/scripts/version-info.py \
|
2012-10-13 05:57:02 +02:00
|
|
|
--path=$$(ROOT_DIR) \
|
|
|
|
--uavodir=$$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition \
|
|
|
|
--format='$$$${UAVOSHA1TXT}' | \
|
2012-10-14 00:59:15 +02:00
|
|
|
sed -e 's|\(................\).*|\1|' > $$@
|
2012-10-10 06:34:22 +02:00
|
|
|
|
2012-10-14 00:59:15 +02:00
|
|
|
$$(V0) @echo " UAVOHASH $(1) ->" $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
|
2012-10-10 06:34:22 +02:00
|
|
|
|
|
|
|
# Generate the java uavobjects for this UAVO collection
|
2012-10-14 00:59:15 +02:00
|
|
|
$$(UAVO_COLLECTION_DIR)/$(1)/java-build/java: $$(UAVO_COLLECTION_DIR)/$(1)/uavohash
|
|
|
|
$$(V0) @echo " UAVOJAVA $(1) " $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
|
2012-10-10 06:34:22 +02:00
|
|
|
$$(V1) mkdir -p $$@
|
|
|
|
$$(V1) ( \
|
2012-10-14 00:59:15 +02:00
|
|
|
cd $$(UAVO_COLLECTION_DIR)/$(1)/java-build && \
|
2012-10-10 06:34:22 +02:00
|
|
|
$$(UAVOBJGENERATOR) -java $$(UAVO_COLLECTION_DIR)/$(1)/uavo-xml/shared/uavobjectdefinition $$(ROOT_DIR) ; \
|
|
|
|
)
|
|
|
|
|
|
|
|
# Build a jar file for this UAVO collection
|
2012-10-14 00:59:15 +02:00
|
|
|
$$(UAVO_COLLECTION_DIR)/$(1)/java-build/uavobjects.jar: | $$(ANDROIDGCS_ASSETS_DIR)/uavos
|
|
|
|
$$(UAVO_COLLECTION_DIR)/$(1)/java-build/uavobjects.jar: $$(UAVO_COLLECTION_DIR)/$(1)/java-build/java
|
|
|
|
$$(V0) @echo " UAVOJAR $(1) " $$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash)
|
2012-10-10 06:34:22 +02:00
|
|
|
$$(V1) ( \
|
2012-10-14 00:59:15 +02:00
|
|
|
HASH=$$$$(cat $$(UAVO_COLLECTION_DIR)/$(1)/uavohash) && \
|
|
|
|
cd $$(UAVO_COLLECTION_DIR)/$(1)/java-build && \
|
2012-10-10 06:34:22 +02:00
|
|
|
javac java/*.java \
|
|
|
|
$$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVDataObject.java \
|
|
|
|
$$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVObject*.java \
|
|
|
|
$$(ROOT_DIR)/androidgcs/src/org/openpilot/uavtalk/UAVMetaObject.java \
|
|
|
|
-d . && \
|
|
|
|
find ./org/openpilot/uavtalk/uavobjects -type f -name '*.class' > classlist.txt && \
|
|
|
|
jar cf tmp_uavobjects.jar @classlist.txt && \
|
2012-10-10 07:10:53 +02:00
|
|
|
$$(ANDROID_DX) \
|
2012-10-10 06:34:22 +02:00
|
|
|
--dex \
|
|
|
|
--output $$(ANDROIDGCS_ASSETS_DIR)/uavos/$$$${HASH}.jar \
|
|
|
|
tmp_uavobjects.jar && \
|
|
|
|
ln -sf $$(ANDROIDGCS_ASSETS_DIR)/uavos/$$$${HASH}.jar uavobjects.jar \
|
|
|
|
)
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
# One of these for each element of UAVO_GIT_VERSIONS so we can extract the UAVOs from git
|
|
|
|
$(foreach githash, $(UAVO_GIT_VERSIONS), $(eval $(call UAVO_COLLECTION_GIT_TEMPLATE,$(githash))))
|
|
|
|
|
|
|
|
# One of these for each UAVO_ALL_VERSIONS which includes the ones in the srctree
|
|
|
|
$(foreach githash, $(UAVO_ALL_VERSIONS), $(eval $(call UAVO_COLLECTION_BUILD_TEMPLATE,$(githash))))
|
|
|
|
|
|
|
|
.PHONY: uavo-collections_java
|
2012-10-14 00:59:15 +02:00
|
|
|
uavo-collections_java: $(foreach githash, $(UAVO_ALL_VERSIONS), $(UAVO_COLLECTION_DIR)/$(githash)/java-build/uavobjects.jar)
|
2012-10-10 06:34:22 +02:00
|
|
|
|
|
|
|
.PHONY: uavo-collections
|
|
|
|
uavo-collections: uavo-collections_java
|
|
|
|
|
|
|
|
.PHONY: uavo-collections_clean
|
|
|
|
uavo-collections_clean:
|
|
|
|
$(V0) @echo " CLEAN $(UAVO_COLLECTION_DIR)"
|
|
|
|
$(V1) [ ! -d "$(UAVO_COLLECTION_DIR)" ] || $(RM) -r $(UAVO_COLLECTION_DIR)
|
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Flight related components
|
|
|
|
#
|
|
|
|
##############################
|
|
|
|
|
2012-11-28 04:32:51 +01:00
|
|
|
# Define some pointers to the various important pieces of the flight code
|
|
|
|
# to prevent these being repeated in every sub makefile
|
|
|
|
PIOS := $(ROOT_DIR)/flight/PiOS
|
|
|
|
FLIGHTLIB := $(ROOT_DIR)/flight/Libraries
|
|
|
|
OPMODULEDIR := $(ROOT_DIR)/flight/Modules
|
2012-11-28 04:59:25 +01:00
|
|
|
OPUAVOBJ := $(ROOT_DIR)/flight/targets/UAVObjects
|
|
|
|
OPUAVTALK := $(ROOT_DIR)/flight/targets/UAVTalk
|
2012-11-28 04:32:51 +01:00
|
|
|
HWDEFS := $(ROOT_DIR)/flight/targets/board_hw_defs
|
|
|
|
DOXYGENDIR := $(ROOT_DIR)/flight/Doc/Doxygen
|
|
|
|
OPUAVSYNTHDIR := $(BUILD_DIR)/uavobject-synthetics/flight
|
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
|
|
|
# $(2) = Name of board used in source tree (e.g. CopterControl)
|
2012-06-03 02:27:58 +02:00
|
|
|
# $(3) = Short name for board (e.g CC)
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
define FW_TEMPLATE
|
|
|
|
.PHONY: $(1) fw_$(1)
|
2011-05-25 06:20:02 +02:00
|
|
|
$(1): fw_$(1)_opfw
|
|
|
|
fw_$(1): fw_$(1)_opfw
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
|
|
|
|
fw_$(1)_%: uavobjects_flight
|
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/fw_$(1)/dep
|
2012-11-27 07:23:44 +01:00
|
|
|
$(V1) cd $(ROOT_DIR)/flight/targets/$(2) && \
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$$(MAKE) -r --no-print-directory \
|
|
|
|
BOARD_NAME=$(1) \
|
2012-06-03 02:27:58 +02:00
|
|
|
BOARD_SHORT_NAME=$(3) \
|
2012-06-03 02:26:41 +02:00
|
|
|
BUILD_TYPE=fw \
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
2011-03-26 14:09:11 +01:00
|
|
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
2012-11-28 04:32:51 +01:00
|
|
|
\
|
|
|
|
TARGET=fw_$(1) \
|
|
|
|
OUTDIR=$(BUILD_DIR)/fw_$(1) \
|
|
|
|
\
|
|
|
|
PIOS=$(PIOS) \
|
|
|
|
FLIGHTLIB=$(FLIGHTLIB) \
|
|
|
|
OPMODULEDIR=$(OPMODULEDIR) \
|
|
|
|
OPUAVOBJ=$(OPUAVOBJ) \
|
|
|
|
OPUAVTALK=$(OPUAVTALK) \
|
|
|
|
HWDEFSINC=$(HWDEFS)/$(1) \
|
|
|
|
DOXYGENDIR=$(DOXYGENDIR) \
|
|
|
|
OPUAVSYNTHDIR=$(OPUAVSYNTHDIR) \
|
|
|
|
\
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$$*
|
2011-02-23 05:18:56 +01:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
.PHONY: $(1)_clean
|
|
|
|
$(1)_clean: fw_$(1)_clean
|
|
|
|
fw_$(1)_clean:
|
2011-06-08 04:42:59 +02:00
|
|
|
$(V0) @echo " CLEAN $$@"
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$(V1) $(RM) -fr $(BUILD_DIR)/fw_$(1)
|
|
|
|
endef
|
2011-04-25 00:37:45 +02:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
|
|
|
# $(2) = Name of board used in source tree (e.g. CopterControl)
|
|
|
|
define BL_TEMPLATE
|
|
|
|
.PHONY: bl_$(1)
|
|
|
|
bl_$(1): bl_$(1)_bin
|
|
|
|
bl_$(1)_bino: bl_$(1)_bin
|
|
|
|
|
|
|
|
bl_$(1)_%:
|
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/bl_$(1)/dep
|
2012-11-27 07:23:44 +01:00
|
|
|
$(V1) cd $(ROOT_DIR)/flight/targets/Bootloaders/$(2) && \
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$$(MAKE) -r --no-print-directory \
|
|
|
|
BOARD_NAME=$(1) \
|
2012-06-03 02:27:58 +02:00
|
|
|
BOARD_SHORT_NAME=$(3) \
|
2012-06-03 02:26:41 +02:00
|
|
|
BUILD_TYPE=bl \
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
2011-03-26 14:09:11 +01:00
|
|
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
2012-11-28 04:32:51 +01:00
|
|
|
\
|
|
|
|
TARGET=bl_$(1) \
|
|
|
|
OUTDIR=$(BUILD_DIR)/bl_$(1) \
|
|
|
|
\
|
|
|
|
PIOS=$(PIOS) \
|
|
|
|
FLIGHTLIB=$(FLIGHTLIB) \
|
|
|
|
OPMODULEDIR=$(OPMODULEDIR) \
|
|
|
|
OPUAVOBJ=$(OPUAVOBJ) \
|
|
|
|
OPUAVTALK=$(OPUAVTALK) \
|
|
|
|
HWDEFSINC=$(HWDEFS)/$(1) \
|
|
|
|
OPUAVSYNTHDIR=$(OPUAVSYNTHDIR) \
|
|
|
|
DOXYGENDIR=$(DOXYGENDIR) \
|
|
|
|
\
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$$*
|
2011-02-23 05:18:56 +01:00
|
|
|
|
2011-06-08 04:53:08 +02:00
|
|
|
.PHONY: unbrick_$(1)
|
|
|
|
unbrick_$(1): bl_$(1)_hex
|
|
|
|
$(if $(filter-out undefined,$(origin UNBRICK_TTY)),
|
|
|
|
$(V0) @echo " UNBRICK $(1) via $$(UNBRICK_TTY)"
|
|
|
|
$(V1) $(STM32FLASH_DIR)/stm32flash \
|
|
|
|
-w $(BUILD_DIR)/bl_$(1)/bl_$(1).hex \
|
|
|
|
-g 0x0 \
|
|
|
|
$$(UNBRICK_TTY)
|
|
|
|
,
|
|
|
|
$(V0) @echo
|
|
|
|
$(V0) @echo "ERROR: You must specify UNBRICK_TTY=<serial-device> to use for unbricking."
|
|
|
|
$(V0) @echo " eg. $$(MAKE) $$@ UNBRICK_TTY=/dev/ttyUSB0"
|
|
|
|
)
|
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
.PHONY: bl_$(1)_clean
|
|
|
|
bl_$(1)_clean:
|
2011-06-08 04:42:59 +02:00
|
|
|
$(V0) @echo " CLEAN $$@"
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$(V1) $(RM) -fr $(BUILD_DIR)/bl_$(1)
|
|
|
|
endef
|
2011-02-23 05:19:02 +01:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
|
|
|
define BU_TEMPLATE
|
|
|
|
.PHONY: bu_$(1)
|
2011-05-25 06:20:02 +02:00
|
|
|
bu_$(1): bu_$(1)_opfw
|
2011-04-25 00:37:45 +02:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
bu_$(1)_%: bl_$(1)_bino
|
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/bu_$(1)/dep
|
2012-11-27 07:23:44 +01:00
|
|
|
$(V1) cd $(ROOT_DIR)/flight/targets/Bootloaders/BootloaderUpdater && \
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$$(MAKE) -r --no-print-directory \
|
|
|
|
BOARD_NAME=$(1) \
|
2012-06-03 02:27:58 +02:00
|
|
|
BOARD_SHORT_NAME=$(3) \
|
2012-06-03 02:26:41 +02:00
|
|
|
BUILD_TYPE=bu \
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
2011-03-26 14:09:11 +01:00
|
|
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
2012-11-28 04:32:51 +01:00
|
|
|
\
|
|
|
|
TARGET=bu_$(1) \
|
|
|
|
OUTDIR=$(BUILD_DIR)/bu_$(1) \
|
|
|
|
\
|
|
|
|
PIOS=$(PIOS) \
|
|
|
|
FLIGHTLIB=$(FLIGHTLIB) \
|
|
|
|
OPMODULEDIR=$(OPMODULEDIR) \
|
|
|
|
OPUAVOBJ=$(OPUAVOBJ) \
|
|
|
|
OPUAVTALK=$(OPUAVTALK) \
|
|
|
|
HWDEFSINC=$(HWDEFS)/$(1) \
|
|
|
|
OPUAVSYNTHDIR=$(OPUAVSYNTHDIR) \
|
|
|
|
DOXYGENDIR=$(DOXYGENDIR) \
|
|
|
|
\
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$$*
|
2011-02-23 05:18:56 +01:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
.PHONY: bu_$(1)_clean
|
|
|
|
bu_$(1)_clean:
|
2011-06-08 04:42:59 +02:00
|
|
|
$(V0) @echo " CLEAN $$@"
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
$(V1) $(RM) -fr $(BUILD_DIR)/bu_$(1)
|
|
|
|
endef
|
2011-02-23 05:19:02 +01:00
|
|
|
|
2012-02-03 06:18:06 +01:00
|
|
|
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
|
|
|
define EF_TEMPLATE
|
|
|
|
.PHONY: ef_$(1)
|
2012-02-04 18:03:42 +01:00
|
|
|
ef_$(1): ef_$(1)_bin
|
2012-02-03 06:18:06 +01:00
|
|
|
|
2012-05-28 03:39:15 +02:00
|
|
|
ef_$(1)_%: bl_$(1)_bin fw_$(1)_opfw
|
2012-02-04 18:03:42 +01:00
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/ef_$(1)/dep
|
2012-11-27 07:23:44 +01:00
|
|
|
$(V1) cd $(ROOT_DIR)/flight/targets/EntireFlash && \
|
2012-02-04 18:03:42 +01:00
|
|
|
$$(MAKE) -r --no-print-directory \
|
|
|
|
BOARD_NAME=$(1) \
|
2012-06-03 02:27:58 +02:00
|
|
|
BOARD_SHORT_NAME=$(3) \
|
2012-06-03 02:26:41 +02:00
|
|
|
BUILD_TYPE=ef \
|
2012-02-04 18:03:42 +01:00
|
|
|
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
|
|
|
DFU_CMD="$(DFUUTIL_DIR)/bin/dfu-util" \
|
2012-11-28 04:32:51 +01:00
|
|
|
\
|
|
|
|
TARGET=ef_$(1) \
|
|
|
|
OUTDIR=$(BUILD_DIR)/ef_$(1) \
|
|
|
|
\
|
2012-02-04 18:03:42 +01:00
|
|
|
$$*
|
2012-02-03 06:18:06 +01:00
|
|
|
|
|
|
|
.PHONY: ef_$(1)_clean
|
|
|
|
ef_$(1)_clean:
|
|
|
|
$(V0) @echo " CLEAN $$@"
|
|
|
|
$(V1) $(RM) -fr $(BUILD_DIR)/ef_$(1)
|
|
|
|
endef
|
|
|
|
|
2012-06-03 02:31:57 +02:00
|
|
|
# When building any of the "all_*" targets, tell all sub makefiles to display
|
|
|
|
# additional details on each line of output to describe which build and target
|
|
|
|
# that each line applies to.
|
|
|
|
ifneq ($(strip $(filter all_%,$(MAKECMDGOALS))),)
|
|
|
|
export ENABLE_MSG_EXTRA := yes
|
|
|
|
endif
|
|
|
|
|
2012-06-03 02:37:28 +02:00
|
|
|
# When building more than one goal in a single make invocation, also
|
|
|
|
# enable the extra context for each output line
|
|
|
|
ifneq ($(word 2,$(MAKECMDGOALS)),)
|
|
|
|
export ENABLE_MSG_EXTRA := yes
|
|
|
|
endif
|
|
|
|
|
2011-05-24 04:04:54 +02:00
|
|
|
# $(1) = Canonical board name all in lower case (e.g. coptercontrol)
|
|
|
|
define BOARD_PHONY_TEMPLATE
|
|
|
|
.PHONY: all_$(1)
|
|
|
|
all_$(1): $$(filter fw_$(1), $$(FW_TARGETS))
|
|
|
|
all_$(1): $$(filter bl_$(1), $$(BL_TARGETS))
|
|
|
|
all_$(1): $$(filter bu_$(1), $$(BU_TARGETS))
|
2012-02-03 06:18:06 +01:00
|
|
|
all_$(1): $$(filter ef_$(1), $$(EF_TARGETS))
|
2011-05-24 04:04:54 +02:00
|
|
|
|
|
|
|
.PHONY: all_$(1)_clean
|
|
|
|
all_$(1)_clean: $$(addsuffix _clean, $$(filter fw_$(1), $$(FW_TARGETS)))
|
|
|
|
all_$(1)_clean: $$(addsuffix _clean, $$(filter bl_$(1), $$(BL_TARGETS)))
|
|
|
|
all_$(1)_clean: $$(addsuffix _clean, $$(filter bu_$(1), $$(BU_TARGETS)))
|
2012-02-03 06:18:06 +01:00
|
|
|
all_$(1)_clean: $$(addsuffix _clean, $$(filter ef_$(1), $$(EF_TARGETS)))
|
2011-05-24 04:04:54 +02:00
|
|
|
endef
|
|
|
|
|
2012-08-25 19:24:13 +02:00
|
|
|
ALL_BOARDS := coptercontrol pipxtreme revolution revomini simposix osd
|
2012-07-08 14:07:32 +02:00
|
|
|
ALL_BOARDS_BU := coptercontrol pipxtreme simposix
|
2011-04-25 00:37:45 +02:00
|
|
|
|
2012-05-29 04:21:46 +02:00
|
|
|
# SimPosix only builds on Linux so drop it from the list for
|
|
|
|
# all other platforms.
|
|
|
|
ifneq ($(UNAME), Linux)
|
|
|
|
ALL_BOARDS := $(filter-out simposix, $(ALL_BOARDS))
|
2012-07-08 14:07:32 +02:00
|
|
|
ALL_BOARDS_BU := $(filter-out simposix, $(ALL_BOARDS_BU))
|
2012-05-29 04:21:46 +02:00
|
|
|
endif
|
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
# Friendly names of each board (used to find source tree)
|
|
|
|
coptercontrol_friendly := CopterControl
|
|
|
|
pipxtreme_friendly := PipXtreme
|
2011-11-14 00:25:38 +01:00
|
|
|
revolution_friendly := Revolution
|
2012-08-25 19:24:13 +02:00
|
|
|
revomini_friendly := RevoMini
|
2012-03-20 18:08:39 +01:00
|
|
|
simposix_friendly := SimPosix
|
2012-05-30 15:30:09 +02:00
|
|
|
osd_friendly := OSD
|
2011-03-26 14:09:11 +01:00
|
|
|
|
2012-10-30 05:08:43 +01:00
|
|
|
# Short names of each board (used to display board name in parallel builds)
|
2012-06-03 02:27:58 +02:00
|
|
|
coptercontrol_short := 'cc '
|
|
|
|
pipxtreme_short := 'pipx'
|
|
|
|
revolution_short := 'revo'
|
2012-10-30 05:08:43 +01:00
|
|
|
revomini_short := 'rm '
|
2012-06-03 02:27:58 +02:00
|
|
|
simposix_short := 'posx'
|
|
|
|
osd_short := 'osd '
|
|
|
|
|
2011-06-08 04:47:07 +02:00
|
|
|
# Start out assuming that we'll build fw, bl and bu for all boards
|
|
|
|
FW_BOARDS := $(ALL_BOARDS)
|
|
|
|
BL_BOARDS := $(ALL_BOARDS)
|
2012-07-08 14:07:32 +02:00
|
|
|
BU_BOARDS := $(ALL_BOARDS_BU)
|
2012-02-03 06:18:06 +01:00
|
|
|
EF_BOARDS := $(ALL_BOARDS)
|
2011-03-26 14:09:11 +01:00
|
|
|
|
2012-05-28 03:39:55 +02:00
|
|
|
# FIXME: The BU image doesn't work for F4 boards so we need to
|
|
|
|
# filter them out to prevent errors.
|
2012-05-30 15:41:12 +02:00
|
|
|
BU_BOARDS := $(filter-out revolution osd, $(BU_BOARDS))
|
2012-03-11 02:41:15 +01:00
|
|
|
|
2012-05-28 03:51:29 +02:00
|
|
|
# SimPosix doesn't have a BL, BU or EF target so we need to
|
|
|
|
# filter them out to prevent errors on the all_flight target.
|
|
|
|
BL_BOARDS := $(filter-out simposix, $(BL_BOARDS))
|
|
|
|
BU_BOARDS := $(filter-out simposix, $(BU_BOARDS))
|
|
|
|
EF_BOARDS := $(filter-out simposix, $(EF_BOARDS))
|
2012-03-11 02:41:15 +01:00
|
|
|
|
2011-06-08 04:47:07 +02:00
|
|
|
# Generate the targets for whatever boards are left in each list
|
|
|
|
FW_TARGETS := $(addprefix fw_, $(FW_BOARDS))
|
|
|
|
BL_TARGETS := $(addprefix bl_, $(BL_BOARDS))
|
|
|
|
BU_TARGETS := $(addprefix bu_, $(BU_BOARDS))
|
2012-02-03 06:18:06 +01:00
|
|
|
EF_TARGETS := $(addprefix ef_, $(EF_BOARDS))
|
2011-03-26 14:09:11 +01:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
.PHONY: all_fw all_fw_clean
|
2011-05-25 06:20:02 +02:00
|
|
|
all_fw: $(addsuffix _opfw, $(FW_TARGETS))
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
all_fw_clean: $(addsuffix _clean, $(FW_TARGETS))
|
2011-04-14 14:46:39 +02:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
.PHONY: all_bl all_bl_clean
|
|
|
|
all_bl: $(addsuffix _bin, $(BL_TARGETS))
|
|
|
|
all_bl_clean: $(addsuffix _clean, $(BL_TARGETS))
|
2011-04-14 14:46:39 +02:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
.PHONY: all_bu all_bu_clean
|
2011-05-25 06:20:02 +02:00
|
|
|
all_bu: $(addsuffix _opfw, $(BU_TARGETS))
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
all_bu_clean: $(addsuffix _clean, $(BU_TARGETS))
|
2011-04-14 14:46:39 +02:00
|
|
|
|
2012-02-03 06:18:06 +01:00
|
|
|
.PHONY: all_ef all_ef_clean
|
2012-05-28 03:51:55 +02:00
|
|
|
all_ef: $(EF_TARGETS)
|
2012-02-03 06:18:06 +01:00
|
|
|
all_ef_clean: $(addsuffix _clean, $(EF_TARGETS))
|
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
.PHONY: all_flight all_flight_clean
|
2012-02-03 06:18:06 +01:00
|
|
|
all_flight: all_fw all_bl all_bu all_ef
|
|
|
|
all_flight_clean: all_fw_clean all_bl_clean all_bu_clean all_ef_clean
|
2011-04-14 14:46:39 +02:00
|
|
|
|
2011-06-08 04:47:07 +02:00
|
|
|
# Expand the groups of targets for each board
|
2011-05-24 04:04:54 +02:00
|
|
|
$(foreach board, $(ALL_BOARDS), $(eval $(call BOARD_PHONY_TEMPLATE,$(board))))
|
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
# Expand the bootloader updater rules
|
2012-06-03 02:27:58 +02:00
|
|
|
$(foreach board, $(ALL_BOARDS), $(eval $(call BU_TEMPLATE,$(board),$($(board)_friendly),$($(board)_short))))
|
2011-04-14 14:46:39 +02:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
# Expand the firmware rules
|
2012-06-03 02:27:58 +02:00
|
|
|
$(foreach board, $(ALL_BOARDS), $(eval $(call FW_TEMPLATE,$(board),$($(board)_friendly),$($(board)_short))))
|
2011-04-14 14:46:39 +02:00
|
|
|
|
build: refactor fw, bl and bu rules
- New macros for fw, bl and bu rules in top-level make
- Per-board info factored into make/board/*/board-info.mk
- Per-board info now shared btw. fw, bl and blupd for each board
- BOARD_TYPE, BOARD_REVISION, BOOTLOADER_VERSION, HW_TYPE
- MCU, CHIP, BOARD, MODEL, MODEL_SUFFIX
- START_OF_BL_CODE, START_OF_FW_CODE
- blupd_* goals renamed to bu_*
- all_blupd goal renamed to all_bu
- firmware goals renamed to fw_*, board name goals are preserved
- bu_*_program now writes updater to correct address for all boards
- BL updater firmware builds now produce .opf format including
version info blob.
- BL updater firmware name now includes board name.
- INS makefile brought up to date w.r.t. linker scripts
2011-05-23 21:11:53 +02:00
|
|
|
# Expand the bootloader rules
|
2012-06-03 02:27:58 +02:00
|
|
|
$(foreach board, $(ALL_BOARDS), $(eval $(call BL_TEMPLATE,$(board),$($(board)_friendly),$($(board)_short))))
|
2011-04-14 14:46:39 +02:00
|
|
|
|
2012-02-03 06:18:06 +01:00
|
|
|
# Expand the entire-flash rules
|
2012-06-03 02:27:58 +02:00
|
|
|
$(foreach board, $(ALL_BOARDS), $(eval $(call EF_TEMPLATE,$(board),$($(board)_friendly),$($(board)_short))))
|
2012-02-03 06:18:06 +01:00
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
.PHONY: sim_win32
|
|
|
|
sim_win32: sim_win32_exe
|
|
|
|
|
|
|
|
sim_win32_%: uavobjects_flight
|
2011-03-08 03:36:33 +01:00
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/sitl_win32
|
2011-04-02 17:06:01 +02:00
|
|
|
$(V1) $(MAKE) --no-print-directory \
|
2012-11-27 07:23:44 +01:00
|
|
|
-C $(ROOT_DIR)/flight/targets/OpenPilot --file=$(ROOT_DIR)/flight/targets/OpenPilot/Makefile.win32 $*
|
2011-05-19 00:57:35 +02:00
|
|
|
|
2012-03-11 13:40:58 +01:00
|
|
|
.PHONY: sim_osx
|
|
|
|
sim_osx: sim_osx_elf
|
2012-06-03 02:31:57 +02:00
|
|
|
|
2012-03-11 13:40:58 +01:00
|
|
|
sim_osx_%: uavobjects_flight
|
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/sim_osx
|
|
|
|
$(V1) $(MAKE) --no-print-directory \
|
2012-11-27 07:23:44 +01:00
|
|
|
-C $(ROOT_DIR)/flight/targets/Revolution --file=$(ROOT_DIR)/flight/targets/Revolution/Makefile.osx $*
|
2012-12-14 06:25:02 +01:00
|
|
|
|
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Unit Tests
|
|
|
|
#
|
|
|
|
##############################
|
|
|
|
|
2012-12-20 08:02:35 +01:00
|
|
|
ALL_UNITTESTS := logfs
|
2012-12-14 06:25:02 +01:00
|
|
|
|
|
|
|
UT_OUT_DIR := $(BUILD_DIR)/unit_tests
|
|
|
|
|
|
|
|
$(UT_OUT_DIR):
|
|
|
|
$(V1) mkdir -p $@
|
|
|
|
|
2012-12-20 08:02:35 +01:00
|
|
|
.PHONY: all_ut
|
|
|
|
all_ut: $(addsuffix _elf, $(addprefix ut_, $(ALL_UNITTESTS)))
|
|
|
|
|
2013-01-09 07:09:55 +01:00
|
|
|
.PHONY: all_ut_xml
|
|
|
|
all_ut_xml: $(addsuffix _xml, $(addprefix ut_, $(ALL_UNITTESTS)))
|
2012-12-20 08:02:35 +01:00
|
|
|
|
|
|
|
.PHONY: all_ut_run
|
|
|
|
all_ut_run: $(addsuffix _run, $(addprefix ut_, $(ALL_UNITTESTS)))
|
|
|
|
|
|
|
|
.PHONY: ut_all_clean
|
|
|
|
all_ut_clean:
|
|
|
|
$(V0) @echo " CLEAN $@"
|
|
|
|
$(V1) [ ! -d "$(UT_OUT_DIR)" ] || $(RM) -r "$(UT_OUT_DIR)"
|
|
|
|
|
|
|
|
# $(1) = Unit test name
|
|
|
|
define UT_TEMPLATE
|
|
|
|
.PHONY: ut_$(1)
|
|
|
|
ut_$(1): ut_$(1)_run
|
|
|
|
|
|
|
|
ut_$(1)_%: $$(UT_OUT_DIR)
|
|
|
|
$(V1) mkdir -p $(UT_OUT_DIR)/$(1)
|
|
|
|
$(V1) cd $(ROOT_DIR)/flight/tests/$(1) && \
|
|
|
|
$$(MAKE) -r --no-print-directory \
|
2012-12-14 06:25:02 +01:00
|
|
|
BUILD_TYPE=ut \
|
2012-12-20 08:02:35 +01:00
|
|
|
BOARD_SHORT_NAME=$(1) \
|
2012-12-14 06:25:02 +01:00
|
|
|
TCHAIN_PREFIX="" \
|
|
|
|
REMOVE_CMD="$(RM)" \
|
|
|
|
\
|
2012-12-20 08:02:35 +01:00
|
|
|
TARGET=$(1) \
|
|
|
|
OUTDIR="$(UT_OUT_DIR)/$(1)" \
|
2012-12-14 06:25:02 +01:00
|
|
|
\
|
|
|
|
PIOS=$(PIOS) \
|
|
|
|
OPUAVOBJ=$(OPUAVOBJ) \
|
|
|
|
OPUAVTALK=$(OPUAVTALK) \
|
|
|
|
FLIGHTLIB=$(FLIGHTLIB) \
|
|
|
|
\
|
2012-12-20 08:02:35 +01:00
|
|
|
GTEST_DIR=$(GTEST_DIR) \
|
|
|
|
\
|
2013-02-23 17:04:20 +01:00
|
|
|
$$*
|
2012-12-14 06:25:02 +01:00
|
|
|
|
2012-12-20 08:02:35 +01:00
|
|
|
.PHONY: ut_$(1)_clean
|
|
|
|
ut_$(1)_clean:
|
|
|
|
$(V0) @echo " CLEAN $(1)"
|
|
|
|
$(V1) [ ! -d "$(UT_OUT_DIR)/$(1)" ] || $(RM) -r "$(UT_OUT_DIR)/$(1)"
|
|
|
|
|
|
|
|
endef
|
|
|
|
|
|
|
|
# Expand the unittest rules
|
|
|
|
$(foreach ut, $(ALL_UNITTESTS), $(eval $(call UT_TEMPLATE,$(ut))))
|
|
|
|
|
|
|
|
# Disable parallel make when the all_ut_run target is requested otherwise the TAP
|
|
|
|
# output is interleaved with the rest of the make output.
|
|
|
|
ifneq ($(strip $(filter all_ut_run,$(MAKECMDGOALS))),)
|
|
|
|
.NOTPARALLEL:
|
|
|
|
$(info *NOTE* Parallel make disabled by all_ut_run target so we have sane console output)
|
|
|
|
endif
|
2012-12-14 06:25:02 +01:00
|
|
|
|
2011-05-19 00:57:35 +02:00
|
|
|
##############################
|
|
|
|
#
|
2011-05-28 02:14:51 +02:00
|
|
|
# Packaging components
|
2011-05-19 00:57:35 +02:00
|
|
|
#
|
|
|
|
##############################
|
2012-10-05 22:23:42 +02:00
|
|
|
|
2011-05-28 02:14:51 +02:00
|
|
|
.PHONY: package
|
|
|
|
package:
|
2011-05-19 00:57:35 +02:00
|
|
|
$(V1) cd $@ && $(MAKE) --no-print-directory $@
|
2012-10-05 22:23:42 +02:00
|
|
|
|
|
|
|
.PHONY: package_resources
|
|
|
|
package_resources:
|
|
|
|
$(V1) cd package && $(MAKE) --no-print-directory opfw_resource
|