From 66804076b8af4406b87ed0accfe0a250d5dd106f Mon Sep 17 00:00:00 2001 From: Oleg Semyonov Date: Wed, 25 May 2011 00:44:45 +0300 Subject: [PATCH] build: fix release/Makefile for *.opf files and changed targets --- flight/AHRS/Makefile | 4 +-- flight/Bootloaders/BootloaderUpdater/Makefile | 4 +-- flight/CopterControl/Makefile | 4 +-- flight/INS/Makefile | 4 +-- flight/OpenPilot/Makefile | 4 +-- flight/PipXtreme/Makefile | 4 +-- release/Makefile | 35 ++++++++++--------- 7 files changed, 30 insertions(+), 29 deletions(-) diff --git a/flight/AHRS/Makefile b/flight/AHRS/Makefile index 640634615..6c0e09f01 100644 --- a/flight/AHRS/Makefile +++ b/flight/AHRS/Makefile @@ -374,11 +374,11 @@ docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opf ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opf else $(error INSTALL_DIR must be specified for $@) endif diff --git a/flight/Bootloaders/BootloaderUpdater/Makefile b/flight/Bootloaders/BootloaderUpdater/Makefile index 1488bec8e..7969a7ebe 100644 --- a/flight/Bootloaders/BootloaderUpdater/Makefile +++ b/flight/Bootloaders/BootloaderUpdater/Makefile @@ -405,11 +405,11 @@ docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opf ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opf else $(error INSTALL_DIR must be specified for $@) endif diff --git a/flight/CopterControl/Makefile b/flight/CopterControl/Makefile index 2541e1cc0..33b0f8034 100644 --- a/flight/CopterControl/Makefile +++ b/flight/CopterControl/Makefile @@ -570,11 +570,11 @@ docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opf ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opf else $(error INSTALL_DIR must be specified for $@) endif diff --git a/flight/INS/Makefile b/flight/INS/Makefile index e8c0e50ff..c5168158f 100644 --- a/flight/INS/Makefile +++ b/flight/INS/Makefile @@ -382,11 +382,11 @@ docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opf ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opf else $(error INSTALL_DIR must be specified for $@) endif diff --git a/flight/OpenPilot/Makefile b/flight/OpenPilot/Makefile index 0fd6e4342..91c83cb10 100644 --- a/flight/OpenPilot/Makefile +++ b/flight/OpenPilot/Makefile @@ -548,11 +548,11 @@ docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opf ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opf else $(error INSTALL_DIR must be specified for $@) endif diff --git a/flight/PipXtreme/Makefile b/flight/PipXtreme/Makefile index 121c5c378..c1c3ed4ce 100644 --- a/flight/PipXtreme/Makefile +++ b/flight/PipXtreme/Makefile @@ -413,11 +413,11 @@ docs: doxygen $(DOXYGENDIR)/doxygen.cfg # Install: install binary file with prefix/suffix into install directory -install: $(OUTDIR)/$(TARGET).bin +install: $(OUTDIR)/$(TARGET).opf ifneq ($(INSTALL_DIR),) @echo $(MSG_INSTALLING) $(call toprel, $<) $(V1) mkdir -p $(INSTALL_DIR) - $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).bin + $(V1) $(INSTALL) $< $(INSTALL_DIR)/$(INSTALL_PFX)$(TARGET)$(INSTALL_SFX).opf else $(error INSTALL_DIR must be specified for $@) endif diff --git a/release/Makefile b/release/Makefile index a6a68fd93..645a67758 100644 --- a/release/Makefile +++ b/release/Makefile @@ -18,7 +18,8 @@ RELEASE_LBL := $(shell $(VERSION_CMD) --format=\$${DATE}-\$${TAG_OR_HASH8}\$${D RELEASE_DIR := $(BUILD_DIR)/release-$(RELEASE_LBL) FW_DIR := $(RELEASE_DIR)/firmware-$(RELEASE_LBL) 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) ifeq ($(CLEAN_BUILD), NO) @@ -32,13 +33,16 @@ CLEAN_GROUND := YES CLEAN_FLIGHT := YES endif -# 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)) -BU_TARGETS := $(addprefix bu_, $(FW_TARGETS)) +# Set up targets +FW_STEMS_COMMON := ahrs pipxtreme +FW_STEMS_INPUT := coptercontrol openpilot +FW_STEMS_TOOLS := coptercontrol +FW_STEMS_ALL := $(FW_STEMS_COMMON) $(FW_STEMS_INPUT) +FW_TARGETS_COMMON := $(addprefix fw_, $(FW_STEMS_COMMON)) +FW_TARGETS_INPUT := $(addprefix fw_, $(FW_STEMS_INPUT)) +FW_TARGETS_TOOLS := $(addprefix fw_, $(FW_STEMS_TOOLS)) +BL_TARGETS := $(addprefix bl_, $(FW_STEMS_ALL)) +BU_TARGETS := $(addprefix bu_, $(FW_STEMS_ALL)) help: @echo @@ -102,17 +106,14 @@ $(eval $(call INSTALL_TEMPLATE,fw_pwm,uavobjects,$(FW_DIR),,-pwm-$(RELEASE_LBL), $(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)) +# Bootloaders (change 'install' to 'bin' if you don't want to install bootloaders) +$(eval $(call INSTALL_TEMPLATE,all_bl,uavobjects,$(BL_DIR),,-$(RELEASE_LBL),,,$(BL_TARGETS),install)) -# Bootloader Updaters -$(eval $(call INSTALL_TEMPLATE,bu_coptercontrol,all_bl,$(BU_DIR),CopterControl_,-$(RELEASE_LBL),,,bu_coptercontrol,install)) -$(eval $(call INSTALL_TEMPLATE,bu_ahrs,all_bl,$(BU_DIR),AHRS_,-$(RELEASE_LBL),,,bu_ahrs,install)) -$(eval $(call INSTALL_TEMPLATE,bu_openpilot,all_bl,$(BU_DIR),OpenPilot_,-$(RELEASE_LBL),,,bu_openpilot,install)) -$(eval $(call INSTALL_TEMPLATE,bu_pipxtreme,all_bl,$(BU_DIR),PipXtreme_,-$(RELEASE_LBL),,,bu_pipxtreme,install)) +# Bootloader updaters +$(eval $(call INSTALL_TEMPLATE,all_bu,all_bl,$(BU_DIR),,-$(RELEASE_LBL),,,$(BU_TARGETS),install)) # CopterControl flash eraser tool -$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(BU_DIR),,-FlashEraser-$(RELEASE_LBL),ERASE_FLASH=YES,clean,$(FW_TARGETS_TOOLS),install)) +$(eval $(call INSTALL_TEMPLATE,fw_tools,uavobjects,$(FE_DIR),,-flash-erase-$(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 @@ -128,7 +129,7 @@ fw_tools: | fw_spektrum # ordered build, replace fw_spektrum by fw_ppm if uncomm release_fw: | fw_common fw_pwm fw_spektrum # fw_ppm -release_bu: | $(BU_TARGETS) +release_bu: | all_bu release_flight: | release_fw release_bu fw_tools