michael@0: # vim:set ts=8 sw=8 sts=8 noet: michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: STANDALONE_MAKEFILE := 1 michael@0: michael@0: # input location for the build, usually $(DIST) michael@0: # set this to $(DIST)/l10n-stage per override for L10n builds michael@0: PACKAGE_BASE_DIR = $(DIST) michael@0: michael@0: # Default output location for update archive michael@0: STAGE_DIR = $(DIST)/$(PKG_UPDATE_PATH) michael@0: michael@0: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) michael@0: ifdef UNIVERSAL_BINARY michael@0: ifneq (,$(filter %/l10n-stage,$(PACKAGE_BASE_DIR))) michael@0: PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME) michael@0: else michael@0: PACKAGE_DIR = $(PACKAGE_BASE_DIR)/universal/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME) michael@0: endif michael@0: else michael@0: PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME) michael@0: endif michael@0: else michael@0: PACKAGE_DIR = $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR) michael@0: endif michael@0: michael@0: MAR_BIN = $(LIBXUL_DIST)/host/bin/mar$(HOST_BIN_SUFFIX) michael@0: MBSDIFF_BIN = $(LIBXUL_DIST)/host/bin/mbsdiff$(HOST_BIN_SUFFIX) michael@0: michael@0: OVERRIDE_DEFAULT_GOAL := full-update michael@0: full-update:: complete-patch $(if $(MOZ_AUTOMATION_UPDATE_PACKAGING),automation-partial-patch) michael@0: michael@0: ifeq ($(OS_TARGET), WINNT) michael@0: MOZ_PKG_FORMAT := SFX7Z michael@0: UNPACKAGE = '$(subst $(DIST),$(_ABS_DIST),$(INSTALLER_PACKAGE))' michael@0: ifdef AB_CD michael@0: UNPACKAGE = '$(PACKAGE_BASE_DIR)/$(PACKAGE)' michael@0: endif michael@0: endif michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: include $(topsrcdir)/toolkit/mozapps/installer/signing.mk michael@0: include $(topsrcdir)/toolkit/mozapps/installer/packager.mk michael@0: michael@0: ifdef MOZ_EXTERNAL_SIGNING_FORMAT michael@0: # We can't use signcode on mar files michael@0: MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT)) michael@0: MOZ_EXTERNAL_SIGNING_FORMAT := mar $(MOZ_EXTERNAL_SIGNING_FORMAT) michael@0: endif michael@0: michael@0: dir-stage := $(call mkdir_deps,$(STAGE_DIR)) michael@0: michael@0: complete-patch:: $(dir-stage) michael@0: ifeq ($(OS_TARGET), WINNT) michael@0: test -f $(UNPACKAGE) michael@0: $(RM) -rf '$(PACKAGE_DIR)' michael@0: cd $(PACKAGE_BASE_DIR) && $(INNER_UNMAKE_PACKAGE) michael@0: endif michael@0: MAR=$(MAR_BIN) \ michael@0: $(srcdir)/make_full_update.sh \ michael@0: '$(DIST)/$(COMPLETE_MAR)' \ michael@0: '$(PACKAGE_DIR)' michael@0: ifdef MOZ_SIGN_CMD michael@0: $(MOZ_SIGN_CMD) -f mar '$(DIST)/$(COMPLETE_MAR)' michael@0: endif michael@0: michael@0: partial-patch:: $(dir-stage) michael@0: MAR=$(MAR_BIN) \ michael@0: MBSDIFF=$(MBSDIFF_BIN) \ michael@0: $(srcdir)/make_incremental_update.sh \ michael@0: '$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar' \ michael@0: '$(SRC_BUILD)' \ michael@0: '$(DST_BUILD)' michael@0: ifdef MOZ_SIGN_CMD michael@0: $(MOZ_SIGN_CMD) -f mar '$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar' michael@0: endif michael@0: michael@0: automation-partial-patch: complete-patch michael@0: rm -rf current current.work previous michael@0: mkdir current previous michael@0: latestmar=$$(ssh -l $(UPLOAD_USER) -i $(UPLOAD_SSH_KEY) $(UPLOAD_HOST) 'ls -1t $(LATEST_MAR_DIR) | grep $(MOZ_PKG_PLATFORM).complete.mar$$ | head -n 1'); \ michael@0: if test -n "$$latestmar"; then \ michael@0: wget -O $(STAGE_DIR)/previous.mar http://$(UPLOAD_HOST)/$(LATEST_MAR_DIR)/$$latestmar && \ michael@0: (cd previous; \ michael@0: MAR=$(MAR_BIN) perl $(topsrcdir)/tools/update-packaging/unwrap_full_update.pl '../$(STAGE_DIR)/previous.mar') && \ michael@0: (cd current; \ michael@0: MAR=$(MAR_BIN) perl $(topsrcdir)/tools/update-packaging/unwrap_full_update.pl '../$(DIST)/$(COMPLETE_MAR)') && \ michael@0: find current -name \*.pgc -print -delete && \ michael@0: find previous -name \*.pgc -print -delete && \ michael@0: rm -f $(STAGE_DIR)/*.partial.*.mar && \ michael@0: SRC_BUILD_ID=$$(python $(topsrcdir)/config/printconfigsetting.py $$(find previous -maxdepth 4 -type f -name application.ini) App BuildID) \ michael@0: DST_BUILD_ID=$$(cat $(DEPTH)/config/buildid) \ michael@0: SRC_BUILD=previous DST_BUILD=current \ michael@0: $(MAKE) partial-patch && \ michael@0: rm -f $(STAGE_DIR)/previous.mar; \ michael@0: else \ michael@0: echo "No previous MAR found; not creating a partial MAR"; \ michael@0: fi