#!/bin/sh

set -e 

if test "x$1" = "xclean" ; then 
    rm -rf	.libs		\
		.deps		\
		.bogus		\
		COPYING		\
		INSTALL		\
		Makefile.in	\
		Makefile	\
		aclocal.m4	\
		atconfig	\
		autom4te.cache	\
		config.guess	\
		config.hh.in	\
		config.hh	\
		config.log	\
		config.status	\
		config.sub	\
		configure	\
		depcomp		\
		install-sh	\
      		libltdl		\
		libtool		\
		ltmain.sh	\
		missing		\
		mkinstalldirs	\
		package.m4.in	\
		package.m4	\
		self		\
		stamp-h1	\
		testsuite.at	\
		super		\
		factory		\
		mybackend	\
		simple		\
		*.o		\
		*.lo		\
		*.la		\
		*~
		
  exit 0
fi

if test ! -f Makefile.am ; then 
    if test -f Makefile.tests ; then 
	mv Makefile.tests Makefile.am 
    else 
	echo "Makefile.tests not found - check the directory" 
	exit 1
    fi
fix
libtoolize --automake --ltdl
aclocal
automake -a 
autoconf
