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: dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME) michael@0: michael@0: PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \ michael@0: $(NULL) michael@0: PREF_JS_EXPORTS += $(srcdir)/profile/000-tor-browser.js michael@0: michael@0: michael@0: # hardcode en-US for the moment michael@0: AB_CD = en-US michael@0: michael@0: DEFINES += \ michael@0: -DAB_CD=$(AB_CD) \ michael@0: -DFIREFOX_ICO='"$(DIST)/branding/firefox.ico"' \ michael@0: -DDOCUMENT_ICO='"$(DIST)/branding/document.ico"' \ michael@0: -DNEWWINDOW_ICO='"$(DIST)/branding/newwindow.ico"' \ michael@0: -DNEWTAB_ICO='"$(DIST)/branding/newtab.ico"' \ michael@0: -DPBMODE_ICO='"$(DIST)/branding/pbmode.ico"' \ michael@0: $(NULL) michael@0: michael@0: ifdef LIBXUL_SDK #{ michael@0: PREF_JS_EXPORTS += $(srcdir)/profile/channel-prefs.js michael@0: endif #} LIBXUL_SDK michael@0: michael@0: # Build a binary bootstrapping with XRE_main michael@0: michael@0: LIBS += \ michael@0: $(XPCOM_STANDALONE_GLUE_LDOPTS) \ michael@0: $(NULL) michael@0: michael@0: ifdef MOZ_LINKER michael@0: LIBS += $(MOZ_ZLIB_LIBS) michael@0: endif michael@0: michael@0: ifdef HAVE_CLOCK_MONOTONIC michael@0: LIBS += $(REALTIME_LIBS) michael@0: endif michael@0: michael@0: ifndef MOZ_WINCONSOLE michael@0: ifdef MOZ_DEBUG michael@0: MOZ_WINCONSOLE = 1 michael@0: else michael@0: MOZ_WINCONSOLE = 0 michael@0: endif michael@0: endif michael@0: michael@0: # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that michael@0: # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall. michael@0: NSDISTMODE = copy michael@0: michael@0: include $(topsrcdir)/config/config.mk michael@0: michael@0: ifeq ($(OS_ARCH),WINNT) michael@0: # Rebuild firefox.exe if the manifest changes - it's included by splash.rc. michael@0: # (this dependency should really be just for firefox.exe, not other targets) michael@0: # Note the manifest file exists in the tree, so we use the explicit filename michael@0: # here. michael@0: EXTRA_DEPS += firefox.exe.manifest michael@0: endif michael@0: michael@0: PROGRAMS_DEST = $(DIST)/bin michael@0: michael@0: include $(topsrcdir)/config/rules.mk michael@0: michael@0: ifneq (,$(filter-out WINNT,$(OS_ARCH))) michael@0: michael@0: ifdef COMPILE_ENVIRONMENT michael@0: libs:: michael@0: cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX) michael@0: endif michael@0: michael@0: GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js) michael@0: michael@0: endif michael@0: michael@0: ifdef MOZ_WIDGET_GTK michael@0: libs:: michael@0: $(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(FINAL_TARGET)/icons michael@0: $(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(FINAL_TARGET)/chrome/icons/default michael@0: $(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(FINAL_TARGET)/chrome/icons/default michael@0: $(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(FINAL_TARGET)/chrome/icons/default michael@0: endif michael@0: michael@0: libs:: $(srcdir)/profile/prefs.js michael@0: $(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile michael@0: michael@0: ifndef LIBXUL_SDK michael@0: # channel-prefs.js is handled separate from other prefs due to bug 756325 michael@0: libs:: $(srcdir)/profile/channel-prefs.js michael@0: $(NSINSTALL) -D $(DIST)/bin/defaults/pref michael@0: $(call py_action,preprocessor,$(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js) michael@0: endif michael@0: michael@0: libs:: $(srcdir)/blocklist.xml michael@0: $(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET) michael@0: michael@0: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) michael@0: michael@0: MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME) michael@0: michael@0: ifdef MOZ_DEBUG michael@0: MAC_APP_NAME := $(MAC_APP_NAME)Debug michael@0: endif michael@0: michael@0: AB_CD = $(MOZ_UI_LOCALE) michael@0: michael@0: AB := $(firstword $(subst -, ,$(AB_CD))) michael@0: michael@0: clean clobber repackage:: michael@0: $(RM) -r $(dist_dest) michael@0: michael@0: ifdef LIBXUL_SDK michael@0: APPFILES = Resources michael@0: else michael@0: APPFILES = MacOS michael@0: endif michael@0: michael@0: MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/config/buildid) michael@0: michael@0: .PHONY: repackage michael@0: tools repackage:: $(PROGRAM) michael@0: $(MKDIR) -p $(dist_dest)/Contents/MacOS michael@0: $(MKDIR) -p $(dist_dest)/Contents/Resources/$(AB).lproj michael@0: rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents $(dist_dest) --exclude English.lproj michael@0: rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(dist_dest)/Contents/Resources/$(AB).lproj michael@0: sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%MOZ_MACBUNDLE_ID%/$(MOZ_MACBUNDLE_ID)/' -e 's/%MAC_BUNDLE_VERSION%/$(MAC_BUNDLE_VERSION)/' $(srcdir)/macbuild/Contents/Info.plist.in > $(dist_dest)/Contents/Info.plist michael@0: sed -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in | iconv -f UTF-8 -t UTF-16 > $(dist_dest)/Contents/Resources/$(AB).lproj/InfoPlist.strings michael@0: rsync -a $(DIST)/bin/ $(dist_dest)/Contents/$(APPFILES) michael@0: $(RM) $(dist_dest)/Contents/MacOS/$(PROGRAM) michael@0: rsync -aL $(PROGRAM) $(dist_dest)/Contents/MacOS michael@0: cp -RL $(DIST)/branding/firefox.icns $(dist_dest)/Contents/Resources/firefox.icns michael@0: cp -RL $(DIST)/branding/document.icns $(dist_dest)/Contents/Resources/document.icns michael@0: printf APPLMOZB > $(dist_dest)/Contents/PkgInfo michael@0: endif michael@0: michael@0: ifdef LIBXUL_SDK #{ michael@0: ifndef SKIP_COPY_XULRUNNER #{ michael@0: libs:: michael@0: ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{ michael@0: rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(dist_dest)/Contents/Frameworks michael@0: else michael@0: $(NSINSTALL) -D $(DIST)/bin/xulrunner michael@0: (cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -) michael@0: endif #} cocoa michael@0: endif #} SKIP_COPY_XULRUNNER michael@0: endif #} LIBXUL_SDK