Backed out changeset 496886cb30a5 (bug 1867152) for bc failures on browser_user_input...
[gecko.git] / browser / app / Makefile.in
blob7a09bc249462eb036a962dbfba950c51ae6b39e0
1 # This Source Code Form is subject to the terms of the Mozilla Public
2 # License, v. 2.0. If a copy of the MPL was not distributed with this
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 dist_dest = $(DIST)/$(MOZ_MACBUNDLE_NAME)
7 # hardcode en-US for the moment
8 AB_CD = en-US
10 # Build a binary bootstrapping with XRE_main
12 ifndef MOZ_WINCONSOLE
13 ifneq (,$(MOZ_DEBUG)$(MOZ_ASAN))
14 MOZ_WINCONSOLE = 1
15 else
16 MOZ_WINCONSOLE = 0
17 endif
18 endif
20 include $(topsrcdir)/config/config.mk
22 # If we are trying to show an error dialog about the lack of SSE2 support,
23 # make sure that code itself doesn't use SSE2.
24 ifdef MOZ_LINUX_32_SSE2_STARTUP_ERROR
25 CXX := $(filter-out -march=% -msse -msse2 -mfpmath=sse,$(CXX))
26 CXX += -march=pentiumpro
27 endif
29 ifeq ($(OS_ARCH),WINNT)
30 # Rebuild firefox.exe if the manifest changes - it's included by splash.rc.
31 # (this dependency should really be just for firefox.exe, not other targets)
32 # Note the manifest file exists in the tree, so we use the explicit filename
33 # here.
34 EXTRA_DEPS += $(srcdir)/firefox.exe.manifest
35 endif
37 PROGRAMS_DEST = $(DIST)/bin
38 objdir = $(topobjdir)/browser/app
40 include $(topsrcdir)/config/rules.mk
42 ifneq (,$(filter-out WINNT,$(OS_ARCH)))
44 ifdef COMPILE_ENVIRONMENT
45 ifndef MOZ_NO_PIE_COMPAT
46 libs::
47 cp -p $(DIST)/bin/$(MOZ_APP_NAME)$(BIN_SUFFIX) $(DIST)/bin/$(MOZ_APP_NAME)-bin$(BIN_SUFFIX)
48 endif
49 endif
51 endif
53 # channel-prefs.js is handled separate from other prefs due to bug 756325
54 # DO NOT change the content of channel-prefs.js without taking the appropriate
55 # steps. See bug 1431342.
56 libs:: $(srcdir)/profile/channel-prefs.js
57 $(NSINSTALL) -D $(DIST)/bin/defaults/pref
58 $(call py_action,preprocessor channel-prefs.js,-Fsubstitution $(PREF_PPFLAGS) $(ACDEFINES) $^ -o $(DIST)/bin/defaults/pref/channel-prefs.js)
60 ifeq (cocoa,$(MOZ_WIDGET_TOOLKIT))
62 MAC_APP_NAME = $(MOZ_APP_DISPLAYNAME)
64 ifdef MOZ_DEBUG
65 MAC_APP_NAME := $(MAC_APP_NAME)Debug
66 endif
68 AB_CD = $(MOZ_UI_LOCALE)
70 ifeq (zh-TW,$(AB_CD))
71 LPROJ_ROOT := $(subst -,_,$(AB_CD))
72 else
73 LPROJ_ROOT := $(firstword $(subst -, ,$(AB_CD)))
74 endif
75 LPROJ := Contents/Resources/$(LPROJ_ROOT).lproj
77 repackage::
78 $(RM) -r $(dist_dest)
80 MAC_BUNDLE_VERSION = $(shell $(PYTHON3) $(srcdir)/macversion.py --version=$(MOZ_APP_VERSION) --buildid=$(DEPTH)/buildid.h)
82 .PHONY: repackage
83 tools repackage:: $(DIST)/bin/$(MOZ_APP_NAME) $(objdir)/macbuild/Contents/MacOS-files.txt
84 rm -rf $(dist_dest)
85 $(MKDIR) -p '$(dist_dest)/Contents/MacOS'
86 $(MKDIR) -p '$(dist_dest)/$(LPROJ)'
87 rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents '$(dist_dest)' --exclude English.lproj
88 rsync -a --exclude '*.in' $(srcdir)/macbuild/Contents/Resources/English.lproj/ '$(dist_dest)/$(LPROJ)'
89 $(call py_action,preprocessor Info.plist,-Fsubstitution -DAPP_VERSION='$(MOZ_APP_VERSION)' -DMOZ_APP_NAME='$(MOZ_APP_NAME)' -DMAC_APP_NAME='$(MAC_APP_NAME)' -DMOZ_MACBUNDLE_ID='$(MOZ_MACBUNDLE_ID)' -DMAC_BUNDLE_VERSION='$(MAC_BUNDLE_VERSION)' -DMOZ_DEVELOPER_REPO_PATH='$(topsrcdir)' -DMOZ_DEVELOPER_OBJ_PATH='$(topobjdir)' $(srcdir)/macbuild/Contents/Info.plist.in -o '$(dist_dest)/Contents/Info.plist')
90 $(call py_action,preprocessor InfoPlist.strings,-Fsubstitution --output-encoding utf-16 -DMAC_APP_NAME='$(MAC_APP_NAME)' $(srcdir)/macbuild/Contents/Resources/English.lproj/InfoPlist.strings.in -o '$(dist_dest)/$(LPROJ)/InfoPlist.strings')
91 rsync -a --exclude-from='$(objdir)/macbuild/Contents/MacOS-files.txt' $(DIST)/bin/ '$(dist_dest)/Contents/Resources'
92 rsync -a --include-from='$(objdir)/macbuild/Contents/MacOS-files.txt' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS'
93 # MacOS-files-copy.in is a list of files that should be copies rather
94 # than symlinks and placed in .app/Contents/MacOS.
95 rsync -aL --include-from='$(srcdir)/macbuild/Contents/MacOS-files-copy.in' --exclude '*' $(DIST)/bin/ '$(dist_dest)/Contents/MacOS'
96 $(RM) '$(dist_dest)/Contents/MacOS/$(MOZ_APP_NAME)'
97 rsync -aL $(DIST)/bin/$(MOZ_APP_NAME) '$(dist_dest)/Contents/MacOS'
98 cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/firefox.icns '$(dist_dest)/Contents/Resources/firefox.icns'
99 cp -RL $(topsrcdir)/$(MOZ_BRANDING_DIRECTORY)/document.icns '$(dist_dest)/Contents/Resources/document.icns'
100 $(MKDIR) -p '$(dist_dest)/Contents/Library/LaunchServices'
101 ifdef MOZ_UPDATER
102 mv -f '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater' '$(dist_dest)/Contents/Library/LaunchServices'
103 ln -s ../../../../Library/LaunchServices/org.mozilla.updater '$(dist_dest)/Contents/MacOS/updater.app/Contents/MacOS/org.mozilla.updater'
104 endif
105 printf APPLMOZB > '$(dist_dest)/Contents/PkgInfo'
106 endif