mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-03-15 07:29:15 +01:00
Merge branch 'master' of git.openpilot.org:OpenPilot
This commit is contained in:
commit
e3c0f7f12f
10
Makefile
10
Makefile
@ -265,8 +265,8 @@ gcs_clean: openpilotgcs_clean
|
||||
.PHONY: openpilotgcs
|
||||
openpilotgcs: uavobjects_gcs
|
||||
$(V1) mkdir -p $(BUILD_DIR)/ground/$@
|
||||
$(V1) ( cd $(BUILD_DIR)/ground/$@ ; \
|
||||
$(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/openpilotgcs.pro -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) ; \
|
||||
$(V1) ( cd $(BUILD_DIR)/ground/$@ && \
|
||||
$(QMAKE) $(ROOT_DIR)/ground/openpilotgcs/openpilotgcs.pro -spec $(QT_SPEC) -r CONFIG+=$(GCS_BUILD_CONF) && \
|
||||
$(MAKE) -w ; \
|
||||
)
|
||||
|
||||
@ -290,8 +290,8 @@ openpilotgcs_clean:
|
||||
.PHONY: uavobjgenerator
|
||||
uavobjgenerator:
|
||||
$(V1) mkdir -p $(BUILD_DIR)/ground/$@
|
||||
$(V1) ( cd $(BUILD_DIR)/ground/$@ ; \
|
||||
$(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro -spec $(QT_SPEC) -r CONFIG+=debug ; \
|
||||
$(V1) ( cd $(BUILD_DIR)/ground/$@ && \
|
||||
$(QMAKE) $(ROOT_DIR)/ground/uavobjgenerator/uavobjgenerator.pro -spec $(QT_SPEC) -r CONFIG+=debug && \
|
||||
$(MAKE) --no-print-directory -w ; \
|
||||
)
|
||||
|
||||
@ -306,7 +306,7 @@ $(UAVOBJ_OUT_DIR):
|
||||
$(V1) mkdir -p $@
|
||||
|
||||
uavobjects_%: $(UAVOBJ_OUT_DIR) uavobjgenerator
|
||||
$(V1) ( cd $(UAVOBJ_OUT_DIR) ; \
|
||||
$(V1) ( cd $(UAVOBJ_OUT_DIR) && \
|
||||
$(UAVOBJGENERATOR) -$* $(UAVOBJ_XML_DIR) $(ROOT_DIR) ; \
|
||||
)
|
||||
|
||||
|
@ -399,6 +399,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -434,6 +444,5 @@ else
|
||||
-include $(shell mkdir $(OUTDIR) 2>/dev/null) $(shell mkdir $(OUTDIR)/dep 2>/dev/null) $(wildcard $(OUTDIR)/dep/*)
|
||||
endif
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program
|
||||
.PHONY : all build clean clean_list program install
|
||||
|
@ -389,6 +389,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -426,4 +436,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program
|
||||
.PHONY : all build clean clean_list program install
|
||||
|
@ -410,6 +410,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: begin clean_list finished end
|
||||
|
||||
@ -430,7 +440,6 @@ clean_list :
|
||||
$(V1) $(REMOVE) $(CPPSRC:.cpp=.s)
|
||||
$(V1) $(REMOVE) $(CPPSRCARM:.cpp=.s)
|
||||
|
||||
|
||||
# Create output files directory
|
||||
# all known MS Windows OS define the ComSpec environment variable
|
||||
ifdef ComSpec
|
||||
@ -447,4 +456,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program
|
||||
.PHONY : all build clean clean_list program install
|
||||
|
Binary file not shown.
@ -428,10 +428,6 @@ $(eval $(call PARTIAL_COMPILE_TEMPLATE, SRC))
|
||||
# Compile: create assembler files from C source files. ARM only
|
||||
$(eval $(call PARTIAL_COMPILE_ARM_TEMPLATE, SRCARM))
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
$(OUTDIR)/$(TARGET).bin.o: $(OUTDIR)/$(TARGET).bin
|
||||
|
||||
.PHONY: elf lss sym hex bin bino
|
||||
@ -447,6 +443,20 @@ $(eval $(call SIZE_TEMPLATE, $(OUTDIR)/$(TARGET).elf))
|
||||
.PHONY: size
|
||||
size: $(OUTDIR)/$(TARGET).elf_size
|
||||
|
||||
# Generate Doxygen documents
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -484,4 +494,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program
|
||||
.PHONY : all build clean clean_list program install
|
||||
|
@ -450,6 +450,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -487,4 +497,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program
|
||||
.PHONY : all build clean clean_list program install
|
||||
|
@ -446,6 +446,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -483,5 +493,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program
|
||||
|
||||
.PHONY : all build clean clean_list program install
|
||||
|
@ -592,6 +592,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -631,5 +641,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program gencode
|
||||
|
||||
.PHONY : all build clean clean_list program gencode install
|
||||
|
@ -416,6 +416,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -450,6 +460,5 @@ else
|
||||
-include $(shell mkdir $(OUTDIR) 2>/dev/null) $(shell mkdir $(OUTDIR)/dep 2>/dev/null) $(wildcard $(OUTDIR)/dep/*)
|
||||
endif
|
||||
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program
|
||||
.PHONY : all build clean clean_list program install
|
||||
|
@ -573,6 +573,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -612,5 +622,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program gencode
|
||||
|
||||
.PHONY : all build clean clean_list program gencode install
|
||||
|
@ -439,6 +439,16 @@ size: $(OUTDIR)/$(TARGET).elf_size
|
||||
docs:
|
||||
doxygen $(DOXYGENDIR)/doxygen.cfg
|
||||
|
||||
# Install: install binary file with prefix/suffix into install directory
|
||||
install: $(OUTDIR)/$(TARGET).bin
|
||||
ifneq ($(INSTALL_DIR),)
|
||||
@echo $(MSG_INSTALLING) $(call toprel, $<)
|
||||
$(V1) mkdir -p $(INSTALL_DIR)
|
||||
$(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin
|
||||
else
|
||||
$(error INSTALL_DIR must be specified for $@)
|
||||
endif
|
||||
|
||||
# Target: clean project.
|
||||
clean: clean_list
|
||||
|
||||
@ -476,4 +486,4 @@ else
|
||||
endif
|
||||
|
||||
# Listing of phony targets.
|
||||
.PHONY : all build clean clean_list program
|
||||
.PHONY : all build clean clean_list program install
|
||||
|
@ -10,6 +10,7 @@ OBJDUMP = $(TCHAIN_PREFIX)objdump
|
||||
SIZE = $(TCHAIN_PREFIX)size
|
||||
NM = $(TCHAIN_PREFIX)nm
|
||||
STRIP = $(TCHAIN_PREFIX)strip
|
||||
INSTALL = install
|
||||
|
||||
THUMB = -mthumb
|
||||
|
||||
@ -43,6 +44,7 @@ MSG_CLEANING := ${quote} CLEAN ${quote}
|
||||
MSG_ASMFROMC := ${quote} AS(C) ${quote}
|
||||
MSG_ASMFROMC_ARM := ${quote} AS(C)-ARM ${quote}
|
||||
MSG_PYMITEINIT := ${quote} PY ${quote}
|
||||
MSG_INSTALLING := ${quote} INSTALL ${quote}
|
||||
|
||||
toprel = $(subst $(realpath $(TOP))/,,$(abspath $(1)))
|
||||
|
||||
|
@ -37,17 +37,18 @@ locations (but any other locations are fine as well):
|
||||
- QtSDK in C:\Qt\2010.05
|
||||
- msysGit in %ProgramFiles%\Git
|
||||
- Unicode NSIS in %ProgramFiles%\NSIS\Unicode
|
||||
- OpenOCD in C:\OpenOCD\0.4.0\bin
|
||||
|
||||
Also it is assumed that you have the C:\Program Files\Git\cmd\ directory in
|
||||
the PATH. Usually this is the case for msysGit installation if you have chosen
|
||||
the 2nd option: put only git and gitk in the PATH (it is recommended option).
|
||||
|
||||
Now you need to copy two files to your msysGit installation folders.
|
||||
Now you need to copy few files to your msysGit installation folders.
|
||||
Assuming that you installed the msysGit into C:\Program Files\Git\,
|
||||
you have to copy:
|
||||
|
||||
make\winx86\make -> C:\Program Files\Git\bin\
|
||||
make\winx86\sh.cmd -> C:\Program Files\Git\cmd\
|
||||
make\winx86\bin\* -> C:\Program Files\Git\bin\
|
||||
make\winx86\cmd\* -> C:\Program Files\Git\cmd\
|
||||
|
||||
If you have msysGit installed into another directory, you need to update paths
|
||||
accordingly. Also if you have tools installed into different directories and
|
||||
@ -93,7 +94,7 @@ software and flight firmware built in the end.
|
||||
4) To build parts of the system you can use, for example, such commands:
|
||||
|
||||
user@pc /d/Work/OpenPilot/git (master)
|
||||
$ make -j2 USE_BOOTLOADER=YES GCS_BUIL_CONF=release gcs coptercontrol bl_coptercontrol
|
||||
$ make -j2 GCS_BUILD_CONF=release gcs coptercontrol
|
||||
|
||||
or to completely remove the build directory:
|
||||
|
||||
@ -109,7 +110,7 @@ or to completely remove the build directory:
|
||||
#!/bin/sh
|
||||
# This is the cc_make_release.sh file used to build CC release software
|
||||
cd D:/Work/OpenPilot/git
|
||||
make -j2 USE_BOOTLOADER=YES GCS_BUIL_CONF=release gcs coptercontrol bl_coptercontrol
|
||||
make -j2 GCS_BUILD_CONF=release gcs coptercontrol
|
||||
echo RC=$?
|
||||
|
||||
2) Run it typing:
|
||||
@ -170,7 +171,7 @@ to get rid of git bash welcome message on every script invocation.
|
||||
|
||||
Currently there may be some problems running scripts which contain spaces in
|
||||
file names or located in directories which contain spaces in full paths.
|
||||
It results in in strange "file not found" or other errors.
|
||||
It results in strange "file not found" or other errors.
|
||||
|
||||
It is recommended to avoid using such names with spaces.
|
||||
|
||||
|
15
make/winx86/bin/install
Normal file
15
make/winx86/bin/install
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# simple install command replacement for Windows
|
||||
#
|
||||
# This file should be put into C:\Program Files\Git\bin\ subdirectory
|
||||
# (or similar, depeding on where the msysGit package was installed)
|
||||
# to provide a make command to unix-like build environment on Windows.
|
||||
#
|
||||
# See also:
|
||||
# README.txt
|
||||
# http://wiki.openpilot.org/display/Doc/GCS+Development+on+Windows
|
||||
# http://wiki.openpilot.org/display/Doc/Firmware+Development+on+Windows
|
||||
#
|
||||
|
||||
cp -f $*
|
@ -1,6 +1,8 @@
|
||||
#!/bin/sh
|
||||
#
|
||||
# This file is to be put into C:\Program Files\Git\bin\ subdirectory
|
||||
# make command replacement for Windows
|
||||
#
|
||||
# This file should be put into C:\Program Files\Git\bin\ subdirectory
|
||||
# (or similar, depeding on where the msysGit package was installed)
|
||||
# to provide a make command to unix-like build environment on Windows.
|
||||
#
|
9
make/winx86/cmd/make.sh
Normal file
9
make/winx86/cmd/make.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#
|
||||
# make command replacement to run from command prompt under bash
|
||||
#
|
||||
# This file should be put into C:\Program Files\Git\cmd\ subdirectory
|
||||
# (or similar, depeding on where the msysGit package was installed)
|
||||
# to provide a shell prompt in the unix-like build environment on Windows.
|
||||
#
|
||||
|
||||
exec /bin/make $*
|
@ -1,6 +1,6 @@
|
||||
@echo off
|
||||
rem
|
||||
rem This file is to be put into C:\Program Files\Git\cmd\ subdirectory
|
||||
rem This file should be put into C:\Program Files\Git\cmd\ subdirectory
|
||||
rem (or similar, depeding on where the msysGit package was installed)
|
||||
rem to provide a shell prompt in the unix-like build environment on Windows.
|
||||
rem
|
||||
@ -56,6 +56,7 @@ call :which QTSDK "C:\Qt\2010.05\qt\bin" qmake.exe
|
||||
call :which CODESOURCERY "C:\CodeSourcery\bin" cs-make.exe
|
||||
call :which PYTHON "C:\Python27" python.exe
|
||||
call :which UNSIS "%ProgramFiles%\NSIS\Unicode" makensis.exe
|
||||
call :which OPENOCDBIN "C:\OpenOCD\0.4.0\bin" openocd.exe
|
||||
|
||||
if "%NOT_FOUND%" == "" goto set_path
|
||||
|
145
release/Makefile
Normal file
145
release/Makefile
Normal file
@ -0,0 +1,145 @@
|
||||
# Set up a default goal
|
||||
.DEFAULT_GOAL := help
|
||||
|
||||
# Tried the best to support parallel (-j) builds. But since this Makefile
|
||||
# uses other Makefiles to build few targets which in turn have similar
|
||||
# dependencies on uavobjects and other generated files, it is difficult
|
||||
# to support parallel builds perfectly. But at least it was tested with
|
||||
# -j (unlimited job number) on Windows and Linux.
|
||||
|
||||
# Locate the root of the tree
|
||||
WHEREAMI := $(dir $(lastword $(MAKEFILE_LIST)))
|
||||
ROOT_DIR := $(realpath $(WHEREAMI)/../)
|
||||
|
||||
# Set up some macros
|
||||
BUILD_DIR := $(ROOT_DIR)/build
|
||||
RELEASE_DATE := $(shell date +%Y%m%d)
|
||||
RELEASE_TAG := unreleased
|
||||
RELEASE_LBL := $(RELEASE_DATE)-$(RELEASE_TAG)
|
||||
RELEASE_DIR := $(BUILD_DIR)/release-$(RELEASE_LBL)
|
||||
FW_DIR := $(RELEASE_DIR)/firmware-$(RELEASE_LBL)
|
||||
BL_DIR := $(FW_DIR)/bootloaders
|
||||
BLUPD_DIR := $(FW_DIR)/bootloader_updaters
|
||||
|
||||
# Setup targets
|
||||
FW_TARGETS_COMMON := ahrs pipxtreme
|
||||
FW_TARGETS_INPUT := coptercontrol openpilot
|
||||
FW_TARGETS_TOOLS := coptercontrol
|
||||
FW_TARGETS := $(FW_TARGETS_COMMON) $(FW_TARGETS_INPUT)
|
||||
BL_TARGETS := $(addprefix bl_, $(FW_TARGETS))
|
||||
BLUPD_TARGETS := $(addprefix blupd_, $(FW_TARGETS))
|
||||
|
||||
help:
|
||||
@echo
|
||||
@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."
|
||||
@echo
|
||||
@echo " Here is a summary of the available targets:"
|
||||
@echo
|
||||
@echo " [Release build and packaging]"
|
||||
@echo " release - Build and package the OpenPilot release"
|
||||
@echo " release_flight - Build and package the OpenPilot flight firmware"
|
||||
@echo
|
||||
@echo " Notes:"
|
||||
@echo " - the build directory will be removed first on every run"
|
||||
@echo " unless CLEAN_BUILD=NO is defined (recommended for testing only)"
|
||||
@echo " - release packages will be placed in $(RELEASE_DIR)"
|
||||
@echo
|
||||
|
||||
# Clean and build uavobjects since all parts depend on them
|
||||
uavobjects: all_clean
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) $@
|
||||
|
||||
all_clean:
|
||||
ifneq ($(CLEAN_BUILD), NO)
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) $@
|
||||
endif
|
||||
|
||||
# Install template:
|
||||
# $1 = target
|
||||
# $2 = dependencies
|
||||
# $3 = install directory (must be defined)
|
||||
# $4 = installed file name prefix (optional)
|
||||
# $5 = installed file name suffix (optional)
|
||||
# $6 = extra make options (for instance, USE_SPEKTRUM=YES)
|
||||
# $7 = optional target suffix (for instance, clean, if target must be cleaned first)
|
||||
# $8 = list of targets to install (without _install suffix)
|
||||
# $9 = inner make target (usually install, but can be other to just build)
|
||||
define INSTALL_TEMPLATE
|
||||
$(1): $(2)
|
||||
ifneq ($(7),)
|
||||
$$(V1) +$(MAKE) -C $(ROOT_DIR) $(6) $(addsuffix _$(7), $(8))
|
||||
endif
|
||||
$$(V1) +$(MAKE) -C $(ROOT_DIR) INSTALL_DIR=$(3) INSTALL_PFX=$(4) INSTALL_SFX=$(5) $(6) $(addsuffix _$(9), $(8))
|
||||
.PHONY: $(1)
|
||||
endef
|
||||
|
||||
# Firmware for different input drivers
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_common,uavobjects,$(FW_DIR),,-$(RELEASE_LBL),,,$(FW_TARGETS_COMMON),install))
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_pwm,uavobjects,$(FW_DIR),,-pwm-$(RELEASE_LBL),,clean,$(FW_TARGETS_INPUT),install))
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_spektrum,uavobjects,$(FW_DIR),,-spektrum-$(RELEASE_LBL),USE_SPEKTRUM=YES,clean,$(FW_TARGETS_INPUT),install))
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_ppm,uavobjects,$(FW_DIR),,-ppm-$(RELEASE_LBL),USE_PPM=YES,clean,$(FW_TARGETS_INPUT),install))
|
||||
|
||||
# Bootloaders (change 'bin' to 'install' to install bootloaders too)
|
||||
$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(RELEASE_LBL),,,$(BL_TARGETS),bin))
|
||||
|
||||
# Bootloader Updaters
|
||||
$(eval $(call INSTALL_TEMPLATE,blupd_coptercontrol,all_bl,$(BLUPD_DIR),CopterControl_,-$(RELEASE_LBL),,,blupd_coptercontrol,install))
|
||||
$(eval $(call INSTALL_TEMPLATE,blupd_ahrs,all_bl,$(BLUPD_DIR),AHRS_,-$(RELEASE_LBL),,,blupd_ahrs,install))
|
||||
$(eval $(call INSTALL_TEMPLATE,blupd_openpilot,all_bl,$(BLUPD_DIR),OpenPilot_,-$(RELEASE_LBL),,,blupd_openpilot,install))
|
||||
$(eval $(call INSTALL_TEMPLATE,blupd_pipxtreme,all_bl,$(BLUPD_DIR),PipXtreme_,-$(RELEASE_LBL),,,blupd_pipxtreme,install))
|
||||
|
||||
# CopterControl flash eraser tool (change fw_spektrum to fw_ppm if fw_ppm is enabled in release_fw target below)
|
||||
$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(BLUPD_DIR),,-FlashEraser-$(RELEASE_LBL),ERASE_FLASH=YES,clean,$(FW_TARGETS_TOOLS),install))
|
||||
|
||||
# Order-only dependencies
|
||||
# They are bit complicated to support parallel (-j) builds and to
|
||||
# create the pwm/ppm/spektrum and CC flash eraser targets in a sequence of build steps
|
||||
|
||||
fw_pwm: | # default dependencies
|
||||
|
||||
fw_spektrum: | fw_pwm # sequential build
|
||||
|
||||
fw_ppm: | fw_spektrum # sequential build
|
||||
|
||||
fw_tools: | fw_spektrum # sequential build, replace fw_spektrum by fw_ppm if uncommented below
|
||||
|
||||
release_fw: | fw_common fw_pwm fw_spektrum # fw_ppm
|
||||
|
||||
release_blupd: | $(BLUPD_TARGETS)
|
||||
|
||||
release_flight: | release_fw release_blupd fw_tools
|
||||
|
||||
release_ground: | ground_package
|
||||
|
||||
release: | release_flight release_ground
|
||||
|
||||
.PHONY: help uavobjects all_clean release release_flight release_fw release_blupd release_ground
|
||||
|
||||
# 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
|
||||
|
||||
ifneq ($(V),1)
|
||||
MAKEFLAGS += --no-print-directory
|
||||
endif
|
||||
|
||||
# Platform-dependent stuff
|
||||
PLATFORM := win32
|
||||
UNAME := $(shell uname)
|
||||
ifeq ($(UNAME), Linux)
|
||||
PLATFORM := linux
|
||||
endif
|
||||
ifeq ($(UNAME), Darwin)
|
||||
PLATFORM := osx
|
||||
endif
|
||||
|
||||
include $(WHEREAMI)/Makefile.$(PLATFORM)
|
10
release/Makefile.linux
Normal file
10
release/Makefile.linux
Normal file
@ -0,0 +1,10 @@
|
||||
#
|
||||
# Linux-specific packaging
|
||||
#
|
||||
|
||||
gcs: uavobjects
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@
|
||||
|
||||
ground_package: | gcs
|
||||
|
||||
.PHONY: gcs ground_package
|
10
release/Makefile.osx
Normal file
10
release/Makefile.osx
Normal file
@ -0,0 +1,10 @@
|
||||
#
|
||||
# MacOSX-specific packaging
|
||||
#
|
||||
|
||||
gcs: uavobjects
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@
|
||||
|
||||
ground_package: | gcs
|
||||
|
||||
.PHONY: gcs ground_package
|
11
release/Makefile.win32
Normal file
11
release/Makefile.win32
Normal file
@ -0,0 +1,11 @@
|
||||
#
|
||||
# Windows-specific packaging
|
||||
#
|
||||
|
||||
# Generate GCS installer
|
||||
gcs_installer: uavobjects
|
||||
$(V1) $(MAKE) -C $(ROOT_DIR) GCS_BUILD_CONF=release $@
|
||||
|
||||
ground_package: | gcs_installer
|
||||
|
||||
.PHONY: gcs_installer ground_package
|
Loading…
x
Reference in New Issue
Block a user