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
2002-01-08 11:56:29 +03:00
i f e q ( $( OS_ARCH ) , W I N N T )
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
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
MAKE_PACKAGE = echo " Sorry, don't know how to build a $( MOZ_PKG_FORMAT) file yet.... "
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
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
2001-12-15 12:40:32 +03:00
MAKE_PACKAGE = tar $( TAR_CREATE_FLAGS) - $( MOZ_PKG_APPNAME) > $( PACKAGE)
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
2001-03-13 06:45:26 +03:00
MAKE_PACKAGE = tar $( TAR_CREATE_FLAGS) - $( MOZ_PKG_APPNAME) | gzip -vf9 > $( PACKAGE)
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
2001-03-13 06:45:26 +03:00
MAKE_PACKAGE = tar $( TAR_CREATE_FLAGS) - $( MOZ_PKG_APPNAME) | bzip2 -vf > $( PACKAGE)
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
2001-01-23 18:53:12 +03:00
MAKE_PACKAGE = $( ZIP) -vr9 $( PACKAGE) $( MOZ_PKG_APPNAME)
2001-01-14 04:43:08 +03:00
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
1999-08-22 00:06:08 +04:00
TARGETS = $( PACKAGE)
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
1999-08-22 00:06:08 +04:00
GARBAGE += $( DIST) /$( PACKAGE) $( PACKAGE)
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 )
STRIP = lxlite.exe
STRIP_FLAGS = -u
MOZILLA_BIN = $( DIST) /bin/mozilla$( BIN_SUFFIX)
OSPACKAGE = os2
e n d i f
1999-08-20 06:56:38 +04: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)
2000-11-29 03:48:47 +03:00
# NOTE: this must be a cp now that dist links into the tree so that we
# do not strip the binaries actually in the tree.
@echo "Creating package directory..."
2001-01-23 18:53:12 +03:00
@cp -rp ${ DIST } /bin $( DIST) /$( MOZ_PKG_APPNAME)
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
e n d i f
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 \;
2001-01-23 18:53:12 +03:00
i f n e q ( $( MOZ_PKG_APPNAME ) , m o z i l l a )
@echo " Creating start script $( MOZ_PKG_APPNAME) ... "
cd $( DIST) /$( 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 $( 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