1 # ***** BEGIN LICENSE BLOCK *****
2 # Version: MPL 1.1/GPL 2.0/LGPL 2.1
4 # The contents of this file are subject to the Mozilla Public License Version
5 # 1.1 (the "License"); you may not use this file except in compliance with
6 # the License. You may obtain a copy of the License at
7 # http://www.mozilla.org/MPL/
9 # Software distributed under the License is distributed on an "AS IS" basis,
10 # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11 # for the specific language governing rights and limitations under the
14 # The Original Code is Mozilla Communicator client code, released
17 # The Initial Developer of the Original Code is
18 # Netscape Communications Corporation.
19 # Portions created by the Initial Developer are Copyright (C) 1998
20 # the Initial Developer. All Rights Reserved.
23 # Benjamin Smedberg <bsmedberg@covad.net>
24 # Arthur Wiebe <artooro@gmail.com>
25 # Mark Mentovai <mark@moxienet.com>
27 # Alternatively, the contents of this file may be used under the terms of
28 # either of the GNU General Public License Version 2 or later (the "GPL"),
29 # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
30 # in which case the provisions of the GPL or the LGPL are applicable instead
31 # of those above. If you wish to allow use of your version of this file only
32 # under the terms of either the GPL or the LGPL, and not to allow others to
33 # use your version of this file under the terms of the MPL, indicate your
34 # decision by deleting the provisions above and replace them with the notice
35 # and other provisions required by the GPL or the LGPL. If you do not delete
36 # the provisions above, a recipient may use your version of this file under
37 # the terms of any one of the MPL, the GPL or the LGPL.
39 # ***** END LICENSE BLOCK *****
41 include $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/package-name.mk
43 # This is how we create the binary packages we release to the public.
46 ifeq (cocoa
,$(MOZ_WIDGET_TOOLKIT
))
49 ifeq (,$(filter-out OS2 WINNT WINCE BeOS
, $(OS_ARCH
)))
52 ifeq (,$(filter-out SunOS
, $(OS_ARCH
)))
55 ifeq (,$(filter-out gtk2 qt
, $(MOZ_WIDGET_TOOLKIT
)))
58 ifeq (Android
,$(OS_TARGET
))
67 endif # MOZ_PKG_FORMAT
72 ifneq (,$(filter WINNT WINCE
,$(OS_ARCH
)))
73 INSTALLER_DIR
= windows
75 ifneq (cocoa
,$(MOZ_WIDGET_TOOLKIT
))
81 PACKAGE
= $(PKG_PATH
)$(PKG_BASENAME
)$(PKG_SUFFIX
)
83 # By default, the SDK uses the same packaging type as the main bundle,
84 # but on mac it is a .tar.bz2
85 SDK_PATH
= $(PKG_PATH
)
86 ifeq ($(MOZ_APP_NAME
),xulrunner
)
89 SDK_SUFFIX
= $(PKG_SUFFIX
)
90 SDK
= $(SDK_PATH
)$(PKG_BASENAME
).sdk
$(SDK_SUFFIX
)
92 MAKE_PACKAGE
= $(error What is a
$(MOZ_PKG_FORMAT
) package format?
);
93 MAKE_CAB
= $(error Don
't know how to make a CAB!);
94 _ABS_DIST = $(call core_abspath,$(DIST))
97 ifndef WINCE_WINDOWS_MOBILE
101 CABARGS += -faststart
103 VSINSTALLDIR ?= $(error VSINSTALLDIR not set, must be set to the Visual Studio install directory)
104 MAKE_CAB = $(PYTHON) $(MOZILLA_DIR)/build/package/wince/make_wince_cab.py \
105 $(CABARGS) "$(VSINSTALLDIR)/SmartDevices/SDK/SDKTools/cabwiz.exe" \
106 "$(MOZ_PKG_DIR)" "$(MOZ_APP_DISPLAYNAME)" "$(PKG_PATH)$(PKG_BASENAME).cab"
109 CREATE_FINAL_TAR = $(TAR) -c --owner=0 --group=0 --numeric-owner \
111 UNPACK_TAR = tar -xf-
113 ifeq ($(MOZ_PKG_FORMAT),TAR)
115 INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) > $(PACKAGE)
116 INNER_UNMAKE_PACKAGE = $(UNPACK_TAR) < $(UNPACKAGE)
117 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk > $(SDK)
119 ifeq ($(MOZ_PKG_FORMAT),TGZ)
121 INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) | gzip -vf9 > $(PACKAGE)
122 INNER_UNMAKE_PACKAGE = gunzip -c $(UNPACKAGE) | $(UNPACK_TAR)
123 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | gzip -vf9 > $(SDK)
125 ifeq ($(MOZ_PKG_FORMAT),BZ2)
126 PKG_SUFFIX = .tar.bz2
127 INNER_MAKE_PACKAGE = $(CREATE_FINAL_TAR) - $(MOZ_PKG_DIR) | bzip2 -vf > $(PACKAGE)
128 INNER_UNMAKE_PACKAGE = bunzip2 -c $(UNPACKAGE) | $(UNPACK_TAR)
129 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK)
131 ifeq ($(MOZ_PKG_FORMAT),ZIP)
133 INNER_MAKE_PACKAGE = $(ZIP) -r9D $(PACKAGE) $(MOZ_PKG_DIR)
134 INNER_UNMAKE_PACKAGE = $(UNZIP) $(UNPACKAGE)
135 MAKE_SDK = $(ZIP) -r9D $(SDK) $(MOZ_APP_NAME)-sdk
137 ifeq ($(MOZ_PKG_FORMAT),CAB)
139 INNER_MAKE_PACKAGE = $(MAKE_CAB)
140 INNER_UNMAKE_PACKAGE = $(error Unpacking CAB files is not supported)
142 ifeq ($(MOZ_PKG_FORMAT),SFX7Z)
144 INNER_MAKE_PACKAGE = rm -f app.7z && \
145 mv $(MOZ_PKG_DIR) core && \
146 $(CYGWIN_WRAPPER) 7z a -r -t7z app.7z -mx -m0=BCJ2 -m1=LZMA:d24 \
147 -m2=LZMA:d19 -m3=LZMA:d19 -mb0:1 -mb0s1:2 -mb0s2:3 && \
148 mv core $(MOZ_PKG_DIR) && \
149 cat $(SFX_HEADER) app.7z > $(PACKAGE) && \
150 chmod 0755 $(PACKAGE)
151 INNER_UNMAKE_PACKAGE = $(CYGWIN_WRAPPER) 7z x $(UNPACKAGE) && \
152 mv core $(MOZ_PKG_DIR)
154 ifeq ($(MOZ_PKG_FORMAT),APK)
156 # we have custom stuff for Android
159 JAVA_CLASSPATH = $(ANDROID_SDK)/android.jar
160 include $(topsrcdir)/config/android-common.mk
166 AndroidManifest.xml \
178 browserconfig.properties \
188 UPLOAD_EXTRA_FILES += gecko-unsigned-unaligned.apk
190 include $(topsrcdir)/ipc/app/defs.mk
193 DIST_FILES += $(MOZ_CHILD_PROCESS_NAME)
197 ABI_DIR = armeabi-v7a
203 INNER_MAKE_PACKAGE = \
204 make -C ../embedding/android gecko.ap_ && \
205 cp ../embedding/android/gecko.ap_ $(_ABS_DIST) && \
206 ( cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && \
208 mkdir -p lib/$(ABI_DIR) && \
210 mv lib/libmozutils.so lib/$(ABI_DIR) && \
212 for SOMELIB in lib/*.so ; \
214 printf "`basename $$SOMELIB`:`$(_ABS_DIST)/host/bin/file_id $$SOMELIB`\n" >> lib.id ; \
216 unzip -o $(_ABS_DIST)/gecko.ap_ && \
217 rm $(_ABS_DIST)/gecko.ap_ && \
218 $(ZIP) -r9D $(_ABS_DIST)/gecko.ap_ $(DIST_FILES) -x $(NON_DIST_FILES) ) && \
219 rm -f $(_ABS_DIST)/gecko.apk && \
220 $(APKBUILDER) $(_ABS_DIST)/gecko.apk -v $(APKBUILDER_FLAGS) -z $(_ABS_DIST)/gecko.ap_ -f $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/classes.dex && \
221 cp $(_ABS_DIST)/gecko.apk $(_ABS_DIST)/gecko-unsigned-unaligned.apk && \
222 $(JARSIGNER) $(_ABS_DIST)/gecko.apk && \
223 $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/gecko.apk $(PACKAGE)
224 INNER_UNMAKE_PACKAGE = \
225 mkdir $(MOZ_PKG_DIR) && \
226 cd $(MOZ_PKG_DIR) && \
227 $(UNZIP) $(UNPACKAGE) && \
228 mv lib/$(ABI_DIR)/*.so . && \
232 ifeq ($(MOZ_PKG_FORMAT),DMG)
235 _APPNAME = $(MOZ_APP_DISPLAYNAME)Debug.app
237 _APPNAME = $(MOZ_APP_DISPLAYNAME).app
241 _BINPATH = /$(_APPNAME)/Contents/MacOS
245 ifneq (,$(MOZ_PKG_MAC_DSSTORE))
246 PKG_DMG_FLAGS += --copy "$(MOZ_PKG_MAC_DSSTORE):/.DS_Store"
248 ifneq (,$(MOZ_PKG_MAC_BACKGROUND))
249 PKG_DMG_FLAGS += --mkdir /.background --copy "$(MOZ_PKG_MAC_BACKGROUND):/.background"
251 ifneq (,$(MOZ_PKG_MAC_ICON))
252 PKG_DMG_FLAGS += --icon "$(MOZ_PKG_MAC_ICON)"
254 ifneq (,$(MOZ_PKG_MAC_RSRC))
255 PKG_DMG_FLAGS += --resource "$(MOZ_PKG_MAC_RSRC)"
257 ifneq (,$(MOZ_PKG_MAC_EXTRA))
258 PKG_DMG_FLAGS += $(MOZ_PKG_MAC_EXTRA)
260 _ABS_MOZSRCDIR = $(shell cd $(MOZILLA_DIR) && pwd)
261 ifdef UNIVERSAL_BINARY
262 STAGEPATH = universal/
264 ifndef PKG_DMG_SOURCE
265 PKG_DMG_SOURCE = $(STAGEPATH)$(MOZ_PKG_DIR)
267 INNER_MAKE_PACKAGE = $(_ABS_MOZSRCDIR)/build/package/mac_osx/pkg-dmg \
268 --source "$(PKG_DMG_SOURCE)" --target "$(PACKAGE)" \
269 --volname "$(MOZ_APP_DISPLAYNAME)" $(PKG_DMG_FLAGS)
270 INNER_UNMAKE_PACKAGE = \
272 rm -rf $(_ABS_DIST)/unpack.tmp; \
273 mkdir -p $(_ABS_DIST)/unpack.tmp; \
274 $(_ABS_MOZSRCDIR)/build/package/mac_osx/unpack-diskimage $(UNPACKAGE) /tmp/$(MOZ_PKG_APPNAME)-unpack $(_ABS_DIST)/unpack.tmp; \
275 rsync -a "$(_ABS_DIST)/unpack.tmp/$(_APPNAME)" $(MOZ_PKG_DIR); \
276 test -n "$(MOZ_PKG_MAC_DSSTORE)" && \
277 rsync -a "$(_ABS_DIST)/unpack.tmp/.DS_Store" "$(MOZ_PKG_MAC_DSSTORE)"; \
278 test -n "$(MOZ_PKG_MAC_BACKGROUND)" && \
279 rsync -a "$(_ABS_DIST)/unpack.tmp/.background/`basename "$(MOZ_PKG_MAC_BACKGROUND)"`" "$(MOZ_PKG_MAC_BACKGROUND)"; \
280 test -n "$(MOZ_PKG_MAC_ICON)" && \
281 rsync -a "$(_ABS_DIST)/unpack.tmp/.VolumeIcon.icns" "$(MOZ_PKG_MAC_ICON)"; \
282 rm -rf $(_ABS_DIST)/unpack.tmp; \
283 if test -n "$(MOZ_PKG_MAC_RSRC)" ; then \
284 cp $(UNPACKAGE) $(MOZ_PKG_APPNAME).tmp.dmg && \
285 hdiutil unflatten $(MOZ_PKG_APPNAME).tmp.dmg && \
286 { /Developer/Tools/DeRez -skip plst -skip blkx $(MOZ_PKG_APPNAME).tmp.dmg > "$(MOZ_PKG_MAC_RSRC)" || { rm -f $(MOZ_PKG_APPNAME).tmp.dmg && false; }; } && \
287 rm -f $(MOZ_PKG_APPNAME).tmp.dmg; \
289 # The plst and blkx resources are skipped because they belong to each
290 # individual dmg and are created by hdiutil.
291 SDK_SUFFIX = .tar.bz2
292 SDK = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX)
293 ifeq ($(MOZ_APP_NAME),xulrunner)
294 SDK = $(SDK_PATH)$(MOZ_APP_NAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX)
296 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK)
305 components/*.manifest \
313 NON_OMNIJAR_FILES += \
315 defaults/pref/channel-prefs.js \
317 res/MainMenu.nib/\* \
321 rm -f omni.jar components/binary.manifest && \
322 grep -h '^binary-component
' components/*.manifest > binary.manifest ; \
323 sed -e 's
/^binary-component
/\
#binary-component/' components/components.manifest > components.manifest && \
324 mv components.manifest components
&& \
325 find . | xargs touch
-t
201001010000 && \
326 zip
-r9mX omni.jar
$(OMNIJAR_FILES
) -x
$(NON_OMNIJAR_FILES
) && \
327 $(OPTIMIZE_JARS_CMD
) --optimize
$(_ABS_DIST
)/jarlog
/ .
/ .
/ && \
328 mv binary.manifest components
&& \
329 printf
"manifest components/binary.manifest\n" > chrome.manifest
331 $(OPTIMIZE_JARS_CMD
) --deoptimize
$(_ABS_DIST
)/jarlog
/ .
/ .
/ && \
332 unzip
-o omni.jar
&& \
333 rm -f components
/binary.manifest
&& \
334 sed
-e
's/^\#binary-component/binary-component/' components
/components.manifest
> components.manifest
&& \
335 mv components.manifest components
337 MAKE_PACKAGE
= (cd
$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
) && $(PACK_OMNIJAR
)) && $(INNER_MAKE_PACKAGE
)
338 UNMAKE_PACKAGE
= $(INNER_UNMAKE_PACKAGE
) && (cd
$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
) && $(UNPACK_OMNIJAR
))
340 MAKE_PACKAGE
= $(INNER_MAKE_PACKAGE
)
341 UNMAKE_PACKAGE
= $(INNER_UNMAKE_PACKAGE
)
344 # dummy macro if we don't have PSM built
346 ifneq (1_
,$(if
$(CROSS_COMPILE
),1,0)_
$(UNIVERSAL_BINARY
))
348 SIGN_NSS
= @echo signing nss libraries
;
350 NSS_DLL_SUFFIX
= $(DLL_SUFFIX
)
351 ifdef UNIVERSAL_BINARY
352 NATIVE_ARCH
= $(shell uname
-p | sed
-e s
/powerpc
/ppc
/)
353 NATIVE_DIST
= $(DIST
:$(DEPTH
)/%=$(DEPTH
)/..
/$(NATIVE_ARCH
)/%)
354 SIGN_CMD
= $(NATIVE_DIST
)/bin
/run-mozilla.sh
$(NATIVE_DIST
)/bin
/shlibsign
-v
-i
356 ifeq ($(OS_ARCH
),OS2
)
357 # uppercase extension to get the correct output file from shlibsign
358 NSS_DLL_SUFFIX
= .DLL
359 SIGN_CMD
= $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/os2
/sign.cmd
$(DIST
)
361 SIGN_CMD
= $(RUN_TEST_PROGRAM
) $(DIST
)/bin
/shlibsign
$(BIN_SUFFIX
) -v
-i
365 SOFTOKN
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)softokn3
$(NSS_DLL_SUFFIX
)
366 NSSDBM
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)nssdbm3
$(NSS_DLL_SUFFIX
)
367 FREEBL
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl3
$(NSS_DLL_SUFFIX
)
368 FREEBL_32FPU
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_32fpu_3
$(DLL_SUFFIX
)
369 FREEBL_32INT
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_32int_3
$(DLL_SUFFIX
)
370 FREEBL_32INT64
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_32int64_3
$(DLL_SUFFIX
)
371 FREEBL_64FPU
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_64fpu_3
$(DLL_SUFFIX
)
372 FREEBL_64INT
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_64int_3
$(DLL_SUFFIX
)
374 SIGN_NSS
+= $(SIGN_CMD
) $(SOFTOKN
); \
375 $(SIGN_CMD
) $(NSSDBM
); \
376 if
test -f
$(FREEBL
); then
$(SIGN_CMD
) $(FREEBL
); fi
; \
377 if
test -f
$(FREEBL_32FPU
); then
$(SIGN_CMD
) $(FREEBL_32FPU
); fi
; \
378 if
test -f
$(FREEBL_32INT
); then
$(SIGN_CMD
) $(FREEBL_32INT
); fi
; \
379 if
test -f
$(FREEBL_32INT64
); then
$(SIGN_CMD
) $(FREEBL_32INT64
); fi
; \
380 if
test -f
$(FREEBL_64FPU
); then
$(SIGN_CMD
) $(FREEBL_64FPU
); fi
; \
381 if
test -f
$(FREEBL_64INT
); then
$(SIGN_CMD
) $(FREEBL_64INT
); fi
;
384 endif # !CROSS_COMPILE
414 chrome
/app-chrome.manifest \
416 components
/compreg.dat \
417 components
/xpti.dat \
423 # browser/locales/Makefile uses this makefile for its variable defs, but
424 # doesn't want the libs:: rule.
425 ifndef PACKAGER_NO_LIBS
429 DEFINES
+= -DDLL_PREFIX
=$(DLL_PREFIX
) -DDLL_SUFFIX
=$(DLL_SUFFIX
) -DBIN_SUFFIX
=$(BIN_SUFFIX
)
431 ifdef MOZ_PKG_REMOVALS
432 MOZ_PKG_REMOVALS_GEN
= removed-files
434 $(MOZ_PKG_REMOVALS_GEN
): $(MOZ_PKG_REMOVALS
) $(GLOBAL_DEPS
)
435 cat
$(MOZ_PKG_REMOVALS
) | \
436 sed
-e
's/^[ \t]*//' | \
437 $(PYTHON
) $(MOZILLA_DIR
)/config
/Preprocessor.py
-Fsubstitution
$(DEFINES
) $(ACDEFINES
) > $(MOZ_PKG_REMOVALS_GEN
)
439 GARBAGE
+= $(MOZ_PKG_REMOVALS_GEN
)
442 GARBAGE
+= $(DIST
)/$(PACKAGE
) $(PACKAGE
)
444 ifeq ($(OS_ARCH
),IRIX
)
447 ifeq ($(OS_ARCH
),BeOS
)
449 PLATFORM_EXCLUDE_LIST
= ! -name
"*.stub" ! -name
"$(MOZ_PKG_APPNAME)-bin"
451 ifeq ($(OS_ARCH
),OS2
)
452 STRIP
= $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/os2
/strip.cmd
454 PLATFORM_EXCLUDE_LIST
= ! -name
"*.ico" ! -name
"$(MOZ_PKG_APPNAME).exe"
457 ifneq (,$(filter WINNT WINCE OS2
,$(OS_ARCH
)))
463 # The following target stages files into two directories: one directory for
464 # core files, and one for optional extensions based on the information in
465 # the MOZ_PKG_MANIFEST file and the following vars:
466 # MOZ_NONLOCALIZED_PKG_LIST
467 # MOZ_LOCALIZED_PKG_LIST
468 # MOZ_OPTIONAL_PKG_LIST
472 # Define packager macro to work around make 3.81 backslash issue (bug #339933)
474 $(PERL
) -I
$(MOZILLA_DIR
)/xpinstall
/packager
-e
'use Packager; \
475 Packager::Copy($1,$2,$3,$4,$5,$6,$7);'
478 installer-stage
: stage-package
479 ifndef MOZ_PKG_MANIFEST
480 $(error MOZ_PKG_MANIFEST unspecified
!)
482 @
rm -rf
$(DEPTH
)/installer-stage
$(DIST
)/xpt
483 @echo
"Staging installer files..."
484 @
$(NSINSTALL
) -D
$(DEPTH
)/installer-stage
/core
486 @
(cd
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
) && $(PACK_OMNIJAR
))
488 @cp
-av
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/.
$(DEPTH
)/installer-stage
/core
489 ifdef MOZ_OPTIONAL_PKG_LIST
490 @
$(NSINSTALL
) -D
$(DEPTH
)/installer-stage
/optional
491 $(call PACKAGER_COPY
, "$(call core_abspath,$(DIST))",\
492 "$(call core_abspath,$(DEPTH)/installer-stage/optional)", \
493 "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1 \
494 $(foreach pkg
,$(MOZ_OPTIONAL_PKG_LIST
),$(PKG_ARG
)) )
495 @cd
$(DEPTH
)/installer-stage
/optional
/extensions
; find
-maxdepth
1 -mindepth
1 -exec
rm -r ..
/..
/core
/extensions
/{} \
;
498 stage-package
: $(MOZ_PKG_MANIFEST
) $(MOZ_PKG_REMOVALS_GEN
)
499 @
rm -rf
$(DIST
)/$(MOZ_PKG_DIR
) $(DIST
)/$(PKG_PATH
)$(PKG_BASENAME
).
tar $(DIST
)/$(PKG_PATH
)$(PKG_BASENAME
).dmg
$@
$(EXCLUDE_LIST
)
500 # NOTE: this must be a tar now that dist links into the tree so that we
501 # do not strip the binaries actually in the tree.
502 @echo
"Creating package directory..."
503 @mkdir
$(DIST
)/$(MOZ_PKG_DIR
)
504 ifndef UNIVERSAL_BINARY
505 # If UNIVERSAL_BINARY, the package will be made from an already-prepared
507 ifdef MOZ_PKG_MANIFEST
508 $(RM
) -rf
$(DIST
)/xpt
$(RM
) -rf
$(DIST
)/manifests
509 $(call PACKAGER_COPY
, "$(call core_abspath,$(DIST))",\
510 "$(call core_abspath,$(DIST)/$(MOZ_PKG_DIR))", \
511 "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1)
512 $(PERL
) $(MOZILLA_DIR
)/xpinstall
/packager
/xptlink.pl
-s
$(DIST
) -d
$(DIST
)/xpt
-f
$(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/components
-v
-x
"$(XPIDL_LINK)"
513 $(PYTHON
) $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/link-manifests.py \
514 $(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/components
/components.manifest \
515 $(patsubst %,$(DIST
)/manifests
/%/components
,$(MOZ_NONLOCALIZED_PKG_LIST
))
516 $(PYTHON
) $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/link-manifests.py \
517 $(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/chrome
/nonlocalized.manifest \
518 $(patsubst %,$(DIST
)/manifests
/%/chrome
,$(MOZ_NONLOCALIZED_PKG_LIST
))
519 $(PYTHON
) $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/link-manifests.py \
520 $(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/chrome
/localized.manifest \
521 $(patsubst %,$(DIST
)/manifests
/%/chrome
,$(MOZ_LOCALIZED_PKG_LIST
))
522 printf
"manifest components/interfaces.manifest\nmanifest components/components.manifest\nmanifest chrome/nonlocalized.manifest\nmanifest chrome/localized.manifest\n" > $(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/chrome.manifest
523 else # !MOZ_PKG_MANIFEST
524 ifeq ($(MOZ_PKG_FORMAT
),DMG
)
526 @cd
$(DIST
) && rsync
-auv
--copy-unsafe-links
$(_APPNAME
) $(MOZ_PKG_DIR
)
527 @echo
"Linking XPT files..."
529 @
$(NSINSTALL
) -D
$(DIST
)/xpt
530 @
($(XPIDL_LINK
) $(DIST
)/xpt
/$(MOZ_PKG_APPNAME
).xpt
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/components
/*.xpt
&& rm -f
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/components
/*.xpt
&& cp
$(DIST
)/xpt
/$(MOZ_PKG_APPNAME
).xpt
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/components
&& printf
"interfaces $(MOZ_PKG_APPNAME).xpt\n" >$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/components
/interfaces.manifest
) || echo No
*.xpt files found in
: $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/components
/. Continuing...
532 @cd
$(DIST
)/bin
&& tar $(TAR_CREATE_FLAGS
) - * |
(cd ..
/$(MOZ_PKG_DIR
); tar -xf
-)
535 @cd
$(DIST
)/bin
&& tar $(TAR_CREATE_FLAGS
) - * |
(cd ..
/$(MOZ_PKG_DIR
); tar -xf
-)
536 @echo
"Linking XPT files..."
538 @
$(NSINSTALL
) -D
$(DIST
)/xpt
539 @
($(XPIDL_LINK
) $(DIST
)/xpt
/$(MOZ_PKG_APPNAME
).xpt
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)/components
/*.xpt
&& rm -f
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)/components
/*.xpt
&& cp
$(DIST
)/xpt
/$(MOZ_PKG_APPNAME
).xpt
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)/components
&& printf
"interfaces $(MOZ_PKG_APPNAME).xpt\n" >$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)/components
/interfaces.manifest
) || echo No
*.xpt files found in
: $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)/components
/. Continuing...
541 endif # MOZ_PKG_MANIFEST
542 endif # UNIVERSAL_BINARY
543 $(OPTIMIZE_JARS_CMD
) --optimize
$(DIST
)/jarlog
/ $(DIST
)/bin
/chrome
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)/chrome
544 ifeq ($(USE_ELF_HACK
)$(HOST_OS_ARCH
)$(OS_ARCH
),1LinuxLinux
)
545 ifneq (,$(filter %86 x86_64 arm
,$(OS_TEST
)))
547 @echo
=== If you
get failures below
, please file a bug describing the error
548 @echo
=== and your environment \
(compiler and linker versions\
), and use
549 @echo
=== --disable-elf-hack until this is fixed.
551 cd
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
); find .
-name
"*$(DLL_SUFFIX)" | xargs
$(DEPTH
)/build
/unix
/elfhack
/elfhack
554 ifndef PKG_SKIP_STRIP
555 @echo
"Stripping package directory..."
556 @cd
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
); find .
! -type d \
566 ! -name
"*.properties" \
577 $(PLATFORM_EXCLUDE_LIST
) \
578 -exec
$(STRIP
) $(STRIP_FLAGS
) {} >/dev
/null
2>&1 \
;
581 ifdef UNIVERSAL_BINARY
582 # universal binaries will have had their .chk files removed prior to the unify
583 # step, and if they're also --disable-install-strip then they won't get
584 # re-signed in the block above.
586 endif # UNIVERSAL_BINARY
587 endif # PKG_SKIP_STRIP
588 @echo
"Removing unpackaged files..."
590 cd
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
); rm -rf
$(NO_PKG_FILES
)
592 ifdef MOZ_PKG_REMOVALS
593 $(SYSINSTALL
) $(IFLAGS1
) $(MOZ_PKG_REMOVALS_GEN
) $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)
594 endif # MOZ_PKG_REMOVALS
596 make-package
: stage-package
$(PACKAGE_XULRUNNER
)
597 @echo
"Compressing..."
598 $(NSINSTALL
) -D
$(DIST
)/$(PKG_PATH
)
599 cd
$(DIST
) && $(MAKE_PACKAGE
)
600 @echo
"$(BUILDID) $(MOZ_SOURCE_STAMP)" > $(DIST
)/$(PKG_PATH
)/$(PKG_BASENAME
).txt
602 # The install target will install the application to prefix/lib/appname-version
603 # In addition if INSTALL_SDK is set, it will install the development headers,
604 # libraries, and IDL files as follows:
605 # dist/include -> prefix/include/appname-version
606 # dist/idl -> prefix/share/idl/appname-version
607 # dist/sdk/lib -> prefix/lib/appname-devel-version/lib
608 # prefix/lib/appname-devel-version/* symlinks to the above directories
609 install:: stage-package
610 ifneq (,$(filter WINNT WINCE
,$(OS_ARCH
)))
611 $(error
"make install" is not supported on this platform. Use
"make package" instead.
)
613 ifeq (bundle
,$(MOZ_FS_LAYOUT
))
614 $(error
"make install" is not supported on this platform. Use
"make package" instead.
)
617 cd
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
) && $(PACK_OMNIJAR
)
619 $(NSINSTALL
) -D
$(DESTDIR
)$(installdir
)
620 (cd
$(DIST
)/$(MOZ_PKG_DIR
) && tar $(TAR_CREATE_FLAGS
) - .
) | \
621 (cd
$(DESTDIR
)$(installdir
) && tar -xf
-)
622 $(NSINSTALL
) -D
$(DESTDIR
)$(bindir)
623 $(RM
) -f
$(DESTDIR
)$(bindir)/$(MOZ_APP_NAME
)
624 ln
-s
$(installdir
)/$(MOZ_APP_NAME
) $(DESTDIR
)$(bindir)
625 ifdef INSTALL_SDK
# Here comes the hard part
626 $(NSINSTALL
) -D
$(DESTDIR
)$(includedir)
627 (cd
$(DIST
)/include && tar $(TAR_CREATE_FLAGS
) - .
) | \
628 (cd
$(DESTDIR
)$(includedir) && tar -xf
-)
629 $(NSINSTALL
) -D
$(DESTDIR
)$(idldir
)
630 (cd
$(DIST
)/idl
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
631 (cd
$(DESTDIR
)$(idldir
) && tar -xf
-)
632 # SDK directory is the libs + a bunch of symlinks
633 $(NSINSTALL
) -D
$(DESTDIR
)$(sdkdir
)/sdk
/lib
634 if
test -f
$(DIST
)/include/xpcom-config.h
; then \
635 $(SYSINSTALL
) $(IFLAGS1
) $(DIST
)/include/xpcom-config.h
$(DESTDIR
)$(sdkdir
); \
637 (cd
$(DIST
)/sdk
/lib
&& tar $(TAR_CREATE_FLAGS
) - .
) |
(cd
$(DESTDIR
)$(sdkdir
)/sdk
/lib
&& tar -xf
-)
638 $(RM
) -f
$(DESTDIR
)$(sdkdir
)/lib
$(DESTDIR
)$(sdkdir
)/bin
$(DESTDIR
)$(sdkdir
)/include $(DESTDIR
)$(sdkdir
)/include $(DESTDIR
)$(sdkdir
)/sdk
/idl
$(DESTDIR
)$(sdkdir
)/idl
639 ln
-s
$(sdkdir
)/sdk
/lib
$(DESTDIR
)$(sdkdir
)/lib
640 ln
-s
$(installdir
) $(DESTDIR
)$(sdkdir
)/bin
641 ln
-s
$(includedir) $(DESTDIR
)$(sdkdir
)/include
642 ln
-s
$(idldir
) $(DESTDIR
)$(sdkdir
)/idl
646 $(MAKE
) stage-package UNIVERSAL_BINARY
= STAGE_SDK
=1 MOZ_PKG_DIR
=sdk-stage
647 @echo
"Packaging SDK..."
648 $(RM
) -rf
$(DIST
)/$(MOZ_APP_NAME
)-sdk
649 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/bin
650 (cd
$(DIST
)/sdk-stage
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
651 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/bin
&& tar -xf
-)
652 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/host
/bin
653 (cd
$(DIST
)/host
/bin
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
654 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/host
/bin
&& tar -xf
-)
655 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/sdk
656 (cd
$(DIST
)/sdk
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
657 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/sdk
&& tar -xf
-)
658 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/include
659 (cd
$(DIST
)/include && tar $(TAR_CREATE_FLAGS
) - .
) | \
660 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/include && tar -xf
-)
661 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/idl
662 (cd
$(DIST
)/idl
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
663 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/idl
&& tar -xf
-)
664 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/lib
665 # sdk/lib is the same as sdk/sdk/lib
666 (cd
$(DIST
)/sdk
/lib
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
667 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/lib
&& tar -xf
-)
668 $(NSINSTALL
) -D
$(DIST
)/$(SDK_PATH
)
669 cd
$(DIST
) && $(MAKE_SDK
)
671 ifeq ($(OS_TARGET
), WINNT
)
672 INSTALLER_PACKAGE
= $(DIST
)/$(PKG_INST_PATH
)$(PKG_INST_BASENAME
).exe
674 ifeq ($(OS_TARGET
), WINCE
)
675 INSTALLER_PACKAGE
= $(DIST
)/$(PKG_PATH
)$(PKG_BASENAME
).cab
678 # These are necessary because some of our packages/installers contain spaces
679 # in their filenames and GNU Make's $(wildcard) function doesn't properly
682 space
= $(empty
) $(empty
)
683 QUOTED_WILDCARD
= $(if
$(wildcard $(subst $(space
),?
,$(1))),"$(1)")
685 # This variable defines which OpenSSL algorithm to use to
686 # generate checksums for files that we upload
687 CHECKSUM_ALGORITHM
= 'sha512'
689 # This variable defines where the checksum file will be located
690 CHECKSUM_FILE
= "$(DIST)/$(PKG_PATH)/$(PKG_BASENAME).checksums"
693 $(call QUOTED_WILDCARD
,$(DIST
)/$(PACKAGE
)) \
694 $(call QUOTED_WILDCARD
,$(INSTALLER_PACKAGE
)) \
695 $(call QUOTED_WILDCARD
,$(DIST
)/$(COMPLETE_MAR
)) \
696 $(call QUOTED_WILDCARD
,$(DIST
)/$(LANGPACK
)) \
697 $(call QUOTED_WILDCARD
,$(wildcard $(DIST
)/$(PARTIAL_MAR
))) \
698 $(call QUOTED_WILDCARD
,$(DIST
)/$(PKG_PATH
)$(TEST_PACKAGE
)) \
699 $(call QUOTED_WILDCARD
,$(DIST
)/$(PKG_PATH
)$(SYMBOL_ARCHIVE_BASENAME
).zip
) \
700 $(call QUOTED_WILDCARD
,$(DIST
)/$(SDK
)) \
701 $(call QUOTED_WILDCARD
,$(DIST
)/$(PKG_PATH
)/$(PKG_BASENAME
).txt
) \
702 $(if
$(UPLOAD_EXTRA_FILES
), $(foreach f
, $(UPLOAD_EXTRA_FILES
), $(wildcard $(DIST
)/$(f
))))
705 @
$(PYTHON
) $(MOZILLA_DIR
)/build
/checksums.py \
706 -o
$(CHECKSUM_FILE
) \
707 -d
$(CHECKSUM_ALGORITHM
) \
708 -s
$(call QUOTED_WILDCARD
,$(DIST
)) \
710 @echo
"CHECKSUM FILE START"
711 @cat
$(CHECKSUM_FILE
)
712 @echo
"CHECKSUM FILE END"
716 $(PYTHON
) $(MOZILLA_DIR
)/build
/upload.py
--base-path
$(DIST
) \
720 ifndef MOZ_PKG_SRCDIR
721 MOZ_PKG_SRCDIR
= $(topsrcdir
)
724 CREATE_SOURCE_TAR
= $(TAR
) -c
--owner
=0 --group
=0 --numeric-owner \
725 --mode
="go-w" --exclude
=".hg*" --exclude
="CVS" --exclude
=".cvs*" -f
727 # source-package creates a source tarball from the files in MOZ_PKG_SRCDIR,
728 # which is either set to a clean checkout or defaults to $topsrcdir
730 @echo
"Packaging source tarball..."
731 (cd
$(MOZ_PKG_SRCDIR
) && $(CREATE_SOURCE_TAR
) - .
) | bzip2
-vf
> $(DIST
)/$(PKG_SRCPACK_PATH
)$(PKG_SRCPACK_BASENAME
).
tar.bz2