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
|
|
|
|
|
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)))
|
|
|
|
|
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"
|
|
|
|
UNAME := $(shell uname)
|
|
|
|
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
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
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]"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " qt_sdk_install - Install the QT v4.6.2 tools"
|
|
|
|
@echo " arm_sdk_install - Install the Code Sourcery ARM gcc toolchain"
|
|
|
|
@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"
|
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
|
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))"
|
|
|
|
@echo
|
2011-02-23 05:18:56 +01:00
|
|
|
@echo " [Simulation]"
|
2011-05-08 18:37:56 +02:00
|
|
|
@echo " sim_posix - Build OpenPilot simulation firmware for"
|
|
|
|
@echo " a POSIX compatible system (Linux, Mac OS X, ...)"
|
|
|
|
@echo " sim_posix_clean - Delete all build output for the POSIX simulation"
|
|
|
|
@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
|
|
|
|
@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 $@
|
|
|
|
|
|
|
|
###############################################################
|
|
|
|
#
|
|
|
|
# Installers for tools required by the ground and flight builds
|
|
|
|
#
|
|
|
|
# NOTE: These are not tied to the default goals
|
|
|
|
# and must be invoked manually
|
|
|
|
#
|
|
|
|
###############################################################
|
|
|
|
|
|
|
|
# Set up QT toolchain
|
|
|
|
QT_SDK_DIR := $(TOOLS_DIR)/qtsdk-2010.02
|
|
|
|
|
|
|
|
.PHONY: qt_sdk_install
|
|
|
|
qt_sdk_install: QT_SDK_URL := http://get.qt.nokia.com/qtsdk/qt-sdk-linux-x86-opensource-2010.02.bin
|
|
|
|
qt_sdk_install: QT_SDK_FILE := $(notdir $(QT_SDK_URL))
|
2011-04-03 03:40:22 +02:00
|
|
|
# order-only prereq on directory existance:
|
|
|
|
qt_sdk_install : | $(DL_DIR) $(TOOLS_DIR)
|
|
|
|
qt_sdk_install: qt_sdk_clean
|
|
|
|
# download the source only if it's newer than what we already have
|
2011-02-23 05:18:56 +01:00
|
|
|
$(V1) wget -N -P "$(DL_DIR)" "$(QT_SDK_URL)"
|
|
|
|
|
2011-04-03 03:40:22 +02:00
|
|
|
#installer is an executable, make it executable and run it
|
2011-02-23 05:18:56 +01:00
|
|
|
$(V1) chmod u+x "$(DL_DIR)/$(QT_SDK_FILE)"
|
|
|
|
"$(DL_DIR)/$(QT_SDK_FILE)" --installdir "$(QT_SDK_DIR)"
|
|
|
|
|
|
|
|
.PHONY: qt_sdk_clean
|
|
|
|
qt_sdk_clean:
|
|
|
|
$(V1) [ ! -d "$(QT_SDK_DIR)" ] || $(RM) -rf $(QT_SDK_DIR)
|
|
|
|
|
|
|
|
# Set up ARM (STM32) SDK
|
2011-07-20 06:42:51 +02:00
|
|
|
ARM_SDK_DIR := $(TOOLS_DIR)/arm-2011.03
|
2011-02-23 05:18:56 +01:00
|
|
|
|
|
|
|
.PHONY: arm_sdk_install
|
2011-09-12 00:16:26 +02:00
|
|
|
arm_sdk_install: ARM_SDK_URL := https://sourcery.mentor.com/sgpp/lite/arm/portal/package8736/public/arm-none-eabi/arm-2011.03-42-arm-none-eabi-i686-pc-linux-gnu.tar.bz2
|
2011-02-23 05:18:56 +01:00
|
|
|
arm_sdk_install: ARM_SDK_FILE := $(notdir $(ARM_SDK_URL))
|
2011-04-03 03:40:22 +02:00
|
|
|
# order-only prereq on directory existance:
|
|
|
|
arm_sdk_install: | $(DL_DIR) $(TOOLS_DIR)
|
|
|
|
arm_sdk_install: arm_sdk_clean
|
|
|
|
# download the source only if it's newer than what we already have
|
2011-09-12 00:16:26 +02:00
|
|
|
$(V1) wget --no-check-certificate -N -P "$(DL_DIR)" "$(ARM_SDK_URL)"
|
2011-02-23 05:18:56 +01:00
|
|
|
|
2011-04-03 03:40:22 +02:00
|
|
|
# binary only release so just extract it
|
2011-02-23 05:18:56 +01:00
|
|
|
$(V1) tar -C $(TOOLS_DIR) -xjf "$(DL_DIR)/$(ARM_SDK_FILE)"
|
|
|
|
|
|
|
|
.PHONY: arm_sdk_clean
|
|
|
|
arm_sdk_clean:
|
|
|
|
$(V1) [ ! -d "$(ARM_SDK_DIR)" ] || $(RM) -r $(ARM_SDK_DIR)
|
|
|
|
|
|
|
|
# Set up openocd tools
|
|
|
|
OPENOCD_DIR := $(TOOLS_DIR)/openocd
|
|
|
|
|
|
|
|
.PHONY: openocd_install
|
2011-08-27 16:41:53 +02:00
|
|
|
openocd_install: OPENOCD_URL := http://sourceforge.net/projects/openocd/files/openocd/0.5.0/openocd-0.5.0.tar.bz2/download
|
|
|
|
openocd_install: OPENOCD_FILE := openocd-0.5.0.tar.bz2
|
2011-04-03 03:40:22 +02:00
|
|
|
# order-only prereq on directory existance:
|
|
|
|
openocd_install: | $(DL_DIR) $(TOOLS_DIR)
|
|
|
|
openocd_install: openocd_clean
|
|
|
|
# download the source only if it's newer than what we already have
|
2011-02-23 05:18:56 +01:00
|
|
|
$(V1) wget -N -P "$(DL_DIR)" --trust-server-name "$(OPENOCD_URL)"
|
|
|
|
|
2011-04-03 03:40:22 +02:00
|
|
|
# extract the source
|
2011-02-23 05:18:56 +01:00
|
|
|
$(V1) [ ! -d "$(DL_DIR)/openocd-build" ] || $(RM) -r "$(DL_DIR)/openocd-build"
|
|
|
|
$(V1) mkdir -p "$(DL_DIR)/openocd-build"
|
|
|
|
$(V1) tar -C $(DL_DIR)/openocd-build -xjf "$(DL_DIR)/$(OPENOCD_FILE)"
|
|
|
|
|
2011-04-03 03:40:22 +02:00
|
|
|
# build and install
|
2011-02-23 05:18:56 +01:00
|
|
|
$(V1) mkdir -p "$(OPENOCD_DIR)"
|
|
|
|
$(V1) ( \
|
2011-08-27 16:41:53 +02:00
|
|
|
cd $(DL_DIR)/openocd-build/openocd-0.5.0 ; \
|
|
|
|
./configure --prefix="$(OPENOCD_DIR)" --enable-ft2232_libftdi --enable-buspirate; \
|
2011-02-23 05:18:56 +01:00
|
|
|
$(MAKE) ; \
|
|
|
|
$(MAKE) install ; \
|
|
|
|
)
|
|
|
|
|
2011-04-03 03:40:22 +02:00
|
|
|
# delete the extracted source when we're done
|
2011-02-23 05:18:56 +01:00
|
|
|
$(V1) [ ! -d "$(DL_DIR)/openocd-build" ] || $(RM) -r "$(DL_DIR)/openocd-build"
|
|
|
|
|
|
|
|
.PHONY: openocd_clean
|
|
|
|
openocd_clean:
|
|
|
|
$(V1) [ ! -d "$(OPENOCD_DIR)" ] || $(RM) -r "$(OPENOCD_DIR)"
|
|
|
|
|
2011-06-08 04:48:46 +02:00
|
|
|
STM32FLASH_DIR := $(TOOLS_DIR)/stm32flash
|
|
|
|
|
|
|
|
.PHONY: stm32flash_install
|
|
|
|
stm32flash_install: STM32FLASH_URL := http://stm32flash.googlecode.com/svn/trunk
|
|
|
|
stm32flash_install: STM32FLASH_REV := 52
|
|
|
|
stm32flash_install: stm32flash_clean
|
|
|
|
# download the source
|
|
|
|
$(V0) @echo " DOWNLOAD $(STM32FLASH_URL) @ r$(STM32FLASH_REV)"
|
|
|
|
$(V1) svn export -q -r "$(STM32FLASH_REV)" "$(STM32FLASH_URL)" "$(STM32FLASH_DIR)"
|
|
|
|
|
|
|
|
# build
|
|
|
|
$(V0) @echo " BUILD $(STM32FLASH_DIR)"
|
|
|
|
$(V1) $(MAKE) --silent -C $(STM32FLASH_DIR) all
|
|
|
|
|
|
|
|
.PHONY: stm32flash_clean
|
|
|
|
stm32flash_clean:
|
|
|
|
$(V0) @echo " CLEAN $(STM32FLASH_DIR)"
|
|
|
|
$(V1) [ ! -d "$(STM32FLASH_DIR)" ] || $(RM) -r "$(STM32FLASH_DIR)"
|
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Set up paths to tools
|
|
|
|
#
|
|
|
|
##############################
|
|
|
|
|
|
|
|
ifeq ($(shell [ -d "$(QT_SDK_DIR)" ] && echo "exists"), exists)
|
|
|
|
QMAKE=$(QT_SDK_DIR)/qt/bin/qmake
|
|
|
|
else
|
|
|
|
# not installed, hope it's in the path...
|
|
|
|
QMAKE=qmake
|
|
|
|
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
|
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# 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
|
|
|
|
|
|
|
.PHONY: openpilotgcs
|
|
|
|
openpilotgcs: uavobjects_gcs
|
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/ground/$@
|
2011-05-12 22:21:56 +02:00
|
|
|
$(V1) ( cd $(BUILD_DIR)/ground/$@ && \
|
|
|
|
$(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/openpilotgcs.pro -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) && \
|
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"
|
|
|
|
|
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/$@ && \
|
|
|
|
$(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro -spec $(QT_SPEC) -r CONFIG+=debug && \
|
2011-02-23 05:18:56 +01:00
|
|
|
$(MAKE) --no-print-directory -w ; \
|
|
|
|
)
|
|
|
|
|
2011-05-08 18:37:56 +02:00
|
|
|
UAVOBJ_TARGETS := gcs flight python matlab java
|
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)"
|
|
|
|
|
|
|
|
##############################
|
|
|
|
#
|
|
|
|
# Flight related components
|
|
|
|
#
|
|
|
|
##############################
|
|
|
|
|
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 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
|
|
|
|
$(V1) cd $(ROOT_DIR)/flight/$(2) && \
|
|
|
|
$$(MAKE) -r --no-print-directory \
|
|
|
|
BOARD_NAME=$(1) \
|
|
|
|
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
2011-03-26 14:09:11 +01:00
|
|
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
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
|
|
|
|
$(V1) cd $(ROOT_DIR)/flight/Bootloaders/$(2) && \
|
|
|
|
$$(MAKE) -r --no-print-directory \
|
|
|
|
BOARD_NAME=$(1) \
|
|
|
|
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
2011-03-26 14:09:11 +01:00
|
|
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
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
|
2011-05-08 04:05:06 +02:00
|
|
|
$(V1) cd $(ROOT_DIR)/flight/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) \
|
|
|
|
TCHAIN_PREFIX="$(ARM_SDK_PREFIX)" \
|
2011-03-26 14:09:11 +01:00
|
|
|
REMOVE_CMD="$(RM)" OOCD_EXE="$(OPENOCD)" \
|
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
|
|
|
|
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))
|
|
|
|
|
|
|
|
.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)))
|
|
|
|
endef
|
|
|
|
|
2011-11-01 07:10:54 +01:00
|
|
|
ALL_BOARDS := openpilot ahrs coptercontrol pipxtreme ins revolution
|
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
|
|
|
# Friendly names of each board (used to find source tree)
|
|
|
|
openpilot_friendly := OpenPilot
|
|
|
|
coptercontrol_friendly := CopterControl
|
|
|
|
pipxtreme_friendly := PipXtreme
|
|
|
|
ahrs_friendly := AHRS
|
2011-11-14 00:25:38 +01:00
|
|
|
revolution_friendly := Revolution
|
2011-03-26 14:09:11 +01:00
|
|
|
|
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)
|
|
|
|
BU_BOARDS := $(ALL_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
|
|
|
# FIXME: The INS build doesn't have a bootloader or bootloader
|
|
|
|
# updater yet so we need to filter them out to prevent errors.
|
2011-06-08 04:47:07 +02:00
|
|
|
BL_BOARDS := $(filter-out ins, $(ALL_BOARDS))
|
|
|
|
BU_BOARDS := $(filter-out ins, $(ALL_BOARDS))
|
|
|
|
|
|
|
|
# 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))
|
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
|
|
|
|
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
|
|
|
|
all_flight: all_fw all_bl all_bu
|
|
|
|
all_flight_clean: all_fw_clean all_bl_clean all_bu_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
|
|
|
|
$(foreach board, $(ALL_BOARDS), $(eval $(call BU_TEMPLATE,$(board),$($(board)_friendly))))
|
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
|
|
|
|
$(foreach board, $(ALL_BOARDS), $(eval $(call FW_TEMPLATE,$(board),$($(board)_friendly))))
|
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
|
|
|
|
$(foreach board, $(ALL_BOARDS), $(eval $(call BL_TEMPLATE,$(board),$($(board)_friendly))))
|
2011-04-14 14:46:39 +02:00
|
|
|
|
2011-02-23 05:18:56 +01:00
|
|
|
.PHONY: sim_posix
|
|
|
|
sim_posix: sim_posix_elf
|
|
|
|
|
|
|
|
sim_posix_%: uavobjects_flight
|
|
|
|
$(V1) mkdir -p $(BUILD_DIR)/sitl_posix
|
2011-04-02 17:06:01 +02:00
|
|
|
$(V1) $(MAKE) --no-print-directory \
|
|
|
|
-C $(ROOT_DIR)/flight/OpenPilot --file=$(ROOT_DIR)/flight/OpenPilot/Makefile.posix $*
|
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 \
|
|
|
|
-C $(ROOT_DIR)/flight/OpenPilot --file=$(ROOT_DIR)/flight/OpenPilot/Makefile.win32 $*
|
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
|
|
|
#
|
|
|
|
##############################
|
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 $@
|