#!/bin/sh

set -x

if [ `uname` = "SunOS" ] ; then
  TAR=gtar
  CP="cp -r"
elif [ `uname` = "Darwin" ] ; then
  TAR=tar
  CP="cp -RPp"
else
  TAR=tar
  CP="cp -a"
fi


# Copy all files pertaining to nxviewer
# to a temporary directory.

mkdir t 2>/dev/null

cd t 2>/dev/null || exit

$CP ../nxviewer . || exit

# Clean all in nxviewer directory.

cd nxviewer || exit

make distclean

cd ..

# Make the tarfile.

$TAR zcvf ../nxviewer-XXX.tar.gz nxviewer
