#!/bin/tcsh -f

#######################################################################
# dar - disk archive - a backup/restoration program
# Copyright (C) 2002-2022 Denis Corbin
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
#
# to contact the author, see the AUTHOR file
#######################################################################

if(! -f configure) then
  echo "run this script from the root directory of CVS working directory"
  echo "which is where the 'configure' script resides"
  exit 1
endif

if("$1" == "" || "$2" == "" || "$3" == "") then
   echo "usage: $0 <version> <arch> <system>"
   echo "example : $0 2.0.0 sun4 Solaris"
   exit
endif

set filen="$1-$2-$3"

./configure CXXFLAGS=-O && make && mkdir dar-$filen && make DESTDIR=`pwd`/dar-$filen install-strip && tar -cf dar-$filen.tar dar-$filen && gzip -9 dar-$filen.tar || exit 1
make clean && make distclean || exit 1
# ./configure CXXFLAGS=-O --enable-mode=32 && make && mkdir dar32-$filen && make DESTDIR=`pwd`/dar32-$filen install-strip && tar -cf dar32-$filen.tar dar32-$filen && gzip -9 dar32-$filen.tar || exit 1
# make clean && make distclean || exit 1
./configure CXXFLAGS=-O --enable-mode=64 && make && mkdir dar64-$filen && make DESTDIR=`pwd`/dar64-$filen install-strip && tar -cf dar64-$filen.tar dar64-$filen && gzip -9 dar64-$filen.tar || exit 1
make clean && make distclean || exit 1

