1999-08-20 06:56:38 +04:00
#
1999-11-06 06:43:54 +03:00
# The contents of this file are subject to the Netscape 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/NPL/
1999-08-20 06:56:38 +04:00
#
1999-11-06 06:43:54 +03:00
# 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.
1999-08-20 06:56:38 +04:00
#
# The Original Code is Mozilla Communicator client code,
# released March 31, 1998.
#
# The Initial Developer of the Original Code is Netscape Communications
1999-11-06 06:43:54 +03:00
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
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
e l s e
1999-08-20 06:56:38 +04:00
MOZ_PKG_FORMAT = TGZ
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
MOZ_PKG_APPNAME = mozilla
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
2001-11-14 04:22:10 +03:00
PKG_BASENAME := $( MOZ_PKG_APPNAME) -$( TARGET_CPU) -$( TARGET_VENDOR) -$( TARGET_OS)
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
2003-05-20 20:40:53 +04:00
SDK = $( SDK_PKG_APPNAME) -$( SDK_DIR) -$( TARGET_CPU) -$( TARGET_VENDOR) -$( TARGET_OS) $( 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
2001-12-15 12:24:25 +03:00
i f e q ( $( MOZ_PKG_FORMAT ) , T A R )
PKG_SUFFIX = .tar
2002-03-30 04:44:44 +03:00
MAKE_PACKAGE = tar -cf - $( MOZ_PKG_APPNAME) > $( PACKAGE)
2003-05-20 20:40:53 +04:00
MAKE_SDK = tar -cf - $( 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
2002-03-30 04:44:44 +03:00
MAKE_PACKAGE = tar -cf - $( MOZ_PKG_APPNAME) | gzip -vf9 > $( PACKAGE)
2003-05-20 20:40:53 +04:00
MAKE_SDK = tar -cf - $( 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
2002-03-30 04:44:44 +03:00
MAKE_PACKAGE = tar -cf - $( MOZ_PKG_APPNAME) | bzip2 -vf > $( PACKAGE)
2003-05-20 20:40:53 +04:00
MAKE_SDK = tar -cf - $( 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
2002-03-30 04:44:44 +03:00
MAKE_PACKAGE = $( ZIP) -r9 $( PACKAGE) $( MOZ_PKG_APPNAME)
2003-05-20 20:40:53 +04:00
MAKE_SDK = $( ZIP) -r9 $( 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
_APPNAME = MozillaDebug.app
e l s e
_APPNAME = Mozilla.app
e n d i f
PKG_SUFFIX = .dmg
_ABS_TOPSRCDIR = $( shell cd $( topsrcdir) && pwd )
MAKE_PACKAGE = $( _ABS_TOPSRCDIR) /build/package/mac_osx/make-diskimage $( PACKAGE) $( MOZ_PKG_APPNAME) $( MOZ_PKG_APPNAME)
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 =
i f d e f M O Z _ P S M
SIGN_NSS = @echo signing nss libraries;
SIGN_ENV = LD_LIBRARY_PATH = $( DIST) /bin:${ LD_LIBRARY_PATH } \
LD_LIBRARYN32_PATH = $( DIST) /bin:${ LD_LIBRARYN32_PATH } \
LD_LIBRARYN64_PATH = $( DIST) /bin:${ LD_LIBRARYN64_PATH } \
LD_LIBRARY_PATH_64 = $( DIST) /bin:${ LD_LIBRARY_PATH_64 } \
SHLIB_PATH = $( DIST) /bin:${ SHLIB_PATH } LIBPATH = $( DIST) /bin:${ LIBPATH } \
DYLD_LIBRARY_PATH = $( DIST) /bin:${ DYLD_LIBRARY_PATH } \
LIBRARY_PATH = $( DIST) /bin:${ LIBRARY_PATH }
SIGN_CMD = cd $( DIST) /$( MOZ_PKG_APPNAME) && $( SIGN_ENV) $( DIST) /bin/shlibsign -v -i
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
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
MOZILLA_BIN = $( DIST) /bin/mozilla$( BIN_SUFFIX)
e l s e
2001-05-23 02:05:15 +04:00
MOZILLA_BIN = $( DIST) /bin/mozilla-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
2001-01-23 18:34:56 +03:00
PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "mozilla-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) :
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
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)
2003-05-13 04:51:43 +04:00
i f e q ( , $( filter mozilla MozillaFirebird ,$ ( 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
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