suite/app/Makefile.in
author aleth <aleth@instantbird.org>
Tue, 13 Oct 2015 22:55:30 +0200
changeset 18516 bfa63ac1f11e3178e9f33ecf19e7eb2191cbce93
parent 18452 bda92538bc44c1c22d08e656eb2195dc0e03ee19
child 18550 7a674f9ee35503b88660df41e4616967b72ad765
permissions -rw-r--r--
Bug 1210992 - Package Signed Packaged Content to fix xpcshell test failures. r=mkmelin a=aleth CLOSED TREE

# 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/.

AB_CD = $(MOZ_UI_LOCALE) 

DEFINES += \
	-DSEAMONKEY_ICO=\"$(DIST)/branding/seamonkey.ico\" \
	-DHTML_FILE_ICO=\"$(DIST)/branding/html-file.ico\" \
	$(NULL)

ifdef LIBXUL_SDK
include $(topsrcdir)/config/rules.mk
else
# Build a binary bootstrapping with XRE_main

ifndef MOZ_WINCONSOLE
ifdef MOZ_DEBUG
MOZ_WINCONSOLE = 1
else
MOZ_WINCONSOLE = 0
endif
endif

# This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that
# shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall.
NSDISTMODE = copy

include $(topsrcdir)/config/config.mk

ifeq ($(OS_ARCH),WINNT)
# Rebuild seamonkey.exe if the manifest changes - it's included by splash.rc.
# (this dependency should really be just for seamonkey.exe, not other targets)
# Note the manifest file exists in the tree, so we use the explicit filename
# here.
EXTRA_DEPS += seamonkey.exe.manifest
endif

include $(topsrcdir)/config/rules.mk

libs::
ifeq ($(OS_ARCH),WINNT)
	$(EXIT_ON_ERROR) \
	$(PERL) -pe 's/(?<!\r)\n/\r\n/g;' < $(topsrcdir)/suite/installer/license.txt > $(DIST)/bin/license.txt
else
	$(INSTALL) $(IFLAGS1) $(topsrcdir)/suite/installer/license.txt $(DIST)/bin/
endif

ifneq ($(OS_ARCH),WINNT)

libs:: 
	cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)

endif

endif # LIBXUL_SDK

libs:: blocklist.xml
	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin

ifneq (,$(filter-out WINNT Darwin,$(OS_ARCH)))
$(MOZ_APP_NAME).1: seamonkey.man.in $(GLOBAL_DEPS) $(DEPTH)/config/autoconf.mk
	@sed -e "s|\@bindir\@|$(bindir)|g" -e "s|\@mozappdir\@|$(mozappdir)|g" \
		-e "s|\@MOZ_APP_DISPLAYNAME\@|$(MOZ_APP_DISPLAYNAME)|g" \
		-e "s|\@MOZ_APP_NAME\@|$(MOZ_APP_NAME)|g" \
		-e "s|\@MOZ_APP_VERSION\@|${MOZ_APP_VERSION}|g" < $< > $@

libs:: $(MOZ_APP_NAME).1
	$(INSTALL) $< $(DIST)/man/man1

GARBAGE += $(MOZ_APP_NAME).1
GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, browser-prefs.js)
endif

ifdef MOZ_OMNIJAR
# Make extensions end up as XPIs instead of flat chrome when doing omni.jar.
# Extensions that appear in dist/bin/extensions will get bundled with the
# application, ones that appear in dist/bin/distribution/extensions will be
# copied to the profile in installed builds.
# NOTE: This is a hack to run this at the end of compilation, would be nicer
# if this was done right away for built-in extensions in omnijar mode.

ABS_DIST = $(abspath $(STAGEDIST))

define _PACKAGE_EXTENSIONS
@echo "Packaging $(dir).xpi..."
if test -d "$(ABS_DIST)/$(dir)"; then \
cd $(ABS_DIST)/$(dir)/; \
$(ZIP) -r9mX ../$(dir).xpi * -x \*/.mkdir.done; \
cd ..; rm -rf $(ABS_DIST)/$(dir); \
fi

endef # do not remove the blank line!

