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 (6415d54a26d0)

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 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170
# 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)

GRE_MILESTONE = $(shell $(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build Milestone)
MOZ_BUILDID = $(shell $(PYTHON) $(moztopsrcdir)/config/printconfigsetting.py $(DIST)/bin/platform.ini Build BuildID)


DEFINES += \
  -DTHUNDERBIRD_ICO='"$(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/messengerWindow.ico"' \
  -DTB_MAILBIFF_ICO='"$(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/newmail.ico"' \
   $(NULL)

# Build a binary bootstrapping with XRE_main

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

include $(moztopsrcdir)/config/config.mk

# If we are trying to show an error dialog about the lack of SSE2 support,
# make sure that code itself doesn't use SSE2.
ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
CXX := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXX))
CXX += -march=pentiumpro
endif

ifeq ($(OS_ARCH),WINNT)
# Extract the icons we care about embedding into the EXE
mailtoolbar = $(commtopsrcdir)/mail/themes/windows/mail/icons/jumplist.png

# png to ico converter. The function takes 5 arguments, in order: source png
# file, left, top, size, output ico file.
png2ico = $(PYTHON) $(srcdir)/png2ico.py $(1) $(2) $(3) $(4) $(5)

# Each icon is 18x18 in the toolbar, and we want a 16x16 icon here, so we cut
# off a pixel at each end.
write-message.ico: $(mailtoolbar) $(srcdir)/png2ico.py
	$(call png2ico,$(mailtoolbar),0,0,16,write-message.ico)

address-book.ico: $(mailtoolbar) $(srcdir)/png2ico.py
	$(call png2ico,$(mailtoolbar),16,0,16,address-book.ico)

embedded-icons:: write-message.ico address-book.ico
GARBAGE += write-message.ico address-book.ico

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

include $(moztopsrcdir)/config/rules.mk

ifeq ($(OS_ARCH),WINNT)

$(RESFILE): embedded-icons

endif

ifneq ($(OS_ARCH),WINNT)
ifdef COMPILE_ENVIRONMENT
ifndef MOZ_NO_PIE_COMPAT
libs::
	cp -p $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
endif
endif

GARBAGE += $(addprefix $(DIST)/bin/defaults/pref/, all.js all-thunderbird.js mailnews.js)
endif # ! WinNT

ifneq (,$(filter windows,$(MOZ_WIDGET_TOOLKIT)))
ICON_SUFFIX=.ico

DESKTOP_ICONS = \
	abcardWindow \
	addressbookWindow \
	msgcomposeWindow \
	calendar-alarm-dialog \
	calendar-event-dialog \
	calendar-event-summary-dialog \
	calendar-task-dialog \
	calendar-task-summary-dialog \
	$(NULL)

BRANDED_ICONS = \
	messengerWindow \
	$(NULL)


DESKTOP_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(DESKTOP_ICONS) $(DESKTOP_ICONS_SMALL))
BRANDED_ICON_FILES = $(addsuffix $(ICON_SUFFIX), $(BRANDED_ICONS) $(BRANDED_ICONS_SMALL))

libs:: $(addprefix $(srcdir)/icons/$(MOZ_WIDGET_TOOLKIT)/,$(DESKTOP_ICON_FILES))
	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/chrome/icons/default

libs:: $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/messengerWindow.ico
	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/chrome/icons/default
endif

libs:: $(srcdir)/profile/prefs.js
	$(INSTALL) $(IFLAGS1) $^ $(DIST)/bin/defaults/profile

# channel-prefs.js is handled separate from other prefs due to bug 756325
libs:: $(srcdir)/profile/channel-prefs.js
	$(NSINSTALL) -D $(DIST)/bin/defaults/pref
	$(call py_action,preprocessor,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)

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

ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))

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]')

AB_CD = $(MOZ_UI_LOCALE)

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)'

.PHONY: repackage
tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME)
	rm -rf '$(DIST)/$(MOZ_MACBUNDLE_NAME)'
	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS'
	rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents '$(DIST)/$(MOZ_MACBUNDLE_NAME)' --exclude English.lproj
	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)'
	rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ '$(DIST)/$(MOZ_MACBUNDLE_NAME)/$(LPROJ)'
	sed -e 's/%APP_VERSION%/$(MOZ_APP_VERSION)/' -e 's/%MAC_APP_NAME%/$(MAC_APP_NAME)/' -e 's/%LOWER_MAC_APP_NAME%/$(LOWER_MAC_APP_NAME)/' $(srcdir)/macbuild/Contents/Info.plist.in > '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Info.plist'
	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)/$(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'
	# MacOS-files-copy.in is a list of files that should be copies rather
	# than symlinks and placed in .app/Contents/MacOS.
	rsync -aL --include-from='$(srcdir)/macbuild/Contents/MacOS-files-copy.in' --exclude '*' $(DIST)/bin/ '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS'
	$(RM) '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/$(MOZ_APP_NAME)'
	rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS'
	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight'
	rsync -a --copy-unsafe-links $(DIST)/package/thunderbird.mdimporter '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/Spotlight'
	cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/thunderbird.icns '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Resources/thunderbird.icns'
	$(MKDIR) -p '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/LaunchServices'
ifdef MOZ_UPDATER
	mv -f '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/Library/LaunchServices'
	ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater'
endif
	printf APPLMOZM > '$(DIST)/$(MOZ_MACBUNDLE_NAME)/Contents/PkgInfo'
endif

# Note that anything you do to dist/ down here isn't going to make it into the
# Mac build, since it's already been copied over to the .app, above.