Makefile.in 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  1. # vim:set ts=8 sw=8 sts=8 noet:
  2. # This Source Code Form is subject to the terms of the Mozilla Public
  3. # License, v. 2.0. If a copy of the MPL was not distributed with this
  4. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  5. include $(topsrcdir)/config/config.mk
  6. vpath %.xml @srcdir@/en-US/searchplugins
  7. vpath %.xml $(LOCALE_SRCDIR)/searchplugins
  8. ifdef LOCALE_MERGEDIR
  9. vpath book%.inc $(LOCALE_MERGEDIR)/browser/profile
  10. endif
  11. vpath book%.inc $(LOCALE_SRCDIR)/profile
  12. ifdef LOCALE_MERGEDIR
  13. vpath book%.inc @srcdir@/en-US/profile
  14. endif
  15. SUBMAKEFILES += \
  16. $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/Makefile \
  17. $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales/Makefile \
  18. $(NULL)
  19. # This makefile uses variable overrides from the libs-% target to
  20. # build non-default locales to non-default dist/ locations. Be aware!
  21. PWD := $(CURDIR)
  22. # These are defaulted to be compatible with the files the wget-en-US target
  23. # pulls. You may override them if you provide your own files. You _must_
  24. # override them when MOZ_PKG_PRETTYNAMES is defined - the defaults will not
  25. # work in that case.
  26. ZIP_IN ?= $(_ABS_DIST)/$(PACKAGE)
  27. WIN32_INSTALLER_IN ?= $(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
  28. RETRIEVE_WINDOWS_INSTALLER = 1
  29. MOZ_LANGPACK_EID=langpack-$(AB_CD)@palemoon.org
  30. L10N_PREF_JS_EXPORTS = $(call MERGE_FILE,palemoon-l10n.js)
  31. L10N_PREF_JS_EXPORTS_PATH = $(FINAL_TARGET)/$(PREF_DIR)
  32. L10N_PREF_JS_EXPORTS_FLAGS = $(PREF_PPFLAGS) --silence-missing-directive-warnings
  33. PP_TARGETS += L10N_PREF_JS_EXPORTS
  34. ifneq (,$(filter cocoa,$(MOZ_WIDGET_TOOLKIT)))
  35. MOZ_PKG_MAC_DSSTORE=$(_ABS_DIST)/branding/dsstore
  36. MOZ_PKG_MAC_BACKGROUND=$(_ABS_DIST)/branding/background.png
  37. MOZ_PKG_MAC_ICON=$(_ABS_DIST)/branding/disk.icns
  38. MOZ_PKG_MAC_EXTRA=--symlink "/Applications:/ "
  39. endif
  40. ifeq (WINNT,$(OS_ARCH))
  41. UNINSTALLER_PACKAGE_HOOK = $(RM) -r $(STAGEDIST)/uninstall; \
  42. $(NSINSTALL) -D $(STAGEDIST)/uninstall; \
  43. cp ../installer/windows/l10ngen/helper.exe $(STAGEDIST)/uninstall; \
  44. $(RM) $(_ABS_DIST)/l10n-stage/setup.exe; \
  45. cp ../installer/windows/l10ngen/setup.exe $(_ABS_DIST)/l10n-stage; \
  46. $(NULL)
  47. STUB_HOOK = $(NSINSTALL) -D "$(_ABS_DIST)/$(PKG_INST_PATH)"; \
  48. $(RM) "$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe"; \
  49. cp ../installer/windows/l10ngen/stub.exe "$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe"; \
  50. chmod 0755 "$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_STUB_BASENAME).exe"; \
  51. $(NULL)
  52. endif
  53. SEARCHPLUGINS_NAMES = $(shell cat $(call MERGE_FILE,/searchplugins/list.txt))
  54. SEARCHPLUGINS_PATH := $(FINAL_TARGET)/searchplugins
  55. SEARCHPLUGINS := $(addsuffix .xml,$(SEARCHPLUGINS_NAMES))
  56. # Some locale-specific search plugins may have preprocessor directives, but the
  57. # default en-US ones do not.
  58. SEARCHPLUGINS_FLAGS := --silence-missing-directive-warnings
  59. PP_TARGETS += SEARCHPLUGINS
  60. # Required for l10n.mk - defines a list of app sub dirs that should
  61. # be included in langpack xpis.
  62. DIST_SUBDIRS = $(DIST_SUBDIR)
  63. include $(topsrcdir)/config/rules.mk
  64. include $(MOZILLA_SRCDIR)/toolkit/locales/l10n.mk
  65. $(STAGEDIST): $(DIST)/branding
  66. $(DIST)/branding:
  67. $(NSINSTALL) -D $@
  68. PROFILE_FILES = \
  69. localstore.rdf \
  70. mimeTypes.rdf \
  71. $(NULL)
  72. PROFILE_CHROME = userChrome-example.css userContent-example.css
  73. NO_JA_JP_MAC_AB_CD := $(if $(filter ja-JP-mac, $(AB_CD)),ja,$(AB_CD))
  74. %/defaults/profile/bookmarks.html: bookmarks.inc generic/profile/bookmarks.html.in
  75. $(SYSINSTALL) -D $(dir $@)
  76. $(call py_action,preprocessor,$< -DAB_CD=$(NO_JA_JP_MAC_AB_CD) $(srcdir)/generic/profile/bookmarks.html.in -o $@)
  77. libs:: $(FINAL_TARGET)/defaults/profile/bookmarks.html ;
  78. libs:: $(addprefix generic/profile/,$(PROFILE_FILES))
  79. $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile
  80. libs:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
  81. $(SYSINSTALL) $(IFLAGS1) $^ $(FINAL_TARGET)/defaults/profile/chrome
  82. install:: $(DESTDIR)$(mozappdir)/defaults/profile/bookmarks.html ;
  83. install:: $(addprefix generic/profile/,$(PROFILE_FILES))
  84. $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile
  85. install:: $(call MERGE_FILES,$(addprefix profile/chrome/,$(PROFILE_CHROME)))
  86. $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/defaults/profile/chrome
  87. # metro build calls back here for search engine plugins
  88. searchplugins: $(addprefix $(FINAL_TARGET)/searchplugins/,$(SEARCHPLUGINS))
  89. .PHONY: searchplugins
  90. libs-%:
  91. $(NSINSTALL) -D $(DIST)/install
  92. @$(MAKE) -C $(DEPTH)/toolkit/locales libs-$*
  93. ifdef MOZ_SERVICES_SYNC
  94. @$(MAKE) -C $(DEPTH)/services/sync/locales AB_CD=$* XPI_NAME=locale-$*
  95. endif
  96. @$(MAKE) -C $(DEPTH)/extensions/spellcheck/locales AB_CD=$* XPI_NAME=locale-$*
  97. @$(MAKE) -C $(DEPTH)/intl/locales AB_CD=$* XPI_NAME=locale-$*
  98. ifdef MOZ_DEVTOOLS
  99. @$(MAKE) -C $(DEPTH)/devtools/client/locales AB_CD=$* XPI_NAME=locale-$*
  100. endif
  101. @$(MAKE) libs AB_CD=$* XPI_NAME=locale-$* PREF_DIR=$(PREF_DIR)
  102. @$(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY)/locales AB_CD=$* XPI_NAME=locale-$*
  103. repackage-win32-installer: WIN32_INSTALLER_OUT=$(_ABS_DIST)/$(PKG_INST_PATH)$(PKG_INST_BASENAME).exe
  104. repackage-win32-installer: $(call ESCAPE_WILDCARD,$(WIN32_INSTALLER_IN)) $(SUBMAKEFILES) libs-$(AB_CD)
  105. @echo "Repackaging $(WIN32_INSTALLER_IN) into $(WIN32_INSTALLER_OUT)."
  106. $(MAKE) -C $(DEPTH)/$(MOZ_BRANDING_DIRECTORY) export
  107. $(MAKE) -C ../installer/windows CONFIG_DIR=l10ngen l10ngen/setup.exe l10ngen/7zSD.sfx
  108. $(MAKE) repackage-zip \
  109. AB_CD=$(AB_CD) \
  110. MOZ_PKG_FORMAT=SFX7Z \
  111. ZIP_IN="$(WIN32_INSTALLER_IN)" \
  112. ZIP_OUT="$(WIN32_INSTALLER_OUT)" \
  113. SFX_HEADER="$(PWD)/../installer/windows/l10ngen/7zSD.sfx \
  114. $(topsrcdir)/browser/installer/windows/app.tag"
  115. ifeq (WINNT,$(OS_ARCH))
  116. repackage-win32-installer-%: $(STAGEDIST)
  117. @$(MAKE) repackage-win32-installer AB_CD=$* WIN32_INSTALLER_IN="$(WIN32_INSTALLER_IN)"
  118. repackage-zip-%: repackage-win32-installer-%
  119. else
  120. repackage-win32-installer-%: ;
  121. endif
  122. clobber-zip:
  123. $(RM) $(STAGEDIST)/chrome/$(AB_CD).jar \
  124. $(STAGEDIST)/chrome/$(AB_CD).manifest \
  125. $(STAGEDIST)/webapprt/chrome/$(AB_CD).jar \
  126. $(STAGEDIST)/webapprt/chrome/$(AB_CD).manifest \
  127. $(STAGEDIST)/$(PREF_DIR)/palemoon-l10n.js
  128. $(RM) -rf $(STAGEDIST)/searchplugins \
  129. $(STAGEDIST)/dictionaries \
  130. $(STAGEDIST)/hyphenation \
  131. $(STAGEDIST)/defaults/profile \
  132. $(STAGEDIST)/chrome/$(AB_CD) \
  133. $(STAGEDIST)/webapprt/chrome/$(AB_CD)
  134. langpack: langpack-$(AB_CD)
  135. # This is a generic target that will make a langpack, repack ZIP (+tarball)
  136. # builds, and repack an installer if applicable. It is called from the
  137. # tinderbox scripts. Alter it with caution.
  138. installers-%: clobber-% langpack-% repackage-win32-installer-% repackage-zip-%
  139. @echo "repackaging done"
  140. ifdef MOZ_UPDATER
  141. # Note that we want updater.ini to be in the top directory, not the browser/
  142. # subdirectory, because that's where the updater is installed and runs.
  143. libs:: $(call MERGE_FILE,updater/updater.ini) $(call mkdir_deps,$(DIST)/bin)
  144. ifeq ($(OS_ARCH),WINNT)
  145. cat $< $(srcdir)/../installer/windows/nsis/updater_append.ini | \
  146. sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
  147. sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
  148. $(FINAL_TARGET)/../updater.ini
  149. else
  150. cat $< | \
  151. sed -e "s/^InfoText=/Info=/" -e "s/^TitleText=/Title=/" | \
  152. sed -e "s/%MOZ_APP_DISPLAYNAME%/$(MOZ_APP_DISPLAYNAME)/" > \
  153. $(FINAL_TARGET)/../updater.ini
  154. endif
  155. endif
  156. ident:
  157. @printf "fx_revision "
  158. @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
  159. '$(STAGEDIST)'/application.ini App SourceStamp
  160. @printf "buildid "
  161. @$(PYTHON) $(topsrcdir)/config/printconfigsetting.py \
  162. '$(STAGEDIST)'/application.ini App BuildID
  163. merge-%:
  164. ifdef LOCALE_MERGEDIR
  165. $(RM) -rf $(LOCALE_MERGEDIR)
  166. MACOSX_DEPLOYMENT_TARGET= compare-locales -m $(LOCALE_MERGEDIR) $(srcdir)/l10n.ini $(L10NBASEDIR) $*
  167. endif
  168. @echo
  169. # test target, depends on make package
  170. # try to repack x-test, with just toolkit/defines.inc being there
  171. l10n-check:: INNER_UNMAKE_PACKAGE=true
  172. l10n-check::
  173. $(RM) -rf x-test
  174. $(NSINSTALL) -D x-test/toolkit
  175. echo "#define MOZ_LANG_TITLE Just testing" > x-test/toolkit/defines.inc
  176. $(MAKE) installers-x-test L10NBASEDIR="$(PWD)" LOCALE_MERGEDIR="$(PWD)/mergedir"
  177. $(PYTHON) $(MOZILLA_SRCDIR)/toolkit/mozapps/installer/unpack.py $(DIST)/l10n-stage/$(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)
  178. cd $(DIST)/l10n-stage && test $$(cat $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/update.locale) = x-test