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: include $(MOZILLA_DIR)/toolkit/mozapps/installer/package-name.mk michael@0: michael@0: # This is how we create the binary packages we release to the public. michael@0: michael@0: ifndef MOZ_PKG_FORMAT michael@0: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) michael@0: MOZ_PKG_FORMAT = DMG michael@0: else michael@0: ifeq (,$(filter-out WINNT, $(OS_ARCH))) michael@0: MOZ_PKG_FORMAT = ZIP michael@0: else michael@0: ifeq (,$(filter-out SunOS, $(OS_ARCH))) michael@0: MOZ_PKG_FORMAT = BZ2 michael@0: else michael@0: ifeq (,$(filter-out gtk2 gtk3 qt, $(MOZ_WIDGET_TOOLKIT))) michael@0: MOZ_PKG_FORMAT = BZ2 michael@0: else michael@0: ifeq (android,$(MOZ_WIDGET_TOOLKIT)) michael@0: MOZ_PKG_FORMAT = APK michael@0: else michael@0: MOZ_PKG_FORMAT = TGZ michael@0: endif michael@0: endif michael@0: endif michael@0: endif michael@0: endif michael@0: endif # MOZ_PKG_FORMAT michael@0: michael@0: ifeq ($(OS_ARCH),WINNT) michael@0: INSTALLER_DIR = windows michael@0: endif michael@0: michael@0: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) michael@0: ifndef _APPNAME michael@0: _APPNAME = $(MOZ_MACBUNDLE_NAME) michael@0: endif michael@0: ifndef _BINPATH michael@0: _BINPATH = /$(_APPNAME)/Contents/MacOS michael@0: endif # _BINPATH michael@0: ifdef UNIVERSAL_BINARY michael@0: STAGEPATH = universal/ michael@0: endif michael@0: endif michael@0: michael@0: PACKAGE_BASE_DIR = $(_ABS_DIST) michael@0: PACKAGE = $(PKG_PATH)$(PKG_BASENAME)$(PKG_SUFFIX) michael@0: michael@0: # By default, the SDK uses the same packaging type as the main bundle, michael@0: # but on mac it is a .tar.bz2 michael@0: SDK_PATH = $(PKG_PATH) michael@0: ifeq ($(MOZ_APP_NAME),xulrunner) michael@0: SDK_PATH = sdk/ michael@0: # Don't codesign xulrunner internally michael@0: MOZ_INTERNAL_SIGNING_FORMAT = michael@0: endif michael@0: SDK_SUFFIX = $(PKG_SUFFIX) michael@0: SDK = $(SDK_PATH)$(PKG_BASENAME).sdk$(SDK_SUFFIX) michael@0: ifdef UNIVERSAL_BINARY michael@0: SDK = $(SDK_PATH)$(PKG_BASENAME)-$(TARGET_CPU).sdk$(SDK_SUFFIX) michael@0: endif michael@0: michael@0: # JavaScript Shell packaging michael@0: ifndef LIBXUL_SDK michael@0: JSSHELL_BINS = \ michael@0: $(DIST)/bin/js$(BIN_SUFFIX) \ michael@0: $(DIST)/bin/$(DLL_PREFIX)mozglue$(DLL_SUFFIX) \ michael@0: $(NULL) michael@0: ifndef MOZ_NATIVE_NSPR michael@0: ifeq ($(_MSC_VER),1400) michael@0: JSSHELL_BINS += $(DIST)/bin/Microsoft.VC80.CRT.manifest michael@0: JSSHELL_BINS += $(DIST)/bin/msvcr80.dll michael@0: JSSHELL_BINS += $(DIST)/bin/msvcp80.dll michael@0: endif michael@0: ifeq ($(_MSC_VER),1500) michael@0: JSSHELL_BINS += $(DIST)/bin/Microsoft.VC90.CRT.manifest michael@0: JSSHELL_BINS += $(DIST)/bin/msvcr90.dll michael@0: JSSHELL_BINS += $(DIST)/bin/msvcp90.dll michael@0: endif michael@0: ifeq ($(_MSC_VER),1600) michael@0: JSSHELL_BINS += $(DIST)/bin/msvcr100.dll michael@0: JSSHELL_BINS += $(DIST)/bin/msvcp100.dll michael@0: endif michael@0: ifeq ($(_MSC_VER),1700) michael@0: JSSHELL_BINS += $(DIST)/bin/msvcr110.dll michael@0: JSSHELL_BINS += $(DIST)/bin/msvcp110.dll michael@0: endif michael@0: ifeq ($(_MSC_VER),1800) michael@0: JSSHELL_BINS += $(DIST)/bin/msvcr120.dll michael@0: JSSHELL_BINS += $(DIST)/bin/msvcp120.dll michael@0: endif michael@0: ifdef MOZ_FOLD_LIBS michael@0: JSSHELL_BINS += $(DIST)/bin/$(DLL_PREFIX)nss3$(DLL_SUFFIX) michael@0: else michael@0: JSSHELL_BINS += \ michael@0: $(DIST)/bin/$(DLL_PREFIX)nspr4$(DLL_SUFFIX) \ michael@0: $(DIST)/bin/$(DLL_PREFIX)plds4$(DLL_SUFFIX) \ michael@0: $(DIST)/bin/$(DLL_PREFIX)plc4$(DLL_SUFFIX) \ michael@0: $(NULL) michael@0: endif # MOZ_FOLD_LIBS michael@0: endif # MOZ_NATIVE_NSPR michael@0: ifdef MOZ_SHARED_ICU michael@0: ifeq ($(OS_TARGET), WINNT) michael@0: ifdef MOZ_DEBUG michael@0: JSSHELL_BINS += \ michael@0: $(DIST)/bin/icudtd$(MOZ_ICU_VERSION).dll \ michael@0: $(DIST)/bin/icuind$(MOZ_ICU_VERSION).dll \ michael@0: $(DIST)/bin/icuucd$(MOZ_ICU_VERSION).dll \ michael@0: $(NULL) michael@0: else michael@0: JSSHELL_BINS += \ michael@0: $(DIST)/bin/icudt$(MOZ_ICU_VERSION).dll \ michael@0: $(DIST)/bin/icuin$(MOZ_ICU_VERSION).dll \ michael@0: $(DIST)/bin/icuuc$(MOZ_ICU_VERSION).dll \ michael@0: $(NULL) michael@0: endif # MOZ_DEBUG michael@0: else michael@0: ifeq ($(OS_TARGET), Darwin) michael@0: JSSHELL_BINS += \ michael@0: $(DIST)/bin/libicudata.$(MOZ_ICU_VERSION).dylib \ michael@0: $(DIST)/bin/libicui18n.$(MOZ_ICU_VERSION).dylib \ michael@0: $(DIST)/bin/libicuuc.$(MOZ_ICU_VERSION).dylib \ michael@0: $(NULL) michael@0: else michael@0: JSSHELL_BINS += \ michael@0: $(DIST)/bin/libicudata.so.$(MOZ_ICU_VERSION) \ michael@0: $(DIST)/bin/libicui18n.so.$(MOZ_ICU_VERSION) \ michael@0: $(DIST)/bin/libicuuc.so.$(MOZ_ICU_VERSION) \ michael@0: $(NULL) michael@0: endif # Darwin michael@0: endif # WINNT michael@0: endif # MOZ_STATIC_JS michael@0: MAKE_JSSHELL = $(PYTHON) $(topsrcdir)/toolkit/mozapps/installer/dozip.py $(PKG_JSSHELL) $(abspath $(JSSHELL_BINS)) michael@0: endif # LIBXUL_SDK michael@0: michael@0: _ABS_DIST = $(abspath $(DIST)) michael@0: JARLOG_DIR = $(abspath $(DEPTH)/jarlog/) michael@0: JARLOG_FILE_AB_CD = $(JARLOG_DIR)/$(AB_CD).log michael@0: michael@0: TAR_CREATE_FLAGS := --exclude=.mkdir.done $(TAR_CREATE_FLAGS) michael@0: CREATE_FINAL_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \ michael@0: --mode=go-w --exclude=.mkdir.done -f michael@0: UNPACK_TAR = tar -xf- michael@0: michael@0: ifeq ($(MOZ_PKG_FORMAT),TAR) michael@0: PKG_SUFFIX = .tar michael@0: INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) > $(PACKAGE) michael@0: INNER_UNMAKE_PACKAGE = $(UNPACK_TAR) < $(UNPACKAGE) michael@0: MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk > $(SDK) michael@0: endif michael@0: ifeq ($(MOZ_PKG_FORMAT),TGZ) michael@0: PKG_SUFFIX = .tar.gz michael@0: INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) | gzip -vf9 > $(PACKAGE) michael@0: INNER_UNMAKE_PACKAGE = gunzip -c $(UNPACKAGE) | $(UNPACK_TAR) michael@0: MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | gzip -vf9 > $(SDK) michael@0: endif michael@0: ifeq ($(MOZ_PKG_FORMAT),BZ2) michael@0: PKG_SUFFIX = .tar.bz2 michael@0: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) michael@0: INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - -C $(STAGEPATH)$(MOZ_PKG_DIR) $(_APPNAME) | bzip2 -vf > $(PACKAGE) michael@0: else michael@0: INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) | bzip2 -vf > $(PACKAGE) michael@0: endif michael@0: INNER_UNMAKE_PACKAGE = bunzip2 -c $(UNPACKAGE) | $(UNPACK_TAR) michael@0: MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK) michael@0: endif michael@0: ifeq ($(MOZ_PKG_FORMAT),ZIP) michael@0: ifdef MOZ_EXTERNAL_SIGNING_FORMAT michael@0: # We can't use signcode on zip files michael@0: MOZ_EXTERNAL_SIGNING_FORMAT := $(filter-out signcode,$(MOZ_EXTERNAL_SIGNING_FORMAT)) michael@0: endif michael@0: PKG_SUFFIX = .zip michael@0: INNER_MAKE_PACKAGE = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_DIR) \ michael@0: -x \*/.mkdir.done michael@0: INNER_UNMAKE_PACKAGE = $(UNZIP) $(UNPACKAGE) michael@0: MAKE_SDK = $(ZIP) -r9D $(SDK) $(MOZ_APP_NAME)-sdk michael@0: endif michael@0: ifeq ($(MOZ_PKG_FORMAT),SFX7Z) michael@0: PKG_SUFFIX = .exe michael@0: INNER_MAKE_PACKAGE = rm -f app.7z && \ michael@0: mv $(MOZ_PKG_DIR) core && \ michael@0: $(CYGWIN_WRAPPER) 7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d25 \ michael@0: -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3 && \ michael@0: mv core $(MOZ_PKG_DIR) && \ michael@0: cat $(SFX_HEADER) app.7z > $(PACKAGE) && \ michael@0: chmod 0755 $(PACKAGE) michael@0: INNER_UNMAKE_PACKAGE = $(CYGWIN_WRAPPER) 7z x $(UNPACKAGE) core && \ michael@0: mv core $(MOZ_PKG_DIR) michael@0: endif michael@0: michael@0: #Create an RPM file michael@0: ifeq ($(MOZ_PKG_FORMAT),RPM) michael@0: PKG_SUFFIX = .rpm michael@0: MOZ_NUMERIC_APP_VERSION = $(shell echo $(MOZ_PKG_VERSION) | sed 's/[^0-9.].*//' ) michael@0: MOZ_RPM_RELEASE = $(shell echo $(MOZ_PKG_VERSION) | sed 's/[0-9.]*//' ) michael@0: michael@0: RPMBUILD_TOPDIR=$(_ABS_DIST)/rpmbuild michael@0: RPMBUILD_RPMDIR=$(_ABS_DIST) michael@0: RPMBUILD_SRPMDIR=$(_ABS_DIST) michael@0: RPMBUILD_SOURCEDIR=$(RPMBUILD_TOPDIR)/SOURCES michael@0: RPMBUILD_SPECDIR=$(topsrcdir)/toolkit/mozapps/installer/linux/rpm michael@0: RPMBUILD_BUILDDIR=$(_ABS_DIST)/.. michael@0: michael@0: SPEC_FILE = $(RPMBUILD_SPECDIR)/mozilla.spec michael@0: RPM_INCIDENTALS=$(topsrcdir)/toolkit/mozapps/installer/linux/rpm michael@0: michael@0: RPM_CMD = \ michael@0: echo Creating RPM && \ michael@0: $(PYTHON) -m mozbuild.action.preprocessor \ michael@0: -DMOZ_APP_NAME=$(MOZ_APP_NAME) \ michael@0: -DMOZ_APP_DISPLAYNAME='$(MOZ_APP_DISPLAYNAME)' \ michael@0: $(RPM_INCIDENTALS)/mozilla.desktop \ michael@0: -o $(RPMBUILD_SOURCEDIR)/$(MOZ_APP_NAME).desktop && \ michael@0: rm -rf $(_ABS_DIST)/$(TARGET_CPU) && \ michael@0: $(RPMBUILD) -bb \ michael@0: $(SPEC_FILE) \ michael@0: --target $(TARGET_CPU) \ michael@0: --buildroot $(RPMBUILD_TOPDIR)/BUILDROOT \ michael@0: --define 'moz_app_name $(MOZ_APP_NAME)' \ michael@0: --define 'moz_app_displayname $(MOZ_APP_DISPLAYNAME)' \ michael@0: --define 'moz_app_version $(MOZ_APP_VERSION)' \ michael@0: --define 'moz_numeric_app_version $(MOZ_NUMERIC_APP_VERSION)' \ michael@0: --define 'moz_rpm_release $(MOZ_RPM_RELEASE)' \ michael@0: --define 'buildid $(BUILDID)' \ michael@0: --define 'moz_source_repo $(MOZ_SOURCE_REPO)' \ michael@0: --define 'moz_source_stamp $(MOZ_SOURCE_STAMP)' \ michael@0: --define 'moz_branding_directory $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)' \ michael@0: --define '_topdir $(RPMBUILD_TOPDIR)' \ michael@0: --define '_rpmdir $(RPMBUILD_RPMDIR)' \ michael@0: --define '_sourcedir $(RPMBUILD_SOURCEDIR)' \ michael@0: --define '_specdir $(RPMBUILD_SPECDIR)' \ michael@0: --define '_srcrpmdir $(RPMBUILD_SRPMDIR)' \ michael@0: --define '_builddir $(RPMBUILD_BUILDDIR)' \ michael@0: --define '_prefix $(prefix)' \ michael@0: --define '_libdir $(libdir)' \ michael@0: --define '_bindir $(bindir)' \ michael@0: --define '_datadir $(datadir)' \ michael@0: --define '_installdir $(installdir)' michael@0: michael@0: ifdef ENABLE_TESTS michael@0: RPM_CMD += \ michael@0: --define 'createtests yes' \ michael@0: --define '_testsinstalldir $(shell basename $(installdir))' michael@0: endif michael@0: michael@0: ifdef INSTALL_SDK michael@0: RPM_CMD += \ michael@0: --define 'createdevel yes' \ michael@0: --define '_idldir $(idldir)' \ michael@0: --define '_sdkdir $(sdkdir)' \ michael@0: --define '_includedir $(includedir)' michael@0: endif michael@0: michael@0: #For each of the main, tests, sdk rpms we want to make sure that michael@0: #if they exist that they are in objdir/dist/ and that they get michael@0: #uploaded and that they are beside the other build artifacts michael@0: MAIN_RPM= $(MOZ_APP_NAME)-$(MOZ_NUMERIC_APP_VERSION)-$(MOZ_RPM_RELEASE).$(BUILDID).$(TARGET_CPU)$(PKG_SUFFIX) michael@0: UPLOAD_EXTRA_FILES += $(MAIN_RPM) michael@0: RPM_CMD += && mv $(TARGET_CPU)/$(MAIN_RPM) $(_ABS_DIST)/ michael@0: michael@0: ifdef ENABLE_TESTS michael@0: TESTS_RPM=$(MOZ_APP_NAME)-tests-$(MOZ_NUMERIC_APP_VERSION)-$(MOZ_RPM_RELEASE).$(BUILDID).$(TARGET_CPU)$(PKG_SUFFIX) michael@0: UPLOAD_EXTRA_FILES += $(TESTS_RPM) michael@0: RPM_CMD += && mv $(TARGET_CPU)/$(TESTS_RPM) $(_ABS_DIST)/ michael@0: endif michael@0: michael@0: ifdef INSTALL_SDK michael@0: SDK_RPM=$(MOZ_APP_NAME)-devel-$(MOZ_NUMERIC_APP_VERSION)-$(MOZ_RPM_RELEASE).$(BUILDID).$(TARGET_CPU)$(PKG_SUFFIX) michael@0: UPLOAD_EXTRA_FILES += $(SDK_RPM) michael@0: RPM_CMD += && mv $(TARGET_CPU)/$(SDK_RPM) $(_ABS_DIST)/ michael@0: endif michael@0: michael@0: INNER_MAKE_PACKAGE = $(RPM_CMD) michael@0: #Avoiding rpm repacks, going to try creating/uploading xpi in rpm files instead michael@0: INNER_UNMAKE_PACKAGE = $(error Try using rpm2cpio and cpio) michael@0: michael@0: endif #Create an RPM file michael@0: michael@0: michael@0: ifeq ($(MOZ_PKG_FORMAT),APK) michael@0: michael@0: JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar michael@0: include $(MOZILLA_DIR)/config/android-common.mk michael@0: michael@0: # DEBUG_JARSIGNER is defined by android-common.mk and always debug michael@0: # signs. We want to release sign if possible. michael@0: ifdef MOZ_SIGN_CMD michael@0: RELEASE_JARSIGNER := $(MOZ_SIGN_CMD) -f jar michael@0: else michael@0: RELEASE_JARSIGNER := $(DEBUG_JARSIGNER) michael@0: endif michael@0: michael@0: DIST_FILES = michael@0: michael@0: # Place the files in the order they are going to be opened by the linker michael@0: DIST_FILES += libmozalloc.so michael@0: ifndef MOZ_FOLD_LIBS michael@0: DIST_FILES += \ michael@0: libnspr4.so \ michael@0: libplc4.so \ michael@0: libplds4.so \ michael@0: libmozsqlite3.so \ michael@0: libnssutil3.so \ michael@0: $(NULL) michael@0: endif michael@0: DIST_FILES += libnss3.so michael@0: ifndef MOZ_FOLD_LIBS michael@0: DIST_FILES += \ michael@0: libssl3.so \ michael@0: libsmime3.so \ michael@0: $(NULL) michael@0: endif michael@0: DIST_FILES += \ michael@0: libxul.so \ michael@0: libnssckbi.so \ michael@0: libfreebl3.so \ michael@0: libsoftokn3.so \ michael@0: resources.arsc \ michael@0: AndroidManifest.xml \ michael@0: chrome \ michael@0: components \ michael@0: defaults \ michael@0: modules \ michael@0: hyphenation \ michael@0: res \ michael@0: lib \ michael@0: extensions \ michael@0: application.ini \ michael@0: package-name.txt \ michael@0: platform.ini \ michael@0: greprefs.js \ michael@0: browserconfig.properties \ michael@0: blocklist.xml \ michael@0: chrome.manifest \ michael@0: update.locale \ michael@0: removed-files \ michael@0: distribution \ michael@0: $(NULL) michael@0: michael@0: NON_DIST_FILES = \ michael@0: classes.dex \ michael@0: $(NULL) michael@0: michael@0: UPLOAD_EXTRA_FILES += gecko-unsigned-unaligned.apk michael@0: michael@0: DIST_FILES += $(MOZ_CHILD_PROCESS_NAME) michael@0: michael@0: GECKO_APP_AP_PATH = $(abspath $(DEPTH)/mobile/android/base) michael@0: michael@0: ifdef ENABLE_TESTS michael@0: INNER_ROBOCOP_PACKAGE=echo michael@0: INNER_BACKGROUND_TESTS_PACKAGE=echo michael@0: ifeq ($(MOZ_BUILD_APP),mobile/android) michael@0: UPLOAD_EXTRA_FILES += robocop.apk michael@0: UPLOAD_EXTRA_FILES += fennec_ids.txt michael@0: UPLOAD_EXTRA_FILES += geckoview_library/geckoview_library.zip michael@0: UPLOAD_EXTRA_FILES += geckoview_library/geckoview_assets.zip michael@0: UPLOAD_EXTRA_FILES += ../embedding/android/geckoview_example/geckoview_example.apk michael@0: michael@0: # Robocop/Robotium tests, Android Background tests, and Fennec need to michael@0: # be signed with the same key, which means release signing them all. michael@0: michael@0: # $(1) is the full path to input: foo-debug-unsigned-unaligned.apk. michael@0: # $(2) is the full path to output: foo.apk. michael@0: RELEASE_SIGN_ANDROID_APK = \ michael@0: cp $(1) $(2)-unaligned.apk && \ michael@0: $(RELEASE_JARSIGNER) $(2)-unaligned.apk && \ michael@0: $(ZIPALIGN) -f -v 4 $(2)-unaligned.apk $(2) && \ michael@0: $(RM) $(2)-unaligned.apk michael@0: michael@0: ROBOCOP_PATH = $(abspath $(_ABS_DIST)/../build/mobile/robocop) michael@0: # Normally, $(NSINSTALL) would be used instead of cp, but INNER_ROBOCOP_PACKAGE michael@0: # is used in a series of commands that run under a "cd something", while michael@0: # $(NSINSTALL) is relative. michael@0: INNER_ROBOCOP_PACKAGE= \ michael@0: cp $(GECKO_APP_AP_PATH)/fennec_ids.txt $(_ABS_DIST) && \ michael@0: $(call RELEASE_SIGN_ANDROID_APK,$(ROBOCOP_PATH)/robocop-debug-unsigned-unaligned.apk,$(_ABS_DIST)/robocop.apk) michael@0: michael@0: BACKGROUND_TESTS_PATH = $(abspath $(_ABS_DIST)/../mobile/android/tests/background/junit3) michael@0: INNER_BACKGROUND_TESTS_PACKAGE= \ michael@0: $(call RELEASE_SIGN_ANDROID_APK,$(BACKGROUND_TESTS_PATH)/background-junit3-debug-unsigned-unaligned.apk,$(_ABS_DIST)/background-junit3.apk) michael@0: michael@0: BROWSER_TESTS_PATH = $(abspath $(_ABS_DIST)/../mobile/android/tests/browser/junit3) michael@0: INNER_BROWSER_TESTS_PACKAGE= \ michael@0: $(call RELEASE_SIGN_ANDROID_APK,$(BROWSER_TESTS_PATH)/browser-junit3-debug-unsigned-unaligned.apk,$(_ABS_DIST)/browser-junit3.apk) michael@0: endif michael@0: else michael@0: INNER_ROBOCOP_PACKAGE=echo 'Testing is disabled - No Android Robocop for you' michael@0: INNER_BACKGROUND_TESTS_PACKAGE=echo 'Testing is disabled - No Android Background JUnit 3 tests for you' michael@0: INNER_BROWSER_TESTS_PACKAGE=echo 'Testing is disabled - No Android Browser JUnit 3tests for you' michael@0: endif michael@0: michael@0: # Create geckoview_library/geckoview_{assets,library}.zip for third-party GeckoView consumers. michael@0: ifdef NIGHTLY_BUILD michael@0: ifndef MOZ_DISABLE_GECKOVIEW michael@0: INNER_MAKE_GECKOVIEW_LIBRARY= \ michael@0: $(MAKE) -C ../mobile/android/geckoview_library package michael@0: INNER_MAKE_GECKOVIEW_EXAMPLE= \ michael@0: $(MAKE) -C ../embedding/android/geckoview_example package michael@0: else michael@0: INNER_MAKE_GECKOVIEW_LIBRARY=echo 'GeckoView library packaging is disabled' michael@0: INNER_MAKE_GECKOVIEW_EXAMPLE=echo 'GeckoView example packaging is disabled' michael@0: endif michael@0: else michael@0: INNER_MAKE_GECKOVIEW_LIBRARY=echo 'GeckoView library packaging is only enabled on Nightly' michael@0: INNER_MAKE_GECKOVIEW_EXAMPLE=echo 'GeckoView example packaging is only enabled on Nightly' michael@0: endif michael@0: michael@0: ifdef MOZ_OMX_PLUGIN michael@0: DIST_FILES += libomxplugin.so libomxplugingb.so libomxplugingb235.so \ michael@0: libomxpluginhc.so libomxpluginfroyo.so libomxpluginkk.so michael@0: endif michael@0: michael@0: SO_LIBRARIES := $(filter %.so,$(DIST_FILES)) michael@0: # These libraries are placed in the assets/ directory by packager.py. michael@0: ASSET_SO_LIBRARIES := $(addprefix assets/,$(filter-out libmozglue.so $(MOZ_CHILD_PROCESS_NAME),$(SO_LIBRARIES))) michael@0: michael@0: DIST_FILES := $(filter-out $(SO_LIBRARIES),$(DIST_FILES)) michael@0: NON_DIST_FILES += libmozglue.so $(MOZ_CHILD_PROCESS_NAME) $(ASSET_SO_LIBRARIES) michael@0: michael@0: ifdef MOZ_ENABLE_SZIP michael@0: # These libraries are szipped in-place in the assets/ directory. michael@0: SZIP_LIBRARIES := $(ASSET_SO_LIBRARIES) michael@0: endif michael@0: michael@0: # Fennec's OMNIJAR_NAME can include a directory; for example, it might michael@0: # be "assets/omni.ja". This path specifies where the omni.ja file michael@0: # lives in the APK, but should not root the resources it contains michael@0: # under assets/ (i.e., resources should not live at chrome://assets/). michael@0: # packager.py writes /omni.ja in order to be consistent with the michael@0: # layout expected by language repacks. Therefore, we move it to the michael@0: # correct path here, in INNER_MAKE_PACKAGE. See comment about michael@0: # OMNIJAR_NAME in configure.in. michael@0: michael@0: # OMNIJAR_DIR is './' for "omni.ja", 'assets/' for "assets/omni.ja". michael@0: OMNIJAR_DIR := $(dir $(OMNIJAR_NAME)) michael@0: OMNIJAR_NAME := $(notdir $(OMNIJAR_NAME)) michael@0: michael@0: # We force build an ap_ that does not check dependencies below. michael@0: # Language repacks take advantage of this unchecked dependency ap_ to michael@0: # insert additional resources (translated strings) into the ap_ michael@0: # without the build system's participation. This can do the wrong michael@0: # thing if there are resource changes in between build time and michael@0: # package time. We try to prevent mismatched resources by erroring michael@0: # out if the compiled resource IDs are not the same as the resource michael@0: # IDs being packaged. If we're doing a single locale repack, however, michael@0: # we don't have a complete object directory, so we can't compare michael@0: # resource IDs. michael@0: michael@0: # A note on the res/ directory. We unzip the ap_ during packaging, michael@0: # which produces the res/ directory. This directory is then included michael@0: # in the final package. When we unpack (during locale repacks), we michael@0: # need to remove the res/ directory because these resources confuse michael@0: # the l10n packaging script that updates omni.ja: the script tries to michael@0: # localize the contents of the res/ directory, which fails. Instead, michael@0: # after the l10n packaging script completes, we build the ap_ michael@0: # described above (which includes freshly localized Android resources) michael@0: # and the res/ directory is taken from the ap_ as part of the regular michael@0: # packaging. michael@0: michael@0: PKG_SUFFIX = .apk michael@0: INNER_MAKE_PACKAGE = \ michael@0: $(if $(ALREADY_SZIPPED),,$(foreach lib,$(SZIP_LIBRARIES),host/bin/szip $(MOZ_SZIP_FLAGS) $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/$(lib) && )) \ michael@0: make -C $(GECKO_APP_AP_PATH) gecko-nodeps.ap_ && \ michael@0: cp $(GECKO_APP_AP_PATH)/gecko-nodeps.ap_ $(_ABS_DIST)/gecko.ap_ && \ michael@0: ( (test ! -f $(GECKO_APP_AP_PATH)/R.txt && echo "*** Warning: The R.txt that is being packaged might not agree with the R.txt that was built. This is normal during l10n repacks.") || \ michael@0: diff $(GECKO_APP_AP_PATH)/R.txt $(GECKO_APP_AP_PATH)/gecko-nodeps/R.txt >/dev/null || \ michael@0: (echo "*** Error: The R.txt that was built and the R.txt that is being packaged are not the same. Rebuild mobile/android/base and re-package." && exit 1)) && \ michael@0: ( cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && \ michael@0: mkdir -p lib/$(ANDROID_CPU_ARCH) && \ michael@0: mv libmozglue.so $(MOZ_CHILD_PROCESS_NAME) lib/$(ANDROID_CPU_ARCH) && \ michael@0: unzip -o $(_ABS_DIST)/gecko.ap_ && \ michael@0: rm $(_ABS_DIST)/gecko.ap_ && \ michael@0: $(ZIP) $(if $(MOZ_ENABLE_SZIP),-0 )$(_ABS_DIST)/gecko.ap_ $(ASSET_SO_LIBRARIES) && \ michael@0: $(ZIP) -r9D $(_ABS_DIST)/gecko.ap_ $(DIST_FILES) -x $(NON_DIST_FILES) $(SZIP_LIBRARIES) && \ michael@0: $(if $(filter-out ./,$(OMNIJAR_DIR)), \ michael@0: mkdir -p $(OMNIJAR_DIR) && mv $(OMNIJAR_NAME) $(OMNIJAR_DIR) && ) \ michael@0: $(ZIP) -0 $(_ABS_DIST)/gecko.ap_ $(OMNIJAR_DIR)$(OMNIJAR_NAME)) && \ michael@0: rm -f $(_ABS_DIST)/gecko.apk && \ michael@0: cp $(_ABS_DIST)/gecko.ap_ $(_ABS_DIST)/gecko.apk && \ michael@0: $(ZIP) -j0 $(_ABS_DIST)/gecko.apk $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/classes.dex && \ michael@0: cp $(_ABS_DIST)/gecko.apk $(_ABS_DIST)/gecko-unsigned-unaligned.apk && \ michael@0: $(RELEASE_JARSIGNER) $(_ABS_DIST)/gecko.apk && \ michael@0: $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/gecko.apk $(PACKAGE) && \ michael@0: $(INNER_ROBOCOP_PACKAGE) && \ michael@0: $(INNER_BACKGROUND_TESTS_PACKAGE) && \ michael@0: $(INNER_BROWSER_TESTS_PACKAGE) && \ michael@0: $(INNER_MAKE_GECKOVIEW_LIBRARY) && \ michael@0: $(INNER_MAKE_GECKOVIEW_EXAMPLE) michael@0: michael@0: # Language repacks root the resources contained in assets/omni.ja michael@0: # under assets/, but the repacks expect them to be rooted at /. michael@0: # Therefore, we we move the omnijar back to / so the resources are michael@0: # under the root here, in INNER_UNMAKE_PACKAGE. See comments about michael@0: # OMNIJAR_NAME earlier in this file and in configure.in. michael@0: michael@0: INNER_UNMAKE_PACKAGE = \ michael@0: mkdir $(MOZ_PKG_DIR) && \ michael@0: ( cd $(MOZ_PKG_DIR) && \ michael@0: $(UNZIP) $(UNPACKAGE) && \ michael@0: mv lib/$(ANDROID_CPU_ARCH)/libmozglue.so . && \ michael@0: mv lib/$(ANDROID_CPU_ARCH)/*plugin-container* $(MOZ_CHILD_PROCESS_NAME) && \ michael@0: rm -rf lib/$(ANDROID_CPU_ARCH) && \ michael@0: rm -rf res \ michael@0: $(if $(filter-out ./,$(OMNIJAR_DIR)), \ michael@0: && mv $(OMNIJAR_DIR)$(OMNIJAR_NAME) $(OMNIJAR_NAME)) ) michael@0: endif michael@0: michael@0: ifeq ($(MOZ_PKG_FORMAT),DMG) michael@0: PKG_SUFFIX = .dmg michael@0: PKG_DMG_FLAGS = michael@0: ifneq (,$(MOZ_PKG_MAC_DSSTORE)) michael@0: PKG_DMG_FLAGS += --copy '$(MOZ_PKG_MAC_DSSTORE):/.DS_Store' michael@0: endif michael@0: ifneq (,$(MOZ_PKG_MAC_BACKGROUND)) michael@0: PKG_DMG_FLAGS += --mkdir /.background --copy '$(MOZ_PKG_MAC_BACKGROUND):/.background' michael@0: endif michael@0: ifneq (,$(MOZ_PKG_MAC_ICON)) michael@0: PKG_DMG_FLAGS += --icon '$(MOZ_PKG_MAC_ICON)' michael@0: endif michael@0: ifneq (,$(MOZ_PKG_MAC_RSRC)) michael@0: PKG_DMG_FLAGS += --resource '$(MOZ_PKG_MAC_RSRC)' michael@0: endif michael@0: ifneq (,$(MOZ_PKG_MAC_EXTRA)) michael@0: PKG_DMG_FLAGS += $(MOZ_PKG_MAC_EXTRA) michael@0: endif michael@0: _ABS_MOZSRCDIR = $(shell cd $(MOZILLA_DIR) && pwd) michael@0: ifndef PKG_DMG_SOURCE michael@0: PKG_DMG_SOURCE = $(STAGEPATH)$(MOZ_PKG_DIR) michael@0: endif michael@0: INNER_MAKE_PACKAGE = $(_ABS_MOZSRCDIR)/build/package/mac_osx/pkg-dmg \ michael@0: --source '$(PKG_DMG_SOURCE)' --target '$(PACKAGE)' \ michael@0: --volname '$(MOZ_APP_DISPLAYNAME)' $(PKG_DMG_FLAGS) michael@0: INNER_UNMAKE_PACKAGE = \ michael@0: set -ex; \ michael@0: rm -rf $(_ABS_DIST)/unpack.tmp; \ michael@0: mkdir -p $(_ABS_DIST)/unpack.tmp; \ michael@0: $(_ABS_MOZSRCDIR)/build/package/mac_osx/unpack-diskimage $(UNPACKAGE) /tmp/$(MOZ_PKG_APPNAME)-unpack $(_ABS_DIST)/unpack.tmp; \ michael@0: rsync -a '$(_ABS_DIST)/unpack.tmp/$(_APPNAME)' $(MOZ_PKG_DIR); \ michael@0: test -n '$(MOZ_PKG_MAC_DSSTORE)' && \ michael@0: rsync -a '$(_ABS_DIST)/unpack.tmp/.DS_Store' '$(MOZ_PKG_MAC_DSSTORE)'; \ michael@0: test -n '$(MOZ_PKG_MAC_BACKGROUND)' && \ michael@0: rsync -a '$(_ABS_DIST)/unpack.tmp/.background/$(notdir $(MOZ_PKG_MAC_BACKGROUND))' '$(MOZ_PKG_MAC_BACKGROUND)'; \ michael@0: test -n '$(MOZ_PKG_MAC_ICON)' && \ michael@0: rsync -a '$(_ABS_DIST)/unpack.tmp/.VolumeIcon.icns' '$(MOZ_PKG_MAC_ICON)'; \ michael@0: rm -rf $(_ABS_DIST)/unpack.tmp; \ michael@0: if test -n '$(MOZ_PKG_MAC_RSRC)' ; then \ michael@0: cp $(UNPACKAGE) $(MOZ_PKG_APPNAME).tmp.dmg && \ michael@0: hdiutil unflatten $(MOZ_PKG_APPNAME).tmp.dmg && \ michael@0: { /Developer/Tools/DeRez -skip plst -skip blkx $(MOZ_PKG_APPNAME).tmp.dmg > '$(MOZ_PKG_MAC_RSRC)' || { rm -f $(MOZ_PKG_APPNAME).tmp.dmg && false; }; } && \ michael@0: rm -f $(MOZ_PKG_APPNAME).tmp.dmg; \ michael@0: fi michael@0: # The plst and blkx resources are skipped because they belong to each michael@0: # individual dmg and are created by hdiutil. michael@0: SDK_SUFFIX = .tar.bz2 michael@0: SDK = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX) michael@0: ifeq ($(MOZ_APP_NAME),xulrunner) michael@0: SDK = $(SDK_PATH)$(MOZ_APP_NAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX) michael@0: endif michael@0: MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK) michael@0: endif michael@0: michael@0: ifdef MOZ_INTERNAL_SIGNING_FORMAT michael@0: MOZ_SIGN_PREPARED_PACKAGE_CMD=$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_INTERNAL_SIGNING_FORMAT),-f $(f)) $(foreach i,$(SIGN_INCLUDES),-i $(i)) $(foreach x,$(SIGN_EXCLUDES),-x $(x)) michael@0: ifeq (WINNT,$(OS_ARCH)) michael@0: MOZ_SIGN_PREPARED_PACKAGE_CMD += --nsscmd '$(_ABS_DIST)/bin/shlibsign$(BIN_SUFFIX) -v -i' michael@0: endif michael@0: endif michael@0: michael@0: # For final GPG / authenticode signing / dmg signing if required michael@0: ifdef MOZ_EXTERNAL_SIGNING_FORMAT michael@0: MOZ_SIGN_PACKAGE_CMD=$(MOZ_SIGN_CMD) $(foreach f,$(MOZ_EXTERNAL_SIGNING_FORMAT),-f $(f)) michael@0: endif michael@0: michael@0: ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD michael@0: ifeq (Darwin, $(OS_ARCH)) michael@0: MAKE_PACKAGE = cd ./$(PKG_DMG_SOURCE) && $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(MOZ_MACBUNDLE_NAME) \ michael@0: && rm $(MOZ_MACBUNDLE_NAME)/Contents/CodeResources \ michael@0: && cp $(MOZ_MACBUNDLE_NAME)/Contents/_CodeSignature/CodeResources $(MOZ_MACBUNDLE_NAME)/Contents \ michael@0: && cd $(PACKAGE_BASE_DIR) \ michael@0: && $(INNER_MAKE_PACKAGE) michael@0: else michael@0: MAKE_PACKAGE = $(MOZ_SIGN_PREPARED_PACKAGE_CMD) \ michael@0: $(MOZ_PKG_DIR) && $(INNER_MAKE_PACKAGE) michael@0: endif #Darwin michael@0: michael@0: else michael@0: MAKE_PACKAGE = $(INNER_MAKE_PACKAGE) michael@0: endif michael@0: michael@0: ifdef MOZ_SIGN_PACKAGE_CMD michael@0: MAKE_PACKAGE += && $(MOZ_SIGN_PACKAGE_CMD) '$(PACKAGE)' michael@0: endif michael@0: michael@0: ifdef MOZ_SIGN_CMD michael@0: MAKE_SDK += && $(MOZ_SIGN_CMD) -f gpg $(SDK) michael@0: UPLOAD_EXTRA_FILES += $(SDK).asc michael@0: endif michael@0: michael@0: NO_PKG_FILES += \ michael@0: core \ michael@0: bsdecho \ michael@0: js \ michael@0: js-config \ michael@0: jscpucfg \ michael@0: nsinstall \ michael@0: viewer \ michael@0: TestGtkEmbed \ michael@0: elf-dynstr-gc \ michael@0: mangle* \ michael@0: maptsv* \ michael@0: mfc* \ michael@0: msdump* \ michael@0: msmap* \ michael@0: nm2tsv* \ michael@0: nsinstall* \ michael@0: res/samples \ michael@0: res/throbber \ michael@0: shlibsign* \ michael@0: ssltunnel* \ michael@0: certutil* \ michael@0: pk12util* \ michael@0: BadCertServer* \ michael@0: OCSPStaplingServer* \ michael@0: GenerateOCSPResponse* \ michael@0: winEmbed.exe \ michael@0: chrome/chrome.rdf \ michael@0: chrome/app-chrome.manifest \ michael@0: chrome/overlayinfo \ michael@0: components/compreg.dat \ michael@0: components/xpti.dat \ michael@0: content_unit_tests \ michael@0: necko_unit_tests \ michael@0: *.dSYM \ michael@0: $(NULL) michael@0: michael@0: # browser/locales/Makefile uses this makefile for its variable defs, but michael@0: # doesn't want the libs:: rule. michael@0: ifndef PACKAGER_NO_LIBS michael@0: libs:: make-package michael@0: endif michael@0: michael@0: DEFINES += -DDLL_PREFIX=$(DLL_PREFIX) -DDLL_SUFFIX=$(DLL_SUFFIX) -DBIN_SUFFIX=$(BIN_SUFFIX) michael@0: michael@0: ifdef MOZ_FOLD_LIBS michael@0: DEFINES += -DMOZ_FOLD_LIBS=1 michael@0: endif michael@0: michael@0: GARBAGE += $(DIST)/$(PACKAGE) $(PACKAGE) michael@0: michael@0: # The following target stages files into two directories: one directory for michael@0: # core files, and one for optional extensions based on the information in michael@0: # the MOZ_PKG_MANIFEST file. michael@0: michael@0: PKG_ARG = , '$(pkg)' michael@0: michael@0: installer-stage: prepare-package michael@0: ifndef MOZ_PKG_MANIFEST michael@0: $(error MOZ_PKG_MANIFEST unspecified!) michael@0: endif michael@0: @rm -rf $(DEPTH)/installer-stage $(DIST)/xpt michael@0: @echo 'Staging installer files...' michael@0: @$(NSINSTALL) -D $(DEPTH)/installer-stage/core michael@0: @cp -av $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/. $(DEPTH)/installer-stage/core michael@0: @(cd $(DEPTH)/installer-stage/core && $(CREATE_PRECOMPLETE_CMD)) michael@0: ifdef MOZ_SIGN_PREPARED_PACKAGE_CMD michael@0: # The && true is necessary to make sure Pymake spins a shell michael@0: $(MOZ_SIGN_PREPARED_PACKAGE_CMD) $(DEPTH)/installer-stage && true michael@0: endif michael@0: michael@0: ifeq (gonk,$(MOZ_WIDGET_TOOLKIT)) michael@0: ELF_HACK_FLAGS = --fill michael@0: endif michael@0: michael@0: # MOZ_PKG_MANIFEST is the canonical way to define the package manifest (which michael@0: # the packager will preprocess), but for a smooth transition, we derive it michael@0: # from the now deprecated MOZ_PKG_MANIFEST_P when MOZ_PKG_MANIFEST is not michael@0: # defined. michael@0: ifndef MOZ_PKG_MANIFEST michael@0: ifdef MOZ_PKG_MANIFEST_P michael@0: MOZ_PKG_MANIFEST := $(MOZ_PKG_MANIFEST_P) michael@0: endif # MOZ_PKG_MANIFEST_P michael@0: endif # MOZ_PKG_MANIFEST michael@0: michael@0: # For smooth transition of comm-central michael@0: ifndef MOZ_PACKAGER_FORMAT michael@0: ifeq ($(MOZ_CHROME_FILE_FORMAT),flat) michael@0: ifdef MOZ_OMNIJAR michael@0: MOZ_PACKAGER_FORMAT := omni michael@0: else michael@0: MOZ_PACKAGER_FORMAT := flat michael@0: endif michael@0: endif michael@0: endif michael@0: ifndef MOZ_PACKAGER_FORMAT michael@0: MOZ_PACKAGER_FORMAT = $(error MOZ_PACKAGER_FORMAT is not set) michael@0: endif michael@0: michael@0: ifneq (android,$(MOZ_WIDGET_TOOLKIT)) michael@0: OPTIMIZEJARS = 1 michael@0: endif michael@0: michael@0: export NO_PKG_FILES USE_ELF_HACK ELF_HACK_FLAGS michael@0: michael@0: # A js binary is needed to perform verification of JavaScript minification. michael@0: # We can only use the built binary when not cross-compiling. Environments michael@0: # (such as release automation) can provide their own js binary to enable michael@0: # verification when cross-compiling. michael@0: ifndef JS_BINARY michael@0: ifndef CROSS_COMPILE michael@0: JS_BINARY = $(wildcard $(DIST)/bin/js) michael@0: endif michael@0: endif michael@0: michael@0: # Override the value of OMNIJAR_NAME from config.status with the value michael@0: # set earlier in this file. michael@0: michael@0: stage-package: $(MOZ_PKG_MANIFEST) michael@0: @rm -rf $(DIST)/$(PKG_PATH)$(PKG_BASENAME).tar $(DIST)/$(PKG_PATH)$(PKG_BASENAME).dmg $@ $(EXCLUDE_LIST) michael@0: OMNIJAR_NAME=$(OMNIJAR_NAME) \ michael@0: $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/packager.py $(DEFINES) \ michael@0: --format $(MOZ_PACKAGER_FORMAT) \ michael@0: $(addprefix --removals ,$(MOZ_PKG_REMOVALS)) \ michael@0: $(if $(filter-out 0,$(MOZ_PKG_FATAL_WARNINGS)),,--ignore-errors) \ michael@0: $(if $(MOZ_PACKAGER_MINIFY),--minify) \ michael@0: $(if $(MOZ_PACKAGER_MINIFY_JS),--minify-js \ michael@0: $(addprefix --js-binary ,$(JS_BINARY)) \ michael@0: ) \ michael@0: $(if $(JARLOG_DIR),$(addprefix --jarlog ,$(wildcard $(JARLOG_FILE_AB_CD)))) \ michael@0: $(if $(OPTIMIZEJARS),--optimizejars) \ michael@0: $(addprefix --unify ,$(UNIFY_DIST)) \ michael@0: $(MOZ_PKG_MANIFEST) $(DIST) $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR)$(if $(MOZ_PKG_MANIFEST),,$(_BINPATH)) \ michael@0: $(if $(filter omni,$(MOZ_PACKAGER_FORMAT)),$(if $(NON_OMNIJAR_FILES),--non-resource $(NON_OMNIJAR_FILES))) michael@0: $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/find-dupes.py $(DIST)/$(STAGEPATH)$(MOZ_PKG_DIR) michael@0: ifndef LIBXUL_SDK michael@0: ifdef MOZ_PACKAGE_JSSHELL michael@0: # Package JavaScript Shell michael@0: @echo 'Packaging JavaScript Shell...' michael@0: $(RM) $(PKG_JSSHELL) michael@0: $(MAKE_JSSHELL) michael@0: endif # MOZ_PACKAGE_JSSHELL michael@0: endif # LIBXUL_SDK michael@0: michael@0: prepare-package: stage-package michael@0: michael@0: make-package-internal: prepare-package make-sourcestamp-file make-buildinfo-file michael@0: @echo 'Compressing...' michael@0: cd $(DIST) && $(MAKE_PACKAGE) michael@0: michael@0: make-package: FORCE michael@0: $(MAKE) make-package-internal michael@0: $(TOUCH) $@ michael@0: michael@0: GARBAGE += make-package michael@0: michael@0: make-sourcestamp-file:: michael@0: $(NSINSTALL) -D $(DIST)/$(PKG_PATH) michael@0: @echo '$(BUILDID)' > $(MOZ_SOURCESTAMP_FILE) michael@0: @echo '$(MOZ_SOURCE_REPO)/rev/$(MOZ_SOURCE_STAMP)' >> $(MOZ_SOURCESTAMP_FILE) michael@0: michael@0: .PHONY: make-buildinfo-file michael@0: make-buildinfo-file: michael@0: $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/informulate.py \ michael@0: $(MOZ_BUILDINFO_FILE) \ michael@0: BUILDID=$(BUILDID) \ michael@0: MOZ_SOURCE_REPO=$(MOZ_SOURCE_REPO) \ michael@0: MOZ_SOURCE_STAMP=$(MOZ_SOURCE_STAMP) \ michael@0: MOZ_PKG_PLATFORM=$(MOZ_PKG_PLATFORM) michael@0: michael@0: # The install target will install the application to prefix/lib/appname-version michael@0: # In addition if INSTALL_SDK is set, it will install the development headers, michael@0: # libraries, and IDL files as follows: michael@0: # dist/include -> prefix/include/appname-version michael@0: # dist/idl -> prefix/share/idl/appname-version michael@0: # dist/sdk/lib -> prefix/lib/appname-devel-version/lib michael@0: # prefix/lib/appname-devel-version/* symlinks to the above directories michael@0: install:: prepare-package michael@0: ifeq ($(OS_ARCH),WINNT) michael@0: $(error "make install" is not supported on this platform. Use "make package" instead.) michael@0: endif michael@0: ifeq (bundle,$(MOZ_FS_LAYOUT)) michael@0: $(error "make install" is not supported on this platform. Use "make package" instead.) michael@0: endif michael@0: $(NSINSTALL) -D $(DESTDIR)$(installdir) michael@0: (cd $(DIST)/$(MOZ_PKG_DIR) && $(TAR) --exclude=precomplete $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DESTDIR)$(installdir) && tar -xf -) michael@0: $(NSINSTALL) -D $(DESTDIR)$(bindir) michael@0: $(RM) -f $(DESTDIR)$(bindir)/$(MOZ_APP_NAME) michael@0: ln -s $(installdir)/$(MOZ_APP_NAME) $(DESTDIR)$(bindir) michael@0: ifdef INSTALL_SDK # Here comes the hard part michael@0: $(NSINSTALL) -D $(DESTDIR)$(includedir) michael@0: (cd $(DIST)/include && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DESTDIR)$(includedir) && tar -xf -) michael@0: $(NSINSTALL) -D $(DESTDIR)$(idldir) michael@0: (cd $(DIST)/idl && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DESTDIR)$(idldir) && tar -xf -) michael@0: # SDK directory is the libs + a bunch of symlinks michael@0: $(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/lib michael@0: $(NSINSTALL) -D $(DESTDIR)$(sdkdir)/sdk/bin michael@0: if test -f $(DIST)/include/xpcom-config.h; then \ michael@0: $(SYSINSTALL) $(IFLAGS1) $(DIST)/include/xpcom-config.h $(DESTDIR)$(sdkdir); \ michael@0: fi michael@0: find $(DIST)/sdk -name '*.pyc' | xargs rm -f michael@0: (cd $(DIST)/sdk/lib && $(TAR) $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/lib && tar -xf -) michael@0: (cd $(DIST)/sdk/bin && $(TAR) $(TAR_CREATE_FLAGS) - .) | (cd $(DESTDIR)$(sdkdir)/sdk/bin && tar -xf -) michael@0: $(RM) -f $(DESTDIR)$(sdkdir)/lib $(DESTDIR)$(sdkdir)/bin $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/include $(DESTDIR)$(sdkdir)/sdk/idl $(DESTDIR)$(sdkdir)/idl michael@0: ln -s $(sdkdir)/sdk/lib $(DESTDIR)$(sdkdir)/lib michael@0: ln -s $(installdir) $(DESTDIR)$(sdkdir)/bin michael@0: ln -s $(includedir) $(DESTDIR)$(sdkdir)/include michael@0: ln -s $(idldir) $(DESTDIR)$(sdkdir)/idl michael@0: endif # INSTALL_SDK michael@0: michael@0: make-sdk: michael@0: $(MAKE) stage-package UNIVERSAL_BINARY= STAGE_SDK=1 MOZ_PKG_DIR=sdk-stage michael@0: @echo 'Packaging SDK...' michael@0: $(RM) -rf $(DIST)/$(MOZ_APP_NAME)-sdk michael@0: $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/bin michael@0: (cd $(DIST)/sdk-stage && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DIST)/$(MOZ_APP_NAME)-sdk/bin && tar -xf -) michael@0: $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin michael@0: (cd $(DIST)/host/bin && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DIST)/$(MOZ_APP_NAME)-sdk/host/bin && tar -xf -) michael@0: $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/sdk michael@0: find $(DIST)/sdk -name '*.pyc' | xargs rm -f michael@0: (cd $(DIST)/sdk && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DIST)/$(MOZ_APP_NAME)-sdk/sdk && tar -xf -) michael@0: $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/include michael@0: (cd $(DIST)/include && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DIST)/$(MOZ_APP_NAME)-sdk/include && tar -xf -) michael@0: $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/idl michael@0: (cd $(DIST)/idl && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DIST)/$(MOZ_APP_NAME)-sdk/idl && tar -xf -) michael@0: $(NSINSTALL) -D $(DIST)/$(MOZ_APP_NAME)-sdk/lib michael@0: # sdk/lib is the same as sdk/sdk/lib michael@0: (cd $(DIST)/sdk/lib && $(TAR) $(TAR_CREATE_FLAGS) - .) | \ michael@0: (cd $(DIST)/$(MOZ_APP_NAME)-sdk/lib && tar -xf -) michael@0: $(NSINSTALL) -D $(DIST)/$(SDK_PATH) michael@0: ifndef PKG_SKIP_STRIP michael@0: USE_ELF_HACK= $(PYTHON) $(MOZILLA_DIR)/toolkit/mozapps/installer/strip.py $(DIST)/$(MOZ_APP_NAME)-sdk michael@0: endif michael@0: cd $(DIST) && $(MAKE_SDK) michael@0: michael@0: ifeq ($(OS_TARGET), WINNT) michael@0: INSTALLER_PACKAGE = $(DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe michael@0: endif michael@0: michael@0: # These are necessary because some of our packages/installers contain spaces michael@0: # in their filenames and GNU Make's $(wildcard) function doesn't properly michael@0: # deal with them. michael@0: empty := michael@0: space = $(empty) $(empty) michael@0: QUOTED_WILDCARD = $(if $(wildcard $(subst $(space),?,$(1))),'$(1)') michael@0: ESCAPE_SPACE = $(subst $(space),\$(space),$(1)) michael@0: ESCAPE_WILDCARD = $(subst $(space),?,$(1)) michael@0: michael@0: # This variable defines which OpenSSL algorithm to use to michael@0: # generate checksums for files that we upload michael@0: CHECKSUM_ALGORITHM_PARAM = -d sha512 -d md5 -d sha1 michael@0: michael@0: # This variable defines where the checksum file will be located michael@0: CHECKSUM_FILE = '$(DIST)/$(PKG_PATH)/$(CHECKSUMS_FILE_BASENAME).checksums' michael@0: CHECKSUM_FILES = $(CHECKSUM_FILE) michael@0: michael@0: ifeq (WINNT,$(OS_TARGET)) michael@0: UPLOAD_EXTRA_FILES += host/bin/mar.exe michael@0: UPLOAD_EXTRA_FILES += host/bin/mbsdiff.exe michael@0: else michael@0: UPLOAD_EXTRA_FILES += host/bin/mar michael@0: UPLOAD_EXTRA_FILES += host/bin/mbsdiff michael@0: endif michael@0: michael@0: UPLOAD_FILES= \ michael@0: $(call QUOTED_WILDCARD,$(DIST)/$(PACKAGE)) \ michael@0: $(call QUOTED_WILDCARD,$(INSTALLER_PACKAGE)) \ michael@0: $(call QUOTED_WILDCARD,$(DIST)/$(COMPLETE_MAR)) \ michael@0: $(call QUOTED_WILDCARD,$(DIST)/$(LANGPACK)) \ michael@0: $(call QUOTED_WILDCARD,$(wildcard $(DIST)/$(PARTIAL_MAR))) \ michael@0: $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(TEST_PACKAGE)) \ michael@0: $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(SYMBOL_ARCHIVE_BASENAME).zip) \ michael@0: $(call QUOTED_WILDCARD,$(DIST)/$(SDK)) \ michael@0: $(call QUOTED_WILDCARD,$(MOZ_SOURCESTAMP_FILE)) \ michael@0: $(call QUOTED_WILDCARD,$(MOZ_BUILDINFO_FILE)) \ michael@0: $(call QUOTED_WILDCARD,$(PKG_JSSHELL)) \ michael@0: $(if $(UPLOAD_EXTRA_FILES), $(foreach f, $(UPLOAD_EXTRA_FILES), $(wildcard $(DIST)/$(f)))) michael@0: michael@0: ifdef MOZ_CRASHREPORTER_UPLOAD_FULL_SYMBOLS michael@0: UPLOAD_FILES += \ michael@0: $(call QUOTED_WILDCARD,$(DIST)/$(PKG_PATH)$(SYMBOL_FULL_ARCHIVE_BASENAME).zip) michael@0: endif michael@0: michael@0: SIGN_CHECKSUM_CMD= michael@0: ifdef MOZ_SIGN_CMD michael@0: # If we're signing with gpg, we'll have a bunch of extra detached signatures to michael@0: # upload. We also want to sign our checksums file michael@0: SIGN_CHECKSUM_CMD=$(MOZ_SIGN_CMD) -f gpg $(CHECKSUM_FILE) michael@0: michael@0: CHECKSUM_FILES += $(CHECKSUM_FILE).asc michael@0: UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(COMPLETE_MAR).asc) michael@0: UPLOAD_FILES += $(call QUOTED_WILDCARD,$(wildcard $(DIST)/$(PARTIAL_MAR).asc)) michael@0: UPLOAD_FILES += $(call QUOTED_WILDCARD,$(INSTALLER_PACKAGE).asc) michael@0: UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PACKAGE).asc) michael@0: endif michael@0: michael@0: ifdef MOZ_STUB_INSTALLER michael@0: UPLOAD_FILES += $(call QUOTED_WILDCARD,$(DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe) michael@0: endif michael@0: michael@0: checksum: michael@0: mkdir -p `dirname $(CHECKSUM_FILE)` michael@0: @$(PYTHON) $(MOZILLA_DIR)/build/checksums.py \ michael@0: -o $(CHECKSUM_FILE) \ michael@0: $(CHECKSUM_ALGORITHM_PARAM) \ michael@0: -s $(call QUOTED_WILDCARD,$(DIST)) \ michael@0: $(UPLOAD_FILES) michael@0: @echo 'CHECKSUM FILE START' michael@0: @cat $(CHECKSUM_FILE) michael@0: @echo 'CHECKSUM FILE END' michael@0: $(SIGN_CHECKSUM_CMD) michael@0: michael@0: michael@0: upload: checksum michael@0: $(PYTHON) $(MOZILLA_DIR)/build/upload.py --base-path $(DIST) \ michael@0: $(UPLOAD_FILES) \ michael@0: $(CHECKSUM_FILES) michael@0: michael@0: ifndef MOZ_PKG_SRCDIR michael@0: MOZ_PKG_SRCDIR = $(topsrcdir) michael@0: endif michael@0: michael@0: DIR_TO_BE_PACKAGED ?= ../$(notdir $(topsrcdir)) michael@0: SRC_TAR_EXCLUDE_PATHS += \ michael@0: --exclude='.hg*' \ michael@0: --exclude='CVS' \ michael@0: --exclude='.cvs*' \ michael@0: --exclude='.mozconfig*' \ michael@0: --exclude='*.pyc' \ michael@0: --exclude='$(MOZILLA_DIR)/Makefile' \ michael@0: --exclude='$(MOZILLA_DIR)/dist' michael@0: ifdef MOZ_OBJDIR michael@0: SRC_TAR_EXCLUDE_PATHS += --exclude='$(MOZ_OBJDIR)' michael@0: endif michael@0: CREATE_SOURCE_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \ michael@0: --mode=go-w $(SRC_TAR_EXCLUDE_PATHS) -f michael@0: michael@0: SOURCE_TAR = $(DIST)/$(PKG_SRCPACK_PATH)$(PKG_SRCPACK_BASENAME).tar.bz2 michael@0: HG_BUNDLE_FILE = $(DIST)/$(PKG_SRCPACK_PATH)$(PKG_BUNDLE_BASENAME).bundle michael@0: SOURCE_CHECKSUM_FILE = $(DIST)/$(PKG_SRCPACK_PATH)$(PKG_SRCPACK_BASENAME).checksums michael@0: SOURCE_UPLOAD_FILES = $(SOURCE_TAR) michael@0: michael@0: HG ?= hg michael@0: CREATE_HG_BUNDLE_CMD = $(HG) -v -R $(topsrcdir) bundle --base null michael@0: ifdef HG_BUNDLE_REVISION michael@0: CREATE_HG_BUNDLE_CMD += -r $(HG_BUNDLE_REVISION) michael@0: endif michael@0: CREATE_HG_BUNDLE_CMD += $(HG_BUNDLE_FILE) michael@0: ifdef UPLOAD_HG_BUNDLE michael@0: SOURCE_UPLOAD_FILES += $(HG_BUNDLE_FILE) michael@0: endif michael@0: michael@0: ifdef MOZ_SIGN_CMD michael@0: SIGN_SOURCE_TAR_CMD = $(MOZ_SIGN_CMD) -f gpg $(SOURCE_TAR) michael@0: SOURCE_UPLOAD_FILES += $(SOURCE_TAR).asc michael@0: SIGN_HG_BUNDLE_CMD = $(MOZ_SIGN_CMD) -f gpg $(HG_BUNDLE_FILE) michael@0: ifdef UPLOAD_HG_BUNDLE michael@0: SOURCE_UPLOAD_FILES += $(HG_BUNDLE_FILE).asc michael@0: endif michael@0: endif michael@0: michael@0: # source-package creates a source tarball from the files in MOZ_PKG_SRCDIR, michael@0: # which is either set to a clean checkout or defaults to $topsrcdir michael@0: source-package: michael@0: @echo 'Packaging source tarball...' michael@0: $(MKDIR) -p $(DIST)/$(PKG_SRCPACK_PATH) michael@0: (cd $(MOZ_PKG_SRCDIR) && $(CREATE_SOURCE_TAR) - $(DIR_TO_BE_PACKAGED)) | bzip2 -vf > $(SOURCE_TAR) michael@0: $(SIGN_SOURCE_TAR_CMD) michael@0: michael@0: hg-bundle: michael@0: $(MKDIR) -p $(DIST)/$(PKG_SRCPACK_PATH) michael@0: $(CREATE_HG_BUNDLE_CMD) michael@0: $(SIGN_HG_BUNDLE_CMD) michael@0: michael@0: source-upload: michael@0: $(MAKE) upload UPLOAD_FILES='$(SOURCE_UPLOAD_FILES)' CHECKSUM_FILE='$(SOURCE_CHECKSUM_FILE)'