#!/bin/sh

# packs windows source tree for distribution.
# This script is only supposed to run on MY PERSONAL
# MACHINE. look into the subdirectories for portable build scripts.

pushd ..

VERSION=$( cat major_version ).$( cat minor_version )

TARGETDEV=/windows/G/ArmagetronDevel
TARGETBASE=$TARGETDEV/Source
UPLOAD=/abakus/home/manuel/C++/Armagetron/Upload

PACK=ArmagetronWinSource-$VERSION

cd $TARGETDEV

rm -rf $PACK

find Source -name tmp -exec rm -rf \{\} \; -depth
find Source -name Debug -exec rm -rf \{\} \; -depth
find Source -name Release -exec rm -rf \{\} \; -depth
find Source -name *.obj -exec rm -rf \{\} \;
find Source -name *.ncb -exec rm -rf \{\} \;

install -d $PACK
install -d $PACK/debug
install -d $PACK/dist

cp -ax Source/libs $PACK
cp -ax Source/libs_binonly $PACK
cp -ax Source/armagetron_work $PACK/armagetron
cp -ax Source/readme.txt $PACK

find $PACK -name CVS -exec rm -rf \{\} \; -depth
find $PACK -name cvs -exec rm -rf \{\} \; -depth
find $PACK -name *~ -exec rm -rf \{\} \; -depth
find $PACK -name .cvsignore -exec rm -rf \{\} \; -depth
find $PACK -name moviepack* -exec rm -rf \{\} \; -depth

zip -r $UPLOAD/$PACK.zip $PACK

popd
