#
# cint binary archiver 
#

# readline
rm readline/*.o malloc/*.o glob/*.o malloc/*.o 

#include 
rm include/G__* include/\#* include/*~ include/*/*~ include/*/\#*

# demo
rm demo/*/G__*
rm demo/makecint/*/G__*
rm demo/makecint/*/*.o
rm demo/makecint/*/core
rm demo/*/core
rm -r demo/makecint/*/ptrepository
rm demo/\#* demo/*/\#* demo/*/*/\#*
rm demo/*~ demo/*/*~ demo/*/*/*~
rm platform/\#* platform/*/\#* platform/*/*/\#*
rm platform/*~ platform/*/*~ platform/*/*/*~
rm platform/symantec/symantec.tar.gz
(cd lib/WildCard && make clean)
(cd lib/xlib && make clean)

# lib
rm lib/*/\#* lib/*/*~ lib/*/G__*

# other
rm */\#* */*~ \#* *~

case $1 in
nt)
	tar cvf cintnt.tar CINT* include/* src/*
	compress cintnt.tar
	;;
*) 
	tar cvf cintbin.tar MAKEINFO src/*.a src/*.h main/*.o main/*.c G__ci.h lib README* include stl doc readline/*.a readline/doc/* demo makecint cint ifdef

   case $1 in
   compress)
	rm cintbin.tar.Z
	compress cintbin.tar 
	ls -l cintbin.tar.Z
	echo
	echo Now cint system is packed into a file cintbin.tar.Z
	echo Copy it to your system, do 
	echo '$ zcat cintbin.tar.Z | tar xf -'
	echo '$ sh setup' 
	echo and add the directory to the command path. Then you can utilize
	echo full functionality of the cint.
	echo 
	;;
   *)
	rm cintbin.tar.gz
	gzip cintbin.tar 
	ls -l cintbin.tar.gz
	echo
	echo Now cint system is packed into a file cintbin.tar.gz
	echo Copy it to your system, do 
	echo '$ gunzip -c cintbin.tar.gz | tar xvf -'
	echo and add the directory to the command path. Then you can utilize
	echo full functionality of the cint.
	echo 
	case $1 in 
	encode) 
		uuencode cintbin.tar.gz cintbin.tar.gz > cintbin.tar.gz.en
		ll cintbin.tar.gz.en
		echo '$ uudecode cintbin.tar.gz.en' 
		;;
	esac
	;;
   esac
	;;
esac
