1999-08-20 02:56:38 +00:00
#
1999-11-06 03:43:54 +00: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 02:56:38 +00:00
#
1999-11-06 03:43:54 +00: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 02:56:38 +00: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 03:43:54 +00:00
# Corporation. Portions created by Netscape are
# Copyright (C) 1998 Netscape Communications Corporation. All
# Rights Reserved.
#
# Contributor(s):
1999-08-20 02:56:38 +00: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-10-25 04:33:14 +00:00
i f e q ( , $( filter -out OS 2 WINNT , $ ( OS_ARCH ) ) )
2002-01-08 08:56:29 +00:00
MOZ_PKG_FORMAT = ZIP
e l s e
1999-08-20 02:56:38 +00:00
MOZ_PKG_FORMAT = TGZ
e n d i f
2002-01-08 08:56:29 +00:00
e n d i f
2001-01-23 15:53:12 +00: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.... "
2002-10-25 04:33:14 +00:00
i f e q ( $( MOZ_OS 2_TOOLS ) , V A C P P )
TARGET_OS = os2-vacpp
e n d i f
2001-11-14 01:22:10 +00:00
PKG_BASENAME := $( MOZ_PKG_APPNAME) -$( TARGET_CPU) -$( TARGET_VENDOR) -$( TARGET_OS)
2001-01-23 15:53:12 +00:00
PACKAGE = $( PKG_BASENAME) $( PKG_SUFFIX)
1999-08-20 02:56:38 +00:00
2001-03-13 03:45:26 +00:00
TAR_CREATE_FLAGS = -cvhf
2001-03-12 10:37:19 +00:00
i f e q ( $( OS_ARCH ) , B S D _ O S )
2001-03-13 03:45:26 +00:00
TAR_CREATE_FLAGS = -cvLf
2001-03-12 10:37:19 +00:00
e n d i f
2001-12-15 09:24:25 +00:00
i f e q ( $( MOZ_PKG_FORMAT ) , T A R )
PKG_SUFFIX = .tar
2002-03-30 01:44:44 +00:00
MAKE_PACKAGE = tar -cf - $( MOZ_PKG_APPNAME) > $( PACKAGE)
2001-12-15 09:24:25 +00:00
e n d i f
1999-08-20 02:56:38 +00:00
i f e q ( $( MOZ_PKG_FORMAT ) , T G Z )
PKG_SUFFIX = .tar.gz
2002-03-30 01:44:44 +00:00
MAKE_PACKAGE = tar -cf - $( MOZ_PKG_APPNAME) | gzip -vf9 > $( PACKAGE)
2001-01-23 15:53:12 +00:00
e n d i f
i f e q ( $( MOZ_PKG_FORMAT ) , B Z 2 )
PKG_SUFFIX = .tar.bz2
2002-03-30 01:44:44 +00:00
MAKE_PACKAGE = tar -cf - $( MOZ_PKG_APPNAME) | bzip2 -vf > $( PACKAGE)
1999-08-20 02:56:38 +00:00
e n d i f
2001-01-14 01:43:08 +00:00
i f e q ( $( MOZ_PKG_FORMAT ) , Z I P )
PKG_SUFFIX = .zip
2002-03-30 01:44:44 +00:00
MAKE_PACKAGE = $( ZIP) -r9 $( PACKAGE) $( MOZ_PKG_APPNAME)
2001-01-14 01:43:08 +00:00
e n d i f
1999-08-20 02:56:38 +00: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-21 20:06:08 +00:00
TARGETS = $( PACKAGE)
1999-08-20 02:56:38 +00:00
NSPR_LDIR = $( findstring -L,$( NSPR_LIBS) )
i f n e q ( $( NSPR_LDIR ) , )
2001-04-07 11:10:58 +00:00
NSPR_LDIR = $( subst -L,,$( word 1,$( NSPR_LIBS) ) )
1999-08-20 02:56:38 +00:00
e n d i f
1999-08-23 23:46:37 +00:00
EXCLUDE_LIST = \
1999-08-20 02:56:38 +00:00
$( DIST) /bin/core \
$( DIST) /bin/bsdecho \
$( DIST) /bin/gtscc \
$( DIST) /bin/jscpucfg \
$( DIST) /bin/nsinstall \
1999-08-23 23:46:37 +00:00
$( DIST) /bin/viewer \
1999-08-20 02:56:38 +00:00
$( NULL)
2001-12-15 09:53:28 +00:00
libs :: $( TARGETS )
1999-08-20 02:56:38 +00:00
i n c l u d e $( topsrcdir ) / c o n f i g / r u l e s . m k
1999-08-21 20:06:08 +00:00
GARBAGE += $( DIST) /$( PACKAGE) $( PACKAGE)
2001-05-22 22:05:15 +00:00
OSPACKAGE = unix
2002-01-16 05:10:09 +00: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-22 22:05:15 +00:00
MOZILLA_BIN = $( DIST) /bin/mozilla-bin
2002-01-16 05:10:09 +00:00
e n d i f
2001-05-22 22:05:15 +00:00
1999-08-20 02:56:38 +00:00
i f e q ( $( OS_ARCH ) , I R I X )
STRIP_FLAGS = -f
e n d i f
2001-01-14 01:43:08 +00:00
i f e q ( $( OS_ARCH ) , B e O S )
STRIP_FLAGS = -g
2001-01-23 15:34:56 +00:00
PLATFORM_EXCLUDE_LIST = ! -name "*.stub" ! -name "mozilla-bin"
2001-01-14 01:43:08 +00:00
e n d i f
2001-05-22 22:05:15 +00:00
i f e q ( $( OS_ARCH ) , O S 2 )
2002-10-25 04:33:14 +00:00
STRIP = dllrname.exe
STRIP_FLAGS = cpprmi36 = mozrmi36
2001-05-22 22:05:15 +00:00
OSPACKAGE = os2
2002-10-25 04:33:14 +00:00
TAR_CREATE_FLAGS = -cvf
2001-05-22 22:05:15 +00:00
e n d i f
1999-08-20 02:56:38 +00:00
2001-05-22 22:05:15 +00:00
$(PACKAGE) : $( MOZILLA_BIN )
2001-01-23 15:53:12 +00:00
@rm -rf $( DIST) /$( MOZ_PKG_APPNAME) $( DIST) /$( PKG_BASENAME) .tar $@ $( EXCLUDE_LIST)
2002-03-30 01:44:44 +00:00
# NOTE: this must be a tar now that dist links into the tree so that we
2000-11-29 00:48:47 +00:00
# do not strip the binaries actually in the tree.
@echo "Creating package directory..."
2002-03-30 01:44:44 +00:00
@mkdir $( DIST) /$( MOZ_PKG_APPNAME)
@cd $( DIST) /bin && tar $( TAR_CREATE_FLAGS) - * | ( cd ../$( MOZ_PKG_APPNAME) ; tar -xf -)
2001-04-07 11:10:58 +00: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 04:33:14 +00:00
e n d i f
i f e q ( $( MOZ_OS 2_TOOLS ) , V A C P P )
# Copy the C runtime
@cp -p $( VACPP365) /runtime/cpprmi36.dll $( DIST) /$( MOZ_PKG_APPNAME)
2001-04-07 11:10:58 +00:00
e n d i f
2000-11-29 00:48:47 +00:00
@echo "Stripping package directory..."
2001-01-23 15:53:12 +00:00
@cd $( DIST) /$( MOZ_PKG_APPNAME) ; find . ! -type d \
2000-04-20 22:40:39 +00:00
! -name "*.js" \
! -name "*.xpt" \
! -name "*.gif" \
! -name "*.jpg" \
2000-10-27 09:52:31 +00:00
! -name "*.png" \
! -name "*.xpm" \
2000-04-20 22:40:39 +00:00
! -name "*.txt" \
! -name "*.rdf" \
! -name "*.sh" \
! -name "*.properties" \
! -name "*.dtd" \
! -name "*.html" \
! -name "*.xul" \
! -name "*.css" \
! -name "*.xml" \
2000-10-27 09:52:31 +00:00
! -name "*.jar" \
! -name "*.dat" \
! -name "*.tbl" \
! -name "*.src" \
! -name "*.reg" \
2001-01-23 15:34:56 +00:00
$( PLATFORM_EXCLUDE_LIST) \
2000-12-12 20:08:40 +00:00
-exec $( STRIP) $( STRIP_FLAGS) { } >/dev/null 2>& 1 \;
2002-09-03 07:20:20 +00:00
i f e q ( , $( filter mozilla phoenix ,$ ( MOZ_PKG_APPNAME ) ) )
2001-01-23 15:53:12 +00:00
@echo " Creating start script $( MOZ_PKG_APPNAME) ... "
cd $( DIST) /$( MOZ_PKG_APPNAME) ; cp mozilla $( MOZ_PKG_APPNAME)
1999-08-20 02:56:38 +00:00
e n d i f
2001-01-23 15:53:12 +00:00
@echo "Compressing..."
cd $( DIST) ; $( MAKE_PACKAGE)
2001-05-22 22:05:15 +00:00
dist : $( MOZILLA_BIN )
2001-01-23 15:53:12 +00: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 03:59:43 +00:00
@echo "MOZ_PKG_FORMAT: Either TGZ for .tar.gz or BZ2 for .tar.bz2. Default TGZ."
2001-01-23 15:53:12 +00: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-22 22:05:15 +00:00
$( PERL) $( srcdir) /pkgcp.pl --source $( DEPTH) /dist --destination $( MOZ_PKG_DEST) --file $( srcdir) /packages-$( OSPACKAGE) --os $( OSPACKAGE) --flat
2001-01-23 15:53:12 +00: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 02:56:38 +00:00
e n d i f
2001-01-23 15:53:12 +00: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 02:56:38 +00:00
e n d i f