mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-29 07:24:13 +01:00
packaging: build unified firmware for Rx interfaces and remove flash-erase tool
This commit is contained in:
parent
2f7065e5b5
commit
ca44469b92
@ -19,14 +19,10 @@ PACKAGE_DIR := $(BUILD_DIR)/package-$(PACKAGE_LBL)
|
|||||||
FW_DIR := $(PACKAGE_DIR)/firmware-$(PACKAGE_LBL)
|
FW_DIR := $(PACKAGE_DIR)/firmware-$(PACKAGE_LBL)
|
||||||
BL_DIR := $(FW_DIR)/bootloaders
|
BL_DIR := $(FW_DIR)/bootloaders
|
||||||
BU_DIR := $(FW_DIR)/bootloader-updaters
|
BU_DIR := $(FW_DIR)/bootloader-updaters
|
||||||
FE_DIR := $(FW_DIR)/flash-erase-tools
|
|
||||||
|
|
||||||
# Clean build options (recommended for package testing only)
|
# Clean build options (recommended for package testing only)
|
||||||
ifeq ($(CLEAN_BUILD), NO)
|
ifeq ($(CLEAN_BUILD), NO)
|
||||||
CLEAN_GROUND := NO
|
CLEAN_GROUND := NO
|
||||||
CLEAN_FLIGHT := YES
|
|
||||||
else ifeq ($(CLEAN_BUILD), NEVER)
|
|
||||||
CLEAN_GROUND := NO
|
|
||||||
CLEAN_FLIGHT := NO
|
CLEAN_FLIGHT := NO
|
||||||
else
|
else
|
||||||
CLEAN_GROUND := YES
|
CLEAN_GROUND := YES
|
||||||
@ -34,11 +30,7 @@ CLEAN_FLIGHT := YES
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Set up targets (PPM target seems to be broken at the moment)
|
# Set up targets (PPM target seems to be broken at the moment)
|
||||||
FW_TARGETS_COMMON := $(addprefix fw_, ahrs pipxtreme)
|
FW_TARGETS := $(addprefix fw_, ahrs pipxtreme coptercontrol openpilot)
|
||||||
FW_TARGETS_PWM := $(addprefix fw_, coptercontrol openpilot)
|
|
||||||
FW_TARGETS_DSM2 := $(addprefix fw_, coptercontrol openpilot)
|
|
||||||
FW_TARGETS_SBUS := $(addprefix fw_, coptercontrol)
|
|
||||||
FW_TARGETS_PPM := $(addprefix fw_, openpilot)
|
|
||||||
FW_TARGETS_TOOLS := $(addprefix fw_, coptercontrol)
|
FW_TARGETS_TOOLS := $(addprefix fw_, coptercontrol)
|
||||||
BL_TARGETS := $(addprefix bl_, coptercontrol openpilot ahrs pipxtreme)
|
BL_TARGETS := $(addprefix bl_, coptercontrol openpilot ahrs pipxtreme)
|
||||||
BU_TARGETS := $(addprefix bu_, coptercontrol openpilot ahrs pipxtreme)
|
BU_TARGETS := $(addprefix bu_, coptercontrol openpilot ahrs pipxtreme)
|
||||||
@ -57,16 +49,9 @@ help:
|
|||||||
@echo " Notes:"
|
@echo " Notes:"
|
||||||
@echo " - package will be placed in $(PACKAGE_DIR)"
|
@echo " - package will be placed in $(PACKAGE_DIR)"
|
||||||
@echo
|
@echo
|
||||||
@echo " - the build directory will be removed first on every run unless one"
|
@echo " - the build directory will be removed first on every run unless"
|
||||||
@echo " of CLEAN_BUILD=NO or CLEAN_BUILD=NEVER options is defined."
|
@echo " CLEAN_BUILD=NO is defined. It means no clean before build."
|
||||||
@echo
|
@echo " This usually is safe."
|
||||||
@echo " CLEAN_BUILD=NO means no clean before build except for multi-input"
|
|
||||||
@echo " firmware binaries like CopterControl or OpenPilot. This usually is"
|
|
||||||
@echo " safe."
|
|
||||||
@echo
|
|
||||||
@echo " CLEAN_BUILD=NEVER means no clean will be done at all. This will,"
|
|
||||||
@echo " probably, give invalid multi-input firmware and is recommended"
|
|
||||||
@echo " for package testing only. Do not use for release builds."
|
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
# Clean and build uavobjects since all parts depend on them
|
# Clean and build uavobjects since all parts depend on them
|
||||||
@ -99,12 +84,8 @@ endif
|
|||||||
.PHONY: $(1)
|
.PHONY: $(1)
|
||||||
endef
|
endef
|
||||||
|
|
||||||
# Firmware for different input drivers
|
# Firmware
|
||||||
$(eval $(call INSTALL_TEMPLATE,fw_common,uavobjects,$(FW_DIR),,-$(PACKAGE_LBL),,,$(FW_TARGETS_COMMON),install))
|
$(eval $(call INSTALL_TEMPLATE,all_fw,uavobjects,$(FW_DIR),,-$(PACKAGE_LBL),,,$(FW_TARGETS),install))
|
||||||
$(eval $(call INSTALL_TEMPLATE,fw_pwm,uavobjects,$(FW_DIR),,-pwm-$(PACKAGE_LBL),,clean,$(FW_TARGETS_PWM),install))
|
|
||||||
$(eval $(call INSTALL_TEMPLATE,fw_dsm2,uavobjects,$(FW_DIR),,-dsm2sat-$(PACKAGE_LBL),USE_SPEKTRUM=YES,clean,$(FW_TARGETS_DSM2),install))
|
|
||||||
$(eval $(call INSTALL_TEMPLATE,fw_sbus,uavobjects,$(FW_DIR),,-sbus-$(PACKAGE_LBL),USE_SBUS=YES USE_TELEMETRY=3,clean,$(FW_TARGETS_SBUS),install))
|
|
||||||
$(eval $(call INSTALL_TEMPLATE,fw_ppm,uavobjects,$(FW_DIR),,-ppm-$(PACKAGE_LBL),USE_PPM=YES,clean,$(FW_TARGETS_PPM),install))
|
|
||||||
|
|
||||||
# Bootloaders (change 'install' to 'bin' if you don't want to install bootloaders)
|
# Bootloaders (change 'install' to 'bin' if you don't want to install bootloaders)
|
||||||
$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(PACKAGE_LBL),,,$(BL_TARGETS),install))
|
$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(PACKAGE_LBL),,,$(BL_TARGETS),install))
|
||||||
@ -112,34 +93,14 @@ $(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(PACKAGE_LBL),,,$(
|
|||||||
# Bootloader updaters
|
# Bootloader updaters
|
||||||
$(eval $(call INSTALL_TEMPLATE,all_bu,all_bl,$(BU_DIR),,-$(PACKAGE_LBL),,,$(BU_TARGETS),install))
|
$(eval $(call INSTALL_TEMPLATE,all_bu,all_bl,$(BU_DIR),,-$(PACKAGE_LBL),,,$(BU_TARGETS),install))
|
||||||
|
|
||||||
# CopterControl flash eraser tool
|
|
||||||
$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(FE_DIR),,-flash-erase-$(PACKAGE_LBL),ERASE_FLASH=YES,clean,$(FW_TARGETS_TOOLS),install))
|
|
||||||
|
|
||||||
# Order-only dependencies
|
# Order-only dependencies
|
||||||
# They are bit complicated to support parallel (-j) builds and to create
|
package_flight: | all_fw all_bu
|
||||||
# the pwm/ppm/spektrum and CC flash eraser targets in some fixed order
|
|
||||||
|
|
||||||
fw_pwm: | # default dependencies, will be built first
|
|
||||||
|
|
||||||
fw_dsm2: | fw_pwm # ordered build
|
|
||||||
|
|
||||||
fw_sbus: | fw_dsm2 # ordered build
|
|
||||||
|
|
||||||
fw_ppm: | fw_sbus # ordered build
|
|
||||||
|
|
||||||
fw_tools: | fw_ppm # ordered build
|
|
||||||
|
|
||||||
package_fw: | fw_common fw_pwm fw_dsm2 fw_sbus fw_ppm
|
|
||||||
|
|
||||||
package_bu: | all_bu
|
|
||||||
|
|
||||||
package_flight: | package_fw package_bu fw_tools
|
|
||||||
|
|
||||||
package_ground: | ground_package
|
package_ground: | ground_package
|
||||||
|
|
||||||
package: | package_flight package_ground
|
package: | package_flight package_ground
|
||||||
|
|
||||||
.PHONY: help uavobjects all_clean package package_flight package_fw package_bu package_ground
|
.PHONY: help uavobjects all_clean package_flight package_ground package
|
||||||
|
|
||||||
# Decide on a verbosity level based on the V= parameter
|
# Decide on a verbosity level based on the V= parameter
|
||||||
export AT := @
|
export AT := @
|
||||||
|
Loading…
Reference in New Issue
Block a user