# GUIDs
# {972ce4c6-7e08-4474-a285-3208198ce6fd} Default theme
# {e2fda1a4-762b-4020-b5ad-a41df1933103} Lightning
DONOTPACK = {972ce4c6% {e2fda1a4%

pack-ext: $(STAGEDIST)
	@echo "Packaging extensions..."
	$(foreach dir,$(filter-out $(DONOTPACK),$(subst $(STAGEDIST)/,,$(wildcard $(STAGEDIST)/*))),$(_PACKAGE_EXTENSIONS))

tools::
	@$(MAKE) pack-ext STAGEDIST="$(DIST)/bin/extensions"
	@$(MAKE) pack-ext STAGEDIST="$(DIST)/bin/distribution/extensions"

endif

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
# Anything below the above ifdef won't be included in mac builds. So be very
# careful what you add here.

MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)

ifdef MOZ_DEBUG
MAC_APP_NAME := $(MAC_APP_NAME)Debug
endif

LOWER_MAC_APP_NAME = $(shell echo $(MAC_APP_NAME) | tr '[A-Z]' '[a-z]')

ifeq (zh-TW,$(AB_CD))
LPROJ_ROOT := $(subst -,_,$(AB_CD))
else
LPROJ_ROOT := $(firstword $(subst -, ,$(AB_CD)))
endif
LPROJ := Contents/Resources/$(LPROJ_ROOT).lproj

clean clobber repackage::
	$(RM) -r $(DIST)/$(MOZ_MACBUNDLE_NAME)

tools:: $(PROGRAM)
	mkdir -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents $(DIST)/$(MOZ_MACBUNDLE_NAME) --exclude English.lproj
	mkdir -p $(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)
	rsync -a --exclude CVS --exclude "*.in" $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)
	sed -e "s/\@MOZ_APP_NAME\@/$(MOZ_APP_NAME)/" -e "s/\@MAC_APP_NAME\@/$(MAC_APP_NAME)/" -e "s/\@MOZ_APP_DISPLAYNAME\@/$(MOZ_APP_DISPLAYNAME)/" -e "s/\@MOZ_APP_VERSION\@/$(MOZ_APP_VERSION)/" $(srcdir)/macbuild/Contents/Info.plist.in > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist
	sed -e "s/\@MOZ_APP_NAME\@/$(MOZ_APP_NAME)/" -e "s/\@MAC_APP_NAME\@/$(MAC_APP_NAME)/" -e "s/\@MOZ_APP_DISPLAYNAME\@/$(MOZ_APP_DISPLAYNAME)/" -e "s/\@MOZ_APP_VERSION\@/$(MOZ_APP_VERSION)/" $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)/InfoPlist.strings
	rsync -a --exclude-from='$(srcdir)/macbuild/Contents/MacOS-files.in' $(DIST)/bin/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources
	rsync -a --include-from='$(srcdir)/macbuild/Contents/MacOS-files.in' --exclude '*' $(DIST)/bin/ $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
	rm -f $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/mangle $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)/shlibsign
ifdef LIBXUL_SDK
	cp $(LIBXUL_DIST)/bin/$(XR_STUB_NAME) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/seamonkey
else
	rm -f $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(PROGRAM)
	rsync -aL $(PROGRAM) $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS
endif
	-cp -L $(DIST)/bin/mangle $(DIST)/bin/shlibsign $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/$(APPFILES)
	cp -RL $(DIST)/branding/icons/*.icns $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/
	printf APPLMOZZ > $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/PkgInfo
#       remove CVS dirs from packaged app
	find $(DIST)/$(MOZ_MACBUNDLE_NAME) -type d -name "CVS" -prune -exec rm -rf {} \;
else
ifdef LIBXUL_SDK
libs::
	cp $(LIBXUL_DIST)/bin/$(XULRUNNER_STUB_NAME)$(BIN_SUFFIX) $(DIST)/bin/seamonkey$(BIN_SUFFIX)
endif
endif

ifdef LIBXUL_SDK
ifndef SKIP_COPY_XULRUNNER
libs::
ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
	rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Frameworks
else
	$(NSINSTALL) -D $(DIST)/bin/xulrunner
	(cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -)
endif # cocoa
endif # SKIP_COPY_XULRUNNER
endif # LIBXUL_SDK