diff --git a/package/Makefile b/package/Makefile index 62e921309..f7e2d1568 100644 --- a/package/Makefile +++ b/package/Makefile @@ -14,7 +14,13 @@ ROOT_DIR := $(realpath $(WHEREAMI)/../) # Set up some macros BUILD_DIR := $(ROOT_DIR)/build VERSION_CMD := python $(ROOT_DIR)/make/scripts/version-info.py --path="$(ROOT_DIR)" +# If there is a tag, use it for label instead of date-hash string +PACKAGE_TAG := $(shell $(VERSION_CMD) --format=\$${TAG}) +ifneq ($(PACKAGE_TAG),) +PACKAGE_LBL := $(shell $(VERSION_CMD) --format=\$${TAG}\$${DIRTY}) +else PACKAGE_LBL := $(shell $(VERSION_CMD) --format=\$${DATE}-\$${TAG_OR_HASH8}\$${DIRTY}) +endif PACKAGE_DIR := $(BUILD_DIR)/package-$(PACKAGE_LBL) FW_DIR := $(PACKAGE_DIR)/firmware-$(PACKAGE_LBL) BL_DIR := $(FW_DIR)/bootloaders @@ -152,4 +158,5 @@ opfw_resource: $(V1) echo '$(OPFW_CONTENTS)' > $(BUILD_DIR)/ground/$@/opfw_resource.qrc $(V1) $(foreach fw_targ, $(FW_TARGETS), mkdir -p $(BUILD_DIR)/ground/$@/build/$(fw_targ);) $(V1)$(foreach fw_targ, $(FW_TARGETS), cp $(BUILD_DIR)/$(fw_targ)/$(fw_targ).opfw $(BUILD_DIR)/ground/$@/build/$(fw_targ)/;) + include $(WHEREAMI)/Makefile.$(PLATFORM)