DXR is a code search and navigation tool aimed at making sense of large projects. It supports full-text and regex searches as well as structural queries.

Mercurial (d1ed7de67f5a)

VCS Links

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
# vim:set ts=8 sw=8 sts=8 noet:
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

STANDALONE_MAKEFILE := 1

# input location for the build, usually $(DIST)
# set this to $(DIST)/l10n-stage per override for L10n builds
PACKAGE_BASE_DIR	= $(DIST)

# Default output location for update archive
STAGE_DIR	= $(DIST)/$(PKG_UPDATE_PATH)

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
ifdef UNIVERSAL_BINARY
ifneq (,$(filter %/l10n-stage,$(PACKAGE_BASE_DIR)))
PACKAGE_DIR	= $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME)
else
PACKAGE_DIR	= $(PACKAGE_BASE_DIR)/universal/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME)
endif
else
PACKAGE_DIR	= $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)/$(MOZ_MACBUNDLE_NAME)
endif
else
PACKAGE_DIR	= $(PACKAGE_BASE_DIR)/$(MOZ_PKG_DIR)
endif

MAR_BIN	= $(LIBXUL_DIST)/host/bin/mar$(HOST_BIN_SUFFIX)
MBSDIFF_BIN	= $(LIBXUL_DIST)/host/bin/mbsdiff$(HOST_BIN_SUFFIX)

OVERRIDE_DEFAULT_GOAL := full-update
full-update:: complete-patch $(if $(MOZ_AUTOMATION_UPDATE_PACKAGING),automation-partial-patch)

ifeq ($(OS_TARGET), WINNT)
MOZ_PKG_FORMAT	:= SFX7Z
UNPACKAGE	= '$(subst $(DIST),$(_ABS_DIST),$(INSTALLER_PACKAGE))'
ifdef AB_CD
UNPACKAGE	= '$(PACKAGE_BASE_DIR)/$(PACKAGE)'
endif
endif

include $(topsrcdir)/config/rules.mk
include $(topsrcdir)/toolkit/mozapps/installer/signing.mk
include $(topsrcdir)/toolkit/mozapps/installer/packager.mk

ifdef MOZ_EXTERNAL_SIGNING_FORMAT
# We can't use signcode on mar files
MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT))
MOZ_EXTERNAL_SIGNING_FORMAT := mar $(MOZ_EXTERNAL_SIGNING_FORMAT)
endif

dir-stage := $(call mkdir_deps,$(STAGE_DIR))

complete-patch:: $(dir-stage)
ifeq ($(OS_TARGET), WINNT)
	test -f $(UNPACKAGE)
	$(RM) -rf '$(PACKAGE_DIR)'
	cd $(PACKAGE_BASE_DIR) && $(INNER_UNMAKE_PACKAGE)
endif
	MAR=$(MAR_BIN) \
	  $(srcdir)/make_full_update.sh \
	  '$(DIST)/$(COMPLETE_MAR)' \
	  '$(PACKAGE_DIR)'
ifdef MOZ_SIGN_CMD
	$(MOZ_SIGN_CMD) -f mar '$(DIST)/$(COMPLETE_MAR)'
endif

partial-patch:: $(dir-stage)
	MAR=$(MAR_BIN) \
	MBSDIFF=$(MBSDIFF_BIN) \
	  $(srcdir)/make_incremental_update.sh \
	  '$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar' \
	  '$(SRC_BUILD)' \
	  '$(DST_BUILD)'
ifdef MOZ_SIGN_CMD
	$(MOZ_SIGN_CMD) -f mar '$(STAGE_DIR)/$(PKG_UPDATE_BASENAME).partial.$(SRC_BUILD_ID)-$(DST_BUILD_ID).mar'
endif

automation-partial-patch: complete-patch
	rm -rf current current.work previous
	mkdir current previous
	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'); \
	  if test -n "$$latestmar"; then \
	    wget -O $(STAGE_DIR)/previous.mar http://$(UPLOAD_HOST)/$(LATEST_MAR_DIR)/$$latestmar && \
	    (cd previous; \
	      MAR=$(MAR_BIN) perl $(topsrcdir)/tools/update-packaging/unwrap_full_update.pl '../$(STAGE_DIR)/previous.mar') && \
	    (cd current; \
	      MAR=$(MAR_BIN) perl $(topsrcdir)/tools/update-packaging/unwrap_full_update.pl '../$(DIST)/$(COMPLETE_MAR)') && \
	    find current -name \*.pgc -print -delete && \
	    find previous -name \*.pgc -print -delete && \
	    rm -f $(STAGE_DIR)/*.partial.*.mar && \
	    SRC_BUILD_ID=$$(python $(topsrcdir)/config/printconfigsetting.py $$(find previous -maxdepth 4 -type f -name application.ini) App BuildID) \
	    DST_BUILD_ID=$$(cat $(DEPTH)/config/buildid) \
	    SRC_BUILD=previous DST_BUILD=current \
	      $(MAKE) partial-patch && \
	    rm -f $(STAGE_DIR)/previous.mar; \
	  else \
	    echo "No previous MAR found; not creating a partial MAR"; \
	  fi