Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | # This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | # License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 4 | |
michael@0 | 5 | dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME) |
michael@0 | 6 | |
michael@0 | 7 | PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \ |
michael@0 | 8 | $(NULL) |
michael@0 | 9 | PREF_JS_EXPORTS += $(srcdir)/profile/000-tor-browser.js |
michael@0 | 10 | |
michael@0 | 11 | |
michael@0 | 12 | # hardcode en-US for the moment |
michael@0 | 13 | AB_CD = en-US |
michael@0 | 14 | |
michael@0 | 15 | DEFINES += \ |
michael@0 | 16 | -DAB_CD=$(AB_CD) \ |
michael@0 | 17 | -DFIREFOX_ICO='"$(DIST)/branding/firefox.ico"' \ |
michael@0 | 18 | -DDOCUMENT_ICO='"$(DIST)/branding/document.ico"' \ |
michael@0 | 19 | -DNEWWINDOW_ICO='"$(DIST)/branding/newwindow.ico"' \ |
michael@0 | 20 | -DNEWTAB_ICO='"$(DIST)/branding/newtab.ico"' \ |
michael@0 | 21 | -DPBMODE_ICO='"$(DIST)/branding/pbmode.ico"' \ |
michael@0 | 22 | $(NULL) |
michael@0 | 23 | |
michael@0 | 24 | ifdef LIBXUL_SDK #{ |
michael@0 | 25 | PREF_JS_EXPORTS += $(srcdir)/profile/channel-prefs.js |
michael@0 | 26 | endif #} LIBXUL_SDK |
michael@0 | 27 | |
michael@0 | 28 | # Build a binary bootstrapping with XRE_main |
michael@0 | 29 | |
michael@0 | 30 | LIBS += \ |
michael@0 | 31 | $(XPCOM_STANDALONE_GLUE_LDOPTS) \ |
michael@0 | 32 | $(NULL) |
michael@0 | 33 | |
michael@0 | 34 | ifdef MOZ_LINKER |
michael@0 | 35 | LIBS += $(MOZ_ZLIB_LIBS) |
michael@0 | 36 | endif |
michael@0 | 37 | |
michael@0 | 38 | ifdef HAVE_CLOCK_MONOTONIC |
michael@0 | 39 | LIBS += $(REALTIME_LIBS) |
michael@0 | 40 | endif |
michael@0 | 41 | |
michael@0 | 42 | ifndef MOZ_WINCONSOLE |
michael@0 | 43 | ifdef MOZ_DEBUG |
michael@0 | 44 | MOZ_WINCONSOLE = 1 |
michael@0 | 45 | else |
michael@0 | 46 | MOZ_WINCONSOLE = 0 |
michael@0 | 47 | endif |
michael@0 | 48 | endif |
michael@0 | 49 | |
michael@0 | 50 | # This switches $(INSTALL) to copy mode, like $(SYSINSTALL), so things that |
michael@0 | 51 | # shouldn't get 755 perms need $(IFLAGS1) for either way of calling nsinstall. |
michael@0 | 52 | NSDISTMODE = copy |
michael@0 | 53 | |
michael@0 | 54 | include $(topsrcdir)/config/config.mk |
michael@0 | 55 | |
michael@0 | 56 | ifeq ($(OS_ARCH),WINNT) |
michael@0 | 57 | # Rebuild firefox.exe if the manifest changes - it's included by splash.rc. |
michael@0 | 58 | # (this dependency should really be just for firefox.exe, not other targets) |
michael@0 | 59 | # Note the manifest file exists in the tree, so we use the explicit filename |
michael@0 | 60 | # here. |
michael@0 | 61 | EXTRA_DEPS += firefox.exe.manifest |
michael@0 | 62 | endif |
michael@0 | 63 | |
michael@0 | 64 | PROGRAMS_DEST = $(DIST)/bin |
michael@0 | 65 | |
michael@0 | 66 | include $(topsrcdir)/config/rules.mk |
michael@0 | 67 | |
michael@0 | 68 | ifneq (,$(filter-out WINNT,$(OS_ARCH))) |
michael@0 | 69 | |
michael@0 | 70 | ifdef COMPILE_ENVIRONMENT |
michael@0 | 71 | libs:: |
michael@0 | 72 | cp -p $(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX) |
michael@0 | 73 | endif |
michael@0 | 74 | |
michael@0 | 75 | GARBAGE += $(addprefix $(FINAL_TARGET)/defaults/pref/, firefox.js) |
michael@0 | 76 | |
michael@0 | 77 | endif |
michael@0 | 78 | |
michael@0 | 79 | ifdef MOZ_WIDGET_GTK |
michael@0 | 80 | libs:: |
michael@0 | 81 | $(INSTALL) $(IFLAGS1) $(DIST)/branding/mozicon128.png $(FINAL_TARGET)/icons |
michael@0 | 82 | $(INSTALL) $(IFLAGS1) $(DIST)/branding/default16.png $(FINAL_TARGET)/chrome/icons/default |
michael@0 | 83 | $(INSTALL) $(IFLAGS1) $(DIST)/branding/default32.png $(FINAL_TARGET)/chrome/icons/default |
michael@0 | 84 | $(INSTALL) $(IFLAGS1) $(DIST)/branding/default48.png $(FINAL_TARGET)/chrome/icons/default |
michael@0 | 85 | endif |
michael@0 | 86 | |
michael@0 | 87 | libs:: $(srcdir)/profile/prefs.js |
michael@0 | 88 | $(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile |
michael@0 | 89 | |
michael@0 | 90 | ifndef LIBXUL_SDK |
michael@0 | 91 | # channel-prefs.js is handled separate from other prefs due to bug 756325 |
michael@0 | 92 | libs:: $(srcdir)/profile/channel-prefs.js |
michael@0 | 93 | $(NSINSTALL) -D $(DIST)/bin/defaults/pref |
michael@0 | 94 | $(call py_action,preprocessor,$(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js) |
michael@0 | 95 | endif |
michael@0 | 96 | |
michael@0 | 97 | libs:: $(srcdir)/blocklist.xml |
michael@0 | 98 | $(INSTALL) $(IFLAGS1) $^ $(FINAL_TARGET) |
michael@0 | 99 | |
michael@0 | 100 | ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) |
michael@0 | 101 | |
michael@0 | 102 | MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME) |
michael@0 | 103 | |
michael@0 | 104 | ifdef MOZ_DEBUG |
michael@0 | 105 | MAC_APP_NAME := $(MAC_APP_NAME)Debug |
michael@0 | 106 | endif |
michael@0 | 107 | |
michael@0 | 108 | AB_CD = $(MOZ_UI_LOCALE) |
michael@0 | 109 | |
michael@0 | 110 | AB := $(firstword $(subst -, ,$(AB_CD))) |
michael@0 | 111 | |
michael@0 | 112 | clean clobber repackage:: |
michael@0 | 113 | $(RM) -r $(dist_dest) |
michael@0 | 114 | |
michael@0 | 115 | ifdef LIBXUL_SDK |
michael@0 | 116 | APPFILES = Resources |
michael@0 | 117 | else |
michael@0 | 118 | APPFILES = MacOS |
michael@0 | 119 | endif |
michael@0 | 120 | |
michael@0 | 121 | MAC_BUNDLE_VERSION = $(shell $(PYTHON) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/config/buildid) |
michael@0 | 122 | |
michael@0 | 123 | .PHONY: repackage |
michael@0 | 124 | tools repackage:: $(PROGRAM) |
michael@0 | 125 | $(MKDIR) -p $(dist_dest)/Contents/MacOS |
michael@0 | 126 | $(MKDIR) -p $(dist_dest)/Contents/Resources/$(AB).lproj |
michael@0 | 127 | rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents $(dist_dest) --exclude English.lproj |
michael@0 | 128 | rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ $(dist_dest)/Contents/Resources/$(AB).lproj |
michael@0 | 129 | 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 | 130 | 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 | 131 | rsync -a $(DIST)/bin/ $(dist_dest)/Contents/$(APPFILES) |
michael@0 | 132 | $(RM) $(dist_dest)/Contents/MacOS/$(PROGRAM) |
michael@0 | 133 | rsync -aL $(PROGRAM) $(dist_dest)/Contents/MacOS |
michael@0 | 134 | cp -RL $(DIST)/branding/firefox.icns $(dist_dest)/Contents/Resources/firefox.icns |
michael@0 | 135 | cp -RL $(DIST)/branding/document.icns $(dist_dest)/Contents/Resources/document.icns |
michael@0 | 136 | printf APPLMOZB > $(dist_dest)/Contents/PkgInfo |
michael@0 | 137 | endif |
michael@0 | 138 | |
michael@0 | 139 | ifdef LIBXUL_SDK #{ |
michael@0 | 140 | ifndef SKIP_COPY_XULRUNNER #{ |
michael@0 | 141 | libs:: |
michael@0 | 142 | ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT)) #{ |
michael@0 | 143 | rsync -a --copy-unsafe-links $(LIBXUL_DIST)/XUL.framework $(dist_dest)/Contents/Frameworks |
michael@0 | 144 | else |
michael@0 | 145 | $(NSINSTALL) -D $(DIST)/bin/xulrunner |
michael@0 | 146 | (cd $(LIBXUL_SDK)/bin && tar $(TAR_CREATE_FLAGS) - .) | (cd $(DIST)/bin/xulrunner && tar -xf -) |
michael@0 | 147 | endif #} cocoa |
michael@0 | 148 | endif #} SKIP_COPY_XULRUNNER |
michael@0 | 149 | endif #} LIBXUL_SDK |