# Maintainer's Makefile                                         -*-Makefile-*-

top_srcdir = ..
srcdir = .

SHELL = /bin/sh

all: README fnchange.lst

fnchange.lst: fnchange.in $(top_srcdir)/configure.ac
	rm -f $@; \
	PACKAGE=`grep "^PACKAGE=" $(top_srcdir)/configure.ac | sed -e 's/^PACKAGE=//'`; \
	VERSION=`grep "^VERSION=" $(top_srcdir)/configure.ac | sed -e 's/^VERSION=//'`; \
	sed \
	    -e '/^#/d' \
	    -e "s/@V@/$${PACKAGE}-$${VERSION}/g" \
	  $(srcdir)/fnchange.in > t-$@
	mv t-$@ $@

README: README.in $(top_srcdir)/configure.ac
	rm -f $@; \
	PACKAGE=`grep "^PACKAGE=" $(top_srcdir)/configure.ac | sed -e 's/^PACKAGE=//'`; \
	VERSION=`grep "^VERSION=" $(top_srcdir)/configure.ac | sed -e 's/^VERSION=//'`; \
	packageversion=`echo "$${VERSION}" | sed 's/\.//g'`; \
	treeversion=`echo "$${VERSION}" | sed 's/\.//g'`; \
	sed \
	    -e "s/@V@/$${PACKAGE}-$${VERSION}/g" \
	    -e "s/@VER@/$${VERSION}/g" \
	    -e "s/@packageversion@/$$packageversion/g" \
	    -e "s/@treeversion@/$$treeversion/g" \
	  $(srcdir)/README.in > t-$@
	mv t-$@ $@
