1999-08-20 06:56:38 +04:00
#
2004-04-17 18:37:35 +04:00
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
# http://www.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is Mozilla Communicator client code, released
# March 31, 1998.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either of the GNU General Public License Version 2 or later (the "GPL"),
# or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
1999-08-20 06:56:38 +04:00
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
i n c l u d e $( DEPTH ) / c o n f i g / a u t o c o n f . m k
#
# This is how we create the Unix binary packages we release to the public.
# Currently the only format is tar.gz (TGZ), but it should be fairly easy
# to add .rpm (RPM) and .deb (DEB) later.
#
i f n d e f M O Z _ P K G _ F O R M A T
2003-03-25 09:59:54 +03:00
i f n e q ( , $( filter mac cocoa ,$ ( MOZ_WIDGET_TOOLKIT ) ) )
MOZ_PKG_FORMAT = DMG
e l s e
2002-10-25 08:33:14 +04:00
i f e q ( , $( filter -out OS 2 WINNT , $ ( OS_ARCH ) ) )
2002-01-08 11:56:29 +03:00
MOZ_PKG_FORMAT = ZIP
2003-10-07 00:39:30 +04:00
INSTALLER_DIR = windows
2002-01-08 11:56:29 +03:00
e l s e
2004-04-02 03:30:55 +04:00
i f e q ( , $( filter -out SunOS , $ ( OS_ARCH ) ) )
MOZ_PKG_FORMAT = BZ2
e l s e
1999-08-20 06:56:38 +04:00
MOZ_PKG_FORMAT = TGZ
2004-04-02 03:30:55 +04:00
e n d i f
2003-10-07 00:39:30 +04:00
INSTALLER_DIR = unix
1999-08-20 06:56:38 +04:00
e n d i f
2002-01-08 11:56:29 +03:00
e n d i f
2003-03-25 09:59:54 +03:00
e n d i f # MOZ_PKG_FORMAT
2001-01-23 18:53:12 +03:00
i f n d e f M O Z _ P K G _ A P P N A M E
2004-02-25 06:27:11 +03:00
MOZ_PKG_APPNAME = $( MOZ_APP_NAME)
2001-01-23 18:53:12 +03:00
e n d i f
2003-05-20 20:40:53 +04:00
i f n d e f S D K _ P K G _ A P P N A M E
SDK_PKG_APPNAME = gecko
e n d i f
2001-01-23 18:53:12 +03:00
MAKE_PACKAGE = echo " Sorry, don't know how to build a $( MOZ_PKG_FORMAT) file yet.... "
2003-02-01 01:56:32 +03:00
MAKE_SDK =
2001-01-23 18:53:12 +03:00
2004-08-19 05:11:18 +04:00
PKG_NAME_EXTRAS =
i f e q ( $( MOZ_ENABLE_XFT ) $( MOZ_WIDGET_TOOLKIT ) , 1 g t k 2 )
PKG_NAME_EXTRAS := $( PKG_NAME_EXTRAS) -gtk2+xft
e l s e
i f e q ( $( MOZ_ENABLE_XFT ) , 1 )
PKG_NAME_EXTRAS := $( PKG_NAME_EXTRAS) -xft
e l s e
i f e q ( $( MOZ_WIDGET_TOOLKIT ) , g t k 2 )
PKG_NAME_EXTRAS := $( PKG_NAME_EXTRAS) -gtk2
e n d i f
e n d i f
e n d i f
PKG_BASENAME := $( MOZ_PKG_APPNAME) -$( TARGET_CPU) -$( TARGET_VENDOR) -$( TARGET_OS) $( PKG_NAME_EXTRAS)
2001-01-23 18:53:12 +03:00
PACKAGE = $( PKG_BASENAME) $( PKG_SUFFIX)
1999-08-20 06:56:38 +04:00
2003-02-01 01:56:32 +03:00
SDK_DIR = sdk
2004-08-19 05:11:18 +04:00
SDK = $( SDK_PKG_APPNAME) -$( SDK_DIR) -$( TARGET_CPU) -$( TARGET_VENDOR) -$( TARGET_OS) $( PKG_NAME_EXTRAS) $( PKG_SUFFIX)
2003-02-01 01:56:32 +03:00
2001-03-13 06:45:26 +03:00
TAR_CREATE_FLAGS = -cvhf
2001-03-12 13:37:19 +03:00
i f e q ( $( OS_ARCH ) , B S D _ O S )
2001-03-13 06:45:26 +03:00
TAR_CREATE_FLAGS = -cvLf
2001-03-12 13:37:19 +03:00
e n d i f
2004-08-17 04:14:48 +04:00
CREATE_FINAL_TAR = tar -c --owner= 0 --group= 0 --numeric-owner --mode= "go-w" -f
2001-12-15 12:24:25 +03:00
i f e q ( $( MOZ_PKG_FORMAT ) , T A R )
PKG_SUFFIX = .tar
2004-08-17 04:14:48 +04:00
MAKE_PACKAGE = $( CREATE_FINAL_TAR) - $( MOZ_PKG_APPNAME) > $( PACKAGE)
MAKE_SDK = $( CREATE_FINAL_TAR) - $( SDK_PKG_APPNAME) -$( SDK_DIR) > $( SDK)
2001-12-15 12:24:25 +03:00
e n d i f
1999-08-20 06:56:38 +04:00
i f e q ( $( MOZ_PKG_FORMAT ) , T G Z )
PKG_SUFFIX = .tar.gz
2004-08-17 04:14:48 +04:00
MAKE_PACKAGE = $( CREATE_FINAL_TAR) - $( MOZ_PKG_APPNAME) | gzip -vf9 > $( PACKAGE)
MAKE_SDK = $( CREATE_FINAL_TAR) - $( SDK_PKG_APPNAME) -$( SDK_DIR) | gzip -vf9 > $( SDK)
2001-01-23 18:53:12 +03:00
e n d i f
i f e q ( $( MOZ_PKG_FORMAT ) , B Z 2 )
PKG_SUFFIX = .tar.bz2
2004-08-17 04:14:48 +04:00
MAKE_PACKAGE = $( CREATE_FINAL_TAR) - $( MOZ_PKG_APPNAME) | bzip2 -vf > $( PACKAGE)
MAKE_SDK = $( CREATE_FINAL_TAR) - $( SDK_PKG_APPNAME) -$( SDK_DIR) | bzip2 -vf > $( SDK)
1999-08-20 06:56:38 +04:00
e n d i f
2001-01-14 04:43:08 +03:00
i f e q ( $( MOZ_PKG_FORMAT ) , Z I P )
PKG_SUFFIX = .zip
2003-09-20 21:45:06 +04:00
MAKE_PACKAGE = $( ZIP) -r9D $( PACKAGE) $( MOZ_PKG_APPNAME)
MAKE_SDK = $( ZIP) -r9D $( SDK) $( SDK_PKG_APPNAME) -$( SDK_DIR)
2001-01-14 04:43:08 +03:00
e n d i f
2003-03-25 09:59:54 +03:00
i f e q ( $( MOZ_PKG_FORMAT ) , D M G )
i f n d e f M O Z _ P K G _ A P P N A M E
MOZ_PKG_APPNAME = Mozilla
e n d i f
i f d e f M O Z _ D E B U G
2004-06-08 03:58:59 +04:00
_APPNAME = $( MOZ_PKG_APPNAME) Debug.app
2003-03-25 09:59:54 +03:00
e l s e
2004-06-08 03:58:59 +04:00
_APPNAME = $( MOZ_PKG_APPNAME) .app
2003-03-25 09:59:54 +03:00
e n d i f
2004-06-08 09:49:50 +04:00
PKG_SUFFIX = .dmg.gz
2003-03-25 09:59:54 +03:00
_ABS_TOPSRCDIR = $( shell cd $( topsrcdir) && pwd )
2004-10-22 19:58:14 +04:00
MAKE_PACKAGE = $( _ABS_TOPSRCDIR) /build/package/mac_osx/make-diskimage $( PKG_BASENAME) .dmg $( MOZ_PKG_APPNAME) $( MOZ_PKG_APPNAME) && gzip -vf9 $( PKG_BASENAME) .dmg
2003-03-25 09:59:54 +03:00
MAKE_SDK =
e n d i f
1999-08-20 06:56:38 +04:00
i f e q ( $( MOZ_PKG_FORMAT ) , R P M )
PKG_SUFFIX = .rpm
e n d i f
i f e q ( $( MOZ_PKG_FORMAT ) , D E B )
PKG_SUFFIX = .deb
e n d i f
2003-05-21 05:01:28 +04:00
# dummy macro if we don't have PSM built
SIGN_NSS =
2004-02-21 01:14:14 +03:00
i f n d e f C R O S S _ C O M P I L E
2003-05-21 05:01:28 +04:00
i f d e f M O Z _ P S M
SIGN_NSS = @echo signing nss libraries;
2005-01-18 02:18:11 +03:00
SIGN_CMD = $( DIST) /bin/run-mozilla.sh $( DIST) /bin/shlibsign -v -i
2003-05-21 05:01:28 +04:00
SOFTOKN = $( DIST) /$( MOZ_PKG_APPNAME) /$( DLL_PREFIX) softokn3$( DLL_SUFFIX)
FREEBL_HYBRID = $( DIST) /$( MOZ_PKG_APPNAME) /$( DLL_PREFIX) freebl_hybrid_3$( DLL_SUFFIX)
FREEBL_PURE = $( DIST) /$( MOZ_PKG_APPNAME) /$( DLL_PREFIX) freebl_pure32_3$( DLL_SUFFIX)
SIGN_NSS += $( SIGN_CMD) $( SOFTOKN) ; \
if test -f $( FREEBL_HYBRID) ; then $( SIGN_CMD) $( FREEBL_HYBRID) ; fi ; \
if test -f $( FREEBL_PURE) ; then $( SIGN_CMD) $( FREEBL_PURE) ; fi ;
e n d i f # MOZ_PSM
2004-02-21 01:14:14 +03:00
e n d i f # !CROSS_COMPILE
2003-05-21 05:01:28 +04:00
2003-02-01 01:56:32 +03:00
TARGETS = $( PACKAGE) $( SDK)
1999-08-20 06:56:38 +04:00
NSPR_LDIR = $( findstring -L,$( NSPR_LIBS) )
i f n e q ( $( NSPR_LDIR ) , )
2001-04-07 15:10:58 +04:00
NSPR_LDIR = $( subst -L,,$( word 1,$( NSPR_LIBS) ) )
1999-08-20 06:56:38 +04:00
e n d i f
1999-08-24 03:46:37 +04:00
EXCLUDE_LIST = \
1999-08-20 06:56:38 +04:00
$( DIST) /bin/core \
$( DIST) /bin/bsdecho \
$( DIST) /bin/gtscc \
$( DIST) /bin/jscpucfg \
$( DIST) /bin/nsinstall \
1999-08-24 03:46:37 +04:00
$( DIST) /bin/viewer \
1999-08-20 06:56:38 +04:00
$( NULL)
2001-12-15 12:53:28 +03:00
libs :: $( TARGETS )
1999-08-20 06:56:38 +04:00
i n c l u d e $( topsrcdir ) / c o n f i g / r u l e s . m k
2003-02-01 01:56:32 +03:00
GARBAGE += $( DIST) /$( PACKAGE) $( PACKAGE) $( SDK)
1999-08-22 00:06:08 +04:00
2001-05-23 02:05:15 +04:00
OSPACKAGE = unix
2002-01-16 08:10:09 +03:00
i f d e f U S E _ S H O R T _ L I B N A M E
2004-01-26 03:40:13 +03:00
MOZILLA_BIN = $( DIST) /bin/$( MOZ_PKG_APPNAME) $( BIN_SUFFIX)
2002-01-16 08:10:09 +03:00
e l s e
2004-01-26 03:40:13 +03:00
MOZILLA_BIN = $( DIST) /bin/$( MOZ_PKG_APPNAME) -bin
2002-01-16 08:10:09 +03:00
e n d i f
2001-05-23 02:05:15 +04:00
1999-08-20 06:56:38 +04:00
i f e q ( $( OS_ARCH ) , I R I X )
STRIP_FLAGS = -f
e n d i f
2001-01-14 04:43:08 +03:00
i f e q ( $( OS_ARCH ) , B e O S )
STRIP_FLAGS = -g
2004-01-26 03:40:13 +03:00
PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name " $( MOZ_PKG_APPNAME) -bin "
2001-01-14 04:43:08 +03:00
e n d i f
2001-05-23 02:05:15 +04:00
i f e q ( $( OS_ARCH ) , O S 2 )
2002-10-29 09:19:39 +03:00
STRIP = $( srcdir) /os2/strip.cmd
STRIP_FLAGS =
2001-05-23 02:05:15 +04:00
OSPACKAGE = os2
2002-10-25 08:33:14 +04:00
TAR_CREATE_FLAGS = -cvf
2002-10-29 09:19:39 +03:00
PLATFORM_EXCLUDE_LIST = ! -name "*.ico"
2001-05-23 02:05:15 +04:00
e n d i f
1999-08-20 06:56:38 +04:00
2003-02-01 01:56:32 +03:00
$(SDK) :
2004-03-12 02:18:19 +03:00
i f n d e f N O _ G E C K O _ S D K
2003-03-25 09:59:54 +03:00
i f d e f M A K E _ S D K
2003-05-20 20:40:53 +04:00
@rm -rf $( DIST) /$( SDK_PKG_APPNAME) -$( SDK_DIR) $@
@mkdir $( DIST) /$( SDK_PKG_APPNAME) -$( SDK_DIR)
@cd $( DIST) /$( SDK_DIR) && tar $( TAR_CREATE_FLAGS) - * | ( cd ../$( SDK_PKG_APPNAME) -$( SDK_DIR) ; tar -xf -)
2003-02-13 23:25:42 +03:00
cd $( DIST) && $( MAKE_SDK)
2003-03-25 09:59:54 +03:00
e n d i f
2004-03-12 02:18:19 +03:00
e n d i f
2003-02-01 01:56:32 +03:00
2001-05-23 02:05:15 +04:00
$(PACKAGE) : $( MOZILLA_BIN )
2001-01-23 18:53:12 +03:00
@rm -rf $( DIST) /$( MOZ_PKG_APPNAME) $( DIST) /$( PKG_BASENAME) .tar $@ $( EXCLUDE_LIST)
2002-03-30 04:44:44 +03:00
# NOTE: this must be a tar now that dist links into the tree so that we
2000-11-29 03:48:47 +03:00
# do not strip the binaries actually in the tree.
@echo "Creating package directory..."
2002-03-30 04:44:44 +03:00
@mkdir $( DIST) /$( MOZ_PKG_APPNAME)
2003-03-25 09:59:54 +03:00
i f e q ( $( MOZ_PKG_FORMAT ) , D M G )
@cd $( DIST) && rsync -auvL $( _APPNAME) $( MOZ_PKG_APPNAME)
e l s e
2002-03-30 04:44:44 +03:00
@cd $( DIST) /bin && tar $( TAR_CREATE_FLAGS) - * | ( cd ../$( MOZ_PKG_APPNAME) ; tar -xf -)
2001-04-07 15:10:58 +04:00
i f d e f M O Z _ N A T I V E _ N S P R
i f n d e f E X C L U D E _ N S P R _ L I B S
@echo "Copying NSPR libs..."
@cp -p $( NSPR_LDIR) /*$( DLL_SUFFIX) $( DIST) /$( MOZ_PKG_APPNAME)
@chmod 755 $( DIST) /$( MOZ_PKG_APPNAME) /*$( DLL_SUFFIX)
e n d i f
2002-10-25 08:33:14 +04:00
e n d i f
2003-03-25 09:59:54 +03:00
e n d i f # DMG
2000-11-29 03:48:47 +03:00
@echo "Stripping package directory..."
2001-01-23 18:53:12 +03:00
@cd $( DIST) /$( MOZ_PKG_APPNAME) ; find . ! -type d \
2000-04-21 02:40:39 +04:00
! -name "*.js" \
! -name "*.xpt" \
! -name "*.gif" \
! -name "*.jpg" \
2000-10-27 13:52:31 +04:00
! -name "*.png" \
! -name "*.xpm" \
2000-04-21 02:40:39 +04:00
! -name "*.txt" \
! -name "*.rdf" \
! -name "*.sh" \
! -name "*.properties" \
! -name "*.dtd" \
! -name "*.html" \
! -name "*.xul" \
! -name "*.css" \
! -name "*.xml" \
2000-10-27 13:52:31 +04:00
! -name "*.jar" \
! -name "*.dat" \
! -name "*.tbl" \
! -name "*.src" \
! -name "*.reg" \
2001-01-23 18:34:56 +03:00
$( PLATFORM_EXCLUDE_LIST) \
2000-12-12 23:08:40 +03:00
-exec $( STRIP) $( STRIP_FLAGS) { } >/dev/null 2>& 1 \;
2003-05-21 05:01:28 +04:00
$( SIGN_NSS)
2004-02-11 03:56:17 +03:00
i f e q ( , $( filter mozilla firefox ,$ ( MOZ_PKG_APPNAME ) ) )
2001-01-23 18:53:12 +03:00
@echo " Creating start script $( MOZ_PKG_APPNAME) ... "
2003-03-15 04:04:32 +03:00
cd $( DIST) /$( MOZ_PKG_APPNAME) ; if [ -f mozilla ] ; then cp mozilla $( MOZ_PKG_APPNAME) ; fi
2004-03-24 22:22:52 +03:00
e n d i f
i f d e f N O _ P K G _ F I L E S
@echo "Removing unpackaged files..."
cd $( DIST) /$( MOZ_PKG_APPNAME) ; rm -rf $( NO_PKG_FILES)
1999-08-20 06:56:38 +04:00
e n d i f
2001-01-23 18:53:12 +03:00
@echo "Compressing..."
cd $( DIST) ; $( MAKE_PACKAGE)
2001-05-23 02:05:15 +04:00
dist : $( MOZILLA_BIN )
2001-01-23 18:53:12 +03:00
i f n d e f M O Z _ P K G _ D E S T
@echo "Please define MOZ_PKG_DEST first. It must be an absolute path to a dir outside the source tree. It should be empty (files might get deleted without warning)."
@echo "Other options (not required):"
2001-03-30 07:59:43 +04:00
@echo "MOZ_PKG_FORMAT: Either TGZ for .tar.gz or BZ2 for .tar.bz2. Default TGZ."
2001-01-23 18:53:12 +03:00
@echo "MOZ_PKG_APPNAME: Application name, used for tarball filename, top-level dir in tarball and application start script. Default mozilla."
e l s e
@if [ ! -d $( MOZ_PKG_DEST) ] ; then mkdir $( MOZ_PKG_DEST) ; fi
@cd $( MOZ_PKG_DEST) ; rm -rf bin $( MOZ_PKG_APPNAME) $( PACKAGE)
@echo " Creating distribution tarball in $( MOZ_PKG_DEST) ... "
2001-05-23 02:05:15 +04:00
$( PERL) $( srcdir) /pkgcp.pl --source $( DEPTH) /dist --destination $( MOZ_PKG_DEST) --file $( srcdir) /packages-$( OSPACKAGE) --os $( OSPACKAGE) --flat
2001-01-23 18:53:12 +03:00
@cd $( MOZ_PKG_DEST) ; mv bin $( MOZ_PKG_APPNAME)
i f n e q ( $( MOZ_PKG_APPNAME ) , m o z i l l a )
@echo " Creating start script $( MOZ_PKG_APPNAME) ... "
cd $( MOZ_PKG_DEST) /$( MOZ_PKG_APPNAME) ; cp mozilla $( MOZ_PKG_APPNAME)
1999-08-20 06:56:38 +04:00
e n d i f
2001-01-23 18:53:12 +03:00
@echo "Compressing..."
cd $( MOZ_PKG_DEST) ; $( MAKE_PACKAGE)
@echo "Deleting work files..."
@cd $( MOZ_PKG_DEST) ; rm -rf $( MOZ_PKG_APPNAME)
@echo " Done creating $( PACKAGE) . "
1999-08-20 06:56:38 +04:00
e n d i f
2004-05-18 02:13:40 +04:00
installer ::
2003-10-07 00:39:30 +04:00
i f d e f I N S T A L L E R _ D I R
make -C $( INSTALLER_DIR) installer
e n d i f