# -*-mode: makefile-*-
# Makefile.cvs
#
# Copyright 2002 Alan Eldridge. All rights reserved.
#
#
# 2002/09/29 alane@geeksrus.net
#

AUTOHEADER=	autoheader
AUTOCONF=	autoconf

ACLOCAL=	aclocal
AUTOMAKE=	automake
AUTOMAKE_ARGS=	-a --foreign -c

CLEANDIRS=	autom4te.cache
CLEANFILES=	Makefile	\
		Makefile.in	\
		aclocal.m4	\
		config.log	\
		config.status	\
		configure	\
		depcomp		\
		install.sh	\
		install-sh	\
		missing		\
		mkinstalldirs	\
		py-compile	\
		stamp-h.in

all: check clean prep

.PHONY:	check clean prep 
.PHONY:	aclocal autoheader automake autoconf stamp-h

check:
	test -f Makefile.am
	test -f configure.in -o -f configure.ac

clean:
	@-rm -fr $(CLEANDIRS) $(CLEANFILES) || true
	@-find . -name Makefile | xargs rm -f .nonexistent || true
	@-find . -name Makefile.in | xargs rm -f .nonexistent || true

prep:	aclocal autoheader automake autoconf stamp-h

aclocal:
	${ACLOCAL}

autoheader:
	-if cat configure.?? | grep -v '^#' \
		| fgrep 'AM_CONFIG_HEADER'; then $(AUTOHEADER); fi

automake:
	${AUTOMAKE} ${AUTOMAKE_ARGS}

autoconf:
	${AUTOCONF}

stamp-h:
	@echo timestamp > stamp-h.in
#EOF
