#! /bin/posh

# $Id: makedist 1330 2008-06-10 18:43:14Z wsl $
# $URL: http://rot.zo.oi/svn/wsl/src/unsort/makedist $

set -ex

cd "$1/src"

aclocal
autoconf
automake --add-missing
sh configure

make -s distcheck

echo print-archives: >>Makefile
echo '	@echo $(DIST_ARCHIVES)' >>Makefile
mv $(make -s print-archives) "$1/"

cd "$1"

rm -rf src
