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
, $(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) core && \
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 \
189 UPLOAD_EXTRA_FILES += gecko-unsigned-unaligned.apk
191 include $(topsrcdir)/ipc/app/defs.mk
194 DIST_FILES += $(MOZ_CHILD_PROCESS_NAME)
198 ABI_DIR = armeabi-v7a
204 INNER_MAKE_PACKAGE = \
205 make -C ../embedding/android gecko.ap_ && \
206 cp ../embedding/android/gecko.ap_ $(_ABS_DIST) && \
207 ( cd $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH) && \
209 mkdir -p lib/$(ABI_DIR) && \
211 mv lib/libmozutils.so lib/$(ABI_DIR) && \
213 for SOMELIB in lib/*.so ; \
215 printf "`basename $$SOMELIB`:`$(_ABS_DIST)/host/bin/file_id $$SOMELIB`\n" >> lib.id ; \
217 unzip -o $(_ABS_DIST)/gecko.ap_ && \
218 rm $(_ABS_DIST)/gecko.ap_ && \
219 $(ZIP) -r9D $(_ABS_DIST)/gecko.ap_ $(DIST_FILES) -x $(NON_DIST_FILES) ) && \
220 rm -f $(_ABS_DIST)/gecko.apk && \
221 $(APKBUILDER) $(_ABS_DIST)/gecko.apk -v $(APKBUILDER_FLAGS) -z $(_ABS_DIST)/gecko.ap_ -f $(STAGEPATH)$(MOZ_PKG_DIR)$(_BINPATH)/classes.dex && \
222 cp $(_ABS_DIST)/gecko.apk $(_ABS_DIST)/gecko-unsigned-unaligned.apk && \
223 $(JARSIGNER) $(_ABS_DIST)/gecko.apk && \
224 $(ZIPALIGN) -f -v 4 $(_ABS_DIST)/gecko.apk $(PACKAGE)
225 INNER_UNMAKE_PACKAGE = \
226 mkdir $(MOZ_PKG_DIR) && \
227 cd $(MOZ_PKG_DIR) && \
228 $(UNZIP) $(UNPACKAGE) && \
229 mv lib/$(ABI_DIR)/*.so . && \
233 ifeq ($(MOZ_PKG_FORMAT),DMG)
236 _APPNAME = $(MOZ_APP_DISPLAYNAME)Debug.app
238 _APPNAME = $(MOZ_APP_DISPLAYNAME).app
242 _BINPATH = /$(_APPNAME)/Contents/MacOS
246 ifneq (,$(MOZ_PKG_MAC_DSSTORE))
247 PKG_DMG_FLAGS += --copy "$(MOZ_PKG_MAC_DSSTORE):/.DS_Store"
249 ifneq (,$(MOZ_PKG_MAC_BACKGROUND))
250 PKG_DMG_FLAGS += --mkdir /.background --copy "$(MOZ_PKG_MAC_BACKGROUND):/.background"
252 ifneq (,$(MOZ_PKG_MAC_ICON))
253 PKG_DMG_FLAGS += --icon "$(MOZ_PKG_MAC_ICON)"
255 ifneq (,$(MOZ_PKG_MAC_RSRC))
256 PKG_DMG_FLAGS += --resource "$(MOZ_PKG_MAC_RSRC)"
258 ifneq (,$(MOZ_PKG_MAC_EXTRA))
259 PKG_DMG_FLAGS += $(MOZ_PKG_MAC_EXTRA)
261 _ABS_MOZSRCDIR = $(shell cd $(MOZILLA_DIR) && pwd)
262 ifdef UNIVERSAL_BINARY
263 STAGEPATH = universal/
265 ifndef PKG_DMG_SOURCE
266 PKG_DMG_SOURCE = $(STAGEPATH)$(MOZ_PKG_DIR)
268 INNER_MAKE_PACKAGE = $(_ABS_MOZSRCDIR)/build/package/mac_osx/pkg-dmg \
269 --source "$(PKG_DMG_SOURCE)" --target "$(PACKAGE)" \
270 --volname "$(MOZ_APP_DISPLAYNAME)" $(PKG_DMG_FLAGS)
271 INNER_UNMAKE_PACKAGE = \
273 rm -rf $(_ABS_DIST)/unpack.tmp; \
274 mkdir -p $(_ABS_DIST)/unpack.tmp; \
275 $(_ABS_MOZSRCDIR)/build/package/mac_osx/unpack-diskimage $(UNPACKAGE) /tmp/$(MOZ_PKG_APPNAME)-unpack $(_ABS_DIST)/unpack.tmp; \
276 rsync -a "$(_ABS_DIST)/unpack.tmp/$(_APPNAME)" $(MOZ_PKG_DIR); \
277 test -n "$(MOZ_PKG_MAC_DSSTORE)" && \
278 rsync -a "$(_ABS_DIST)/unpack.tmp/.DS_Store" "$(MOZ_PKG_MAC_DSSTORE)"; \
279 test -n "$(MOZ_PKG_MAC_BACKGROUND)" && \
280 rsync -a "$(_ABS_DIST)/unpack.tmp/.background/`basename "$(MOZ_PKG_MAC_BACKGROUND)"`" "$(MOZ_PKG_MAC_BACKGROUND)"; \
281 test -n "$(MOZ_PKG_MAC_ICON)" && \
282 rsync -a "$(_ABS_DIST)/unpack.tmp/.VolumeIcon.icns" "$(MOZ_PKG_MAC_ICON)"; \
283 rm -rf $(_ABS_DIST)/unpack.tmp; \
284 if test -n "$(MOZ_PKG_MAC_RSRC)" ; then \
285 cp $(UNPACKAGE) $(MOZ_PKG_APPNAME).tmp.dmg && \
286 hdiutil unflatten $(MOZ_PKG_APPNAME).tmp.dmg && \
287 { /Developer/Tools/DeRez -skip plst -skip blkx $(MOZ_PKG_APPNAME).tmp.dmg > "$(MOZ_PKG_MAC_RSRC)" || { rm -f $(MOZ_PKG_APPNAME).tmp.dmg && false; }; } && \
288 rm -f $(MOZ_PKG_APPNAME).tmp.dmg; \
290 # The plst and blkx resources are skipped because they belong to each
291 # individual dmg and are created by hdiutil.
292 SDK_SUFFIX = .tar.bz2
293 SDK = $(MOZ_PKG_APPNAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX)
294 ifeq ($(MOZ_APP_NAME),xulrunner)
295 SDK = $(SDK_PATH)$(MOZ_APP_NAME)-$(MOZ_PKG_VERSION).$(AB_CD).mac-$(TARGET_CPU).sdk$(SDK_SUFFIX)
297 MAKE_SDK = $(CREATE_FINAL_TAR) - $(MOZ_APP_NAME)-sdk | bzip2 -vf > $(SDK)
301 GENERATE_CACHE ?= true
308 components/*.manifest \
316 NON_OMNIJAR_FILES += \
318 defaults/pref/channel-prefs.js \
320 res/MainMenu.nib/\* \
324 rm -f omni.jar components/binary.manifest && \
325 grep -h '^binary-component
' components/*.manifest > binary.manifest ; \
326 sed -e 's
/^binary-component
/\
#binary-component/' components/components.manifest > components.manifest && \
327 mv components.manifest components
&& \
328 find . | xargs touch
-t
201001010000 && \
329 zip
-r9mX omni.jar
$(OMNIJAR_FILES
) -x
$(NON_OMNIJAR_FILES
) && \
330 $(GENERATE_CACHE
) && \
331 $(OPTIMIZE_JARS_CMD
) --optimize
$(_ABS_DIST
)/jarlog
/ .
/ .
/ && \
332 mv binary.manifest components
&& \
333 printf
"manifest components/binary.manifest\n" > chrome.manifest
335 $(OPTIMIZE_JARS_CMD
) --deoptimize
$(_ABS_DIST
)/jarlog
/ .
/ .
/ && \
336 unzip
-o omni.jar
&& \
337 rm -f components
/binary.manifest
&& \
338 sed
-e
's/^\#binary-component/binary-component/' components
/components.manifest
> components.manifest
&& \
339 mv components.manifest components
341 MAKE_PACKAGE
= (cd
$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
) && $(PACK_OMNIJAR
)) && $(INNER_MAKE_PACKAGE
)
342 UNMAKE_PACKAGE
= $(INNER_UNMAKE_PACKAGE
) && (cd
$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
) && $(UNPACK_OMNIJAR
))
344 MAKE_PACKAGE
= $(INNER_MAKE_PACKAGE
)
345 UNMAKE_PACKAGE
= $(INNER_UNMAKE_PACKAGE
)
348 # dummy macro if we don't have PSM built
350 ifneq (1_
,$(if
$(CROSS_COMPILE
),1,0)_
$(UNIVERSAL_BINARY
))
352 SIGN_NSS
= @echo signing nss libraries
;
354 NSS_DLL_SUFFIX
= $(DLL_SUFFIX
)
355 ifdef UNIVERSAL_BINARY
356 NATIVE_ARCH
= $(shell uname
-p | sed
-e s
/powerpc
/ppc
/)
357 NATIVE_DIST
= $(DIST
:$(DEPTH
)/%=$(DEPTH
)/..
/$(NATIVE_ARCH
)/%)
358 SIGN_CMD
= $(NATIVE_DIST
)/bin
/run-mozilla.sh
$(NATIVE_DIST
)/bin
/shlibsign
-v
-i
360 ifeq ($(OS_ARCH
),OS2
)
361 # uppercase extension to get the correct output file from shlibsign
362 NSS_DLL_SUFFIX
= .DLL
363 SIGN_CMD
= $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/os2
/sign.cmd
$(DIST
)
365 SIGN_CMD
= $(RUN_TEST_PROGRAM
) $(DIST
)/bin
/shlibsign
$(BIN_SUFFIX
) -v
-i
369 SOFTOKN
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)softokn3
$(NSS_DLL_SUFFIX
)
370 NSSDBM
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)nssdbm3
$(NSS_DLL_SUFFIX
)
371 FREEBL
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl3
$(NSS_DLL_SUFFIX
)
372 FREEBL_32FPU
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_32fpu_3
$(DLL_SUFFIX
)
373 FREEBL_32INT
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_32int_3
$(DLL_SUFFIX
)
374 FREEBL_32INT64
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_32int64_3
$(DLL_SUFFIX
)
375 FREEBL_64FPU
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_64fpu_3
$(DLL_SUFFIX
)
376 FREEBL_64INT
= $(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
)/$(DLL_PREFIX
)freebl_64int_3
$(DLL_SUFFIX
)
378 SIGN_NSS
+= $(SIGN_CMD
) $(SOFTOKN
); \
379 $(SIGN_CMD
) $(NSSDBM
); \
380 if
test -f
$(FREEBL
); then
$(SIGN_CMD
) $(FREEBL
); fi
; \
381 if
test -f
$(FREEBL_32FPU
); then
$(SIGN_CMD
) $(FREEBL_32FPU
); fi
; \
382 if
test -f
$(FREEBL_32INT
); then
$(SIGN_CMD
) $(FREEBL_32INT
); fi
; \
383 if
test -f
$(FREEBL_32INT64
); then
$(SIGN_CMD
) $(FREEBL_32INT64
); fi
; \
384 if
test -f
$(FREEBL_64FPU
); then
$(SIGN_CMD
) $(FREEBL_64FPU
); fi
; \
385 if
test -f
$(FREEBL_64INT
); then
$(SIGN_CMD
) $(FREEBL_64INT
); fi
;
388 endif # !CROSS_COMPILE
418 chrome
/app-chrome.manifest \
420 components
/compreg.dat \
421 components
/xpti.dat \
427 # browser/locales/Makefile uses this makefile for its variable defs, but
428 # doesn't want the libs:: rule.
429 ifndef PACKAGER_NO_LIBS
433 DEFINES
+= -DDLL_PREFIX
=$(DLL_PREFIX
) -DDLL_SUFFIX
=$(DLL_SUFFIX
) -DBIN_SUFFIX
=$(BIN_SUFFIX
)
435 ifdef MOZ_PKG_REMOVALS
436 MOZ_PKG_REMOVALS_GEN
= removed-files
438 $(MOZ_PKG_REMOVALS_GEN
): $(MOZ_PKG_REMOVALS
) $(GLOBAL_DEPS
)
439 cat
$(MOZ_PKG_REMOVALS
) | \
440 sed
-e
's/^[ \t]*//' | \
441 $(PYTHON
) $(MOZILLA_DIR
)/config
/Preprocessor.py
-Fsubstitution
$(DEFINES
) $(ACDEFINES
) > $(MOZ_PKG_REMOVALS_GEN
)
443 GARBAGE
+= $(MOZ_PKG_REMOVALS_GEN
)
446 GARBAGE
+= $(DIST
)/$(PACKAGE
) $(PACKAGE
)
448 ifeq ($(OS_ARCH
),IRIX
)
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
/{} \
;
501 @echo
=== If you
get failures below
, please file a bug describing the error
502 @echo
=== and your environment \
(compiler and linker versions\
), and use
503 @echo
=== --disable-elf-hack until this is fixed.
505 cd
$(DIST
)/bin
; find .
-name
"*$(DLL_SUFFIX)" | xargs
$(DEPTH
)/build
/unix
/elfhack
/elfhack
508 stage-package
: $(MOZ_PKG_MANIFEST
) $(MOZ_PKG_REMOVALS_GEN
) elfhack
509 @
rm -rf
$(DIST
)/$(MOZ_PKG_DIR
) $(DIST
)/$(PKG_PATH
)$(PKG_BASENAME
).
tar $(DIST
)/$(PKG_PATH
)$(PKG_BASENAME
).dmg
$@
$(EXCLUDE_LIST
)
510 # NOTE: this must be a tar now that dist links into the tree so that we
511 # do not strip the binaries actually in the tree.
512 @echo
"Creating package directory..."
513 @mkdir
$(DIST
)/$(MOZ_PKG_DIR
)
514 ifndef UNIVERSAL_BINARY
515 # If UNIVERSAL_BINARY, the package will be made from an already-prepared
517 ifdef MOZ_PKG_MANIFEST
518 $(RM
) -rf
$(DIST
)/xpt
$(DIST
)/manifests
519 $(call PACKAGER_COPY
, "$(call core_abspath,$(DIST))",\
520 "$(call core_abspath,$(DIST)/$(MOZ_PKG_DIR))", \
521 "$(MOZ_PKG_MANIFEST)", "$(PKGCP_OS)", 1, 0, 1)
522 $(PERL
) $(MOZILLA_DIR
)/xpinstall
/packager
/xptlink.pl
-s
$(DIST
) -d
$(DIST
)/xpt
-f
$(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/components
-v
-x
"$(XPIDL_LINK)"
523 $(PYTHON
) $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/link-manifests.py \
524 $(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/components
/components.manifest \
525 $(patsubst %,$(DIST
)/manifests
/%/components
,$(MOZ_NONLOCALIZED_PKG_LIST
))
526 $(PYTHON
) $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/link-manifests.py \
527 $(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/chrome
/nonlocalized.manifest \
528 $(patsubst %,$(DIST
)/manifests
/%/chrome
,$(MOZ_NONLOCALIZED_PKG_LIST
))
529 $(PYTHON
) $(MOZILLA_DIR
)/toolkit
/mozapps
/installer
/link-manifests.py \
530 $(DIST
)/$(MOZ_PKG_DIR
)/$(_BINPATH
)/chrome
/localized.manifest \
531 $(patsubst %,$(DIST
)/manifests
/%/chrome
,$(MOZ_LOCALIZED_PKG_LIST
))
532 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
533 else # !MOZ_PKG_MANIFEST
534 ifeq ($(MOZ_PKG_FORMAT
),DMG
)
536 @cd
$(DIST
) && rsync
-auv
--copy-unsafe-links
$(_APPNAME
) $(MOZ_PKG_DIR
)
537 @echo
"Linking XPT files..."
539 @
$(NSINSTALL
) -D
$(DIST
)/xpt
540 @
($(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...
542 @cd
$(DIST
)/bin
&& tar $(TAR_CREATE_FLAGS
) - * |
(cd ..
/$(MOZ_PKG_DIR
); tar -xf
-)
545 @cd
$(DIST
)/bin
&& tar $(TAR_CREATE_FLAGS
) - * |
(cd ..
/$(MOZ_PKG_DIR
); tar -xf
-)
546 @echo
"Linking XPT files..."
548 @
$(NSINSTALL
) -D
$(DIST
)/xpt
549 @
($(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...
551 endif # MOZ_PKG_MANIFEST
552 endif # UNIVERSAL_BINARY
553 $(OPTIMIZE_JARS_CMD
) --optimize
$(DIST
)/jarlog
/ $(DIST
)/bin
/chrome
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)/chrome
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
) make-sourcestamp-file
597 @echo
"Compressing..."
598 cd
$(DIST
) && $(MAKE_PACKAGE
)
600 make-sourcestamp-file
::
601 $(NSINSTALL
) -D
$(DIST
)/$(PKG_PATH
)
602 @echo
"$(BUILDID)" > $(MOZ_SOURCESTAMP_FILE
)
603 @echo
"$(MOZ_SOURCE_REPO)/rev/$(MOZ_SOURCE_STAMP)" >> $(MOZ_SOURCESTAMP_FILE
)
605 # The install target will install the application to prefix/lib/appname-version
606 # In addition if INSTALL_SDK is set, it will install the development headers,
607 # libraries, and IDL files as follows:
608 # dist/include -> prefix/include/appname-version
609 # dist/idl -> prefix/share/idl/appname-version
610 # dist/sdk/lib -> prefix/lib/appname-devel-version/lib
611 # prefix/lib/appname-devel-version/* symlinks to the above directories
612 install:: stage-package
613 ifneq (,$(filter WINNT WINCE
,$(OS_ARCH
)))
614 $(error
"make install" is not supported on this platform. Use
"make package" instead.
)
616 ifeq (bundle
,$(MOZ_FS_LAYOUT
))
617 $(error
"make install" is not supported on this platform. Use
"make package" instead.
)
620 cd
$(DIST
)/$(STAGEPATH
)$(MOZ_PKG_DIR
)$(_BINPATH
) && $(PACK_OMNIJAR
)
622 $(NSINSTALL
) -D
$(DESTDIR
)$(installdir
)
623 (cd
$(DIST
)/$(MOZ_PKG_DIR
) && tar $(TAR_CREATE_FLAGS
) - .
) | \
624 (cd
$(DESTDIR
)$(installdir
) && tar -xf
-)
625 $(NSINSTALL
) -D
$(DESTDIR
)$(bindir)
626 $(RM
) -f
$(DESTDIR
)$(bindir)/$(MOZ_APP_NAME
)
627 ln
-s
$(installdir
)/$(MOZ_APP_NAME
) $(DESTDIR
)$(bindir)
628 ifdef INSTALL_SDK
# Here comes the hard part
629 $(NSINSTALL
) -D
$(DESTDIR
)$(includedir)
630 (cd
$(DIST
)/include && tar $(TAR_CREATE_FLAGS
) - .
) | \
631 (cd
$(DESTDIR
)$(includedir) && tar -xf
-)
632 $(NSINSTALL
) -D
$(DESTDIR
)$(idldir
)
633 (cd
$(DIST
)/idl
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
634 (cd
$(DESTDIR
)$(idldir
) && tar -xf
-)
635 # SDK directory is the libs + a bunch of symlinks
636 $(NSINSTALL
) -D
$(DESTDIR
)$(sdkdir
)/sdk
/lib
637 if
test -f
$(DIST
)/include/xpcom-config.h
; then \
638 $(SYSINSTALL
) $(IFLAGS1
) $(DIST
)/include/xpcom-config.h
$(DESTDIR
)$(sdkdir
); \
640 (cd
$(DIST
)/sdk
/lib
&& tar $(TAR_CREATE_FLAGS
) - .
) |
(cd
$(DESTDIR
)$(sdkdir
)/sdk
/lib
&& tar -xf
-)
641 $(RM
) -f
$(DESTDIR
)$(sdkdir
)/lib
$(DESTDIR
)$(sdkdir
)/bin
$(DESTDIR
)$(sdkdir
)/include $(DESTDIR
)$(sdkdir
)/include $(DESTDIR
)$(sdkdir
)/sdk
/idl
$(DESTDIR
)$(sdkdir
)/idl
642 ln
-s
$(sdkdir
)/sdk
/lib
$(DESTDIR
)$(sdkdir
)/lib
643 ln
-s
$(installdir
) $(DESTDIR
)$(sdkdir
)/bin
644 ln
-s
$(includedir) $(DESTDIR
)$(sdkdir
)/include
645 ln
-s
$(idldir
) $(DESTDIR
)$(sdkdir
)/idl
649 $(MAKE
) stage-package UNIVERSAL_BINARY
= STAGE_SDK
=1 MOZ_PKG_DIR
=sdk-stage
650 @echo
"Packaging SDK..."
651 $(RM
) -rf
$(DIST
)/$(MOZ_APP_NAME
)-sdk
652 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/bin
653 (cd
$(DIST
)/sdk-stage
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
654 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/bin
&& tar -xf
-)
655 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/host
/bin
656 (cd
$(DIST
)/host
/bin
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
657 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/host
/bin
&& tar -xf
-)
658 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/sdk
659 (cd
$(DIST
)/sdk
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
660 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/sdk
&& tar -xf
-)
661 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/include
662 (cd
$(DIST
)/include && tar $(TAR_CREATE_FLAGS
) - .
) | \
663 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/include && tar -xf
-)
664 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/idl
665 (cd
$(DIST
)/idl
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
666 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/idl
&& tar -xf
-)
667 $(NSINSTALL
) -D
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/lib
668 # sdk/lib is the same as sdk/sdk/lib
669 (cd
$(DIST
)/sdk
/lib
&& tar $(TAR_CREATE_FLAGS
) - .
) | \
670 (cd
$(DIST
)/$(MOZ_APP_NAME
)-sdk
/lib
&& tar -xf
-)
671 $(NSINSTALL
) -D
$(DIST
)/$(SDK_PATH
)
672 cd
$(DIST
) && $(MAKE_SDK
)
674 ifeq ($(OS_TARGET
), WINNT
)
675 INSTALLER_PACKAGE
= $(DIST
)/$(PKG_INST_PATH
)$(PKG_INST_BASENAME
).exe
677 ifeq ($(OS_TARGET
), WINCE
)
678 INSTALLER_PACKAGE
= $(DIST
)/$(PKG_PATH
)$(PKG_BASENAME
).cab
681 # These are necessary because some of our packages/installers contain spaces
682 # in their filenames and GNU Make's $(wildcard) function doesn't properly
685 space
= $(empty
) $(empty
)
686 QUOTED_WILDCARD
= $(if
$(wildcard $(subst $(space
),?
,$(1))),"$(1)")
687 ESCAPE_SPACE
= $(subst $(space
),\
$(space
),$(1))
689 # This variable defines which OpenSSL algorithm to use to
690 # generate checksums for files that we upload
691 CHECKSUM_ALGORITHM
= 'sha512'
693 # This variable defines where the checksum file will be located
694 CHECKSUM_FILE
= "$(DIST)/$(PKG_PATH)/$(PKG_BASENAME).checksums"
697 $(call QUOTED_WILDCARD
,$(DIST
)/$(PACKAGE
)) \
698 $(call QUOTED_WILDCARD
,$(INSTALLER_PACKAGE
)) \
699 $(call QUOTED_WILDCARD
,$(DIST
)/$(COMPLETE_MAR
)) \
700 $(call QUOTED_WILDCARD
,$(DIST
)/$(LANGPACK
)) \
701 $(call QUOTED_WILDCARD
,$(wildcard $(DIST
)/$(PARTIAL_MAR
))) \
702 $(call QUOTED_WILDCARD
,$(DIST
)/$(PKG_PATH
)$(TEST_PACKAGE
)) \
703 $(call QUOTED_WILDCARD
,$(DIST
)/$(PKG_PATH
)$(SYMBOL_ARCHIVE_BASENAME
).zip
) \
704 $(call QUOTED_WILDCARD
,$(DIST
)/$(SDK
)) \
705 $(call QUOTED_WILDCARD
,$(MOZ_SOURCESTAMP_FILE
)) \
706 $(if
$(UPLOAD_EXTRA_FILES
), $(foreach f
, $(UPLOAD_EXTRA_FILES
), $(wildcard $(DIST
)/$(f
))))
709 @
$(PYTHON
) $(MOZILLA_DIR
)/build
/checksums.py \
710 -o
$(CHECKSUM_FILE
) \
711 -d
$(CHECKSUM_ALGORITHM
) \
712 -s
$(call QUOTED_WILDCARD
,$(DIST
)) \
714 @echo
"CHECKSUM FILE START"
715 @cat
$(CHECKSUM_FILE
)
716 @echo
"CHECKSUM FILE END"
720 $(PYTHON
) $(MOZILLA_DIR
)/build
/upload.py
--base-path
$(DIST
) \
724 ifndef MOZ_PKG_SRCDIR
725 MOZ_PKG_SRCDIR
= $(topsrcdir
)
728 DIR_TO_BE_PACKAGED ?
= ..
/$(notdir $(topsrcdir
))
729 SRC_TAR_EXCLUDE_PATHS
+= \
733 --exclude
=".mozconfig*" \
735 --exclude
="$(MOZILLA_DIR)/Makefile" \
736 --exclude
="$(MOZILLA_DIR)/dist"
738 SRC_TAR_EXCLUDE_PATHS
+= --exclude
="$(MOZ_OBJDIR)"
740 CREATE_SOURCE_TAR
= $(TAR
) -c
--owner
=0 --group
=0 --numeric-owner \
741 --mode
="go-w" $(SRC_TAR_EXCLUDE_PATHS
) -f
743 # source-package creates a source tarball from the files in MOZ_PKG_SRCDIR,
744 # which is either set to a clean checkout or defaults to $topsrcdir
746 @echo
"Packaging source tarball..."
747 mkdir
-p
$(DIST
)/$(PKG_SRCPACK_PATH
)
748 (cd
$(MOZ_PKG_SRCDIR
) && $(CREATE_SOURCE_TAR
) - $(DIR_TO_BE_PACKAGED
)) | bzip2
-vf
> $(DIST
)/$(PKG_SRCPACK_PATH
)$(PKG_SRCPACK_BASENAME
).
tar.bz2