# $Progeny$

.POSIX:

VPATH=			@srcdir@
builddir=		@builddir@
abs_builddir=		@abs_builddir@
top_builddir=		@top_builddir@
abs_top_builddir=	@abs_top_builddir@
srcdir=			@srcdir@
abs_srcdir=		@abs_srcdir@
top_srcdir=		@top_srcdir@
abs_top_srcdir=		@abs_top_srcdir@

all: config.ent

config.ent:
	rm -f $@
	for var in `sh ${top_builddir}/buildtools/config-script -l`; do		\
		val="`sh ${top_builddir}/buildtools/config-script --$${var}`";	\
		printf '<!ENTITY %s "%s">\n' $${var} "$${val}" >> $@;		\
	done

###############################################################################
# Clean

clean_FILES=		config.ent
distclean_FILES=	Makefile

clean:
	rm -f ${clean_FILES}

distclean:
	rm -f ${clean_FILES} ${distclean_FILES}

maintainer-clean:
	rm -f ${clean_FILES} ${distclean_FILES}

###############################################################################
# Installation

install:
uninstall:

###############################################################################
# Distribution

PACKAGE_TARNAME=	@PACKAGE_TARNAME@
PACKAGE_VERSION=	@PACKAGE_VERSION@

distname=		${PACKAGE_TARNAME}-${PACKAGE_VERSION}
distdir=		${top_builddir}/${distname}

DISTFILES=		Makefile.in \
			README \
			config.ent \
			docbook-article.ced \
			docbook-book.ced \
			docbook-sgml.ced \
			docbook.ced \
			docbook.ced \
			docbook.mk \
			ldp.dsl \
			man-wrapper.sh \
			progeny.dsl \
			progeny.ent

xsldir=xsl

DIST_xslfiles=${xsldir}/common.xsl \
			${xsldir}/fo.xsl \
			${xsldir}/html-common.xsl \
			${xsldir}/html-chunk.xsl \
			${xsldir}/html.xsl

distdir: ${DISTFILES}
	${top_srcdir}/buildtools/distdir ${distdir}/${_THISDIR_} ${DISTFILES}
	${top_srcdir}/buildtools/distdir ${distdir}/${_THISDIR_}/${xsldir} \
		${DIST_xslfiles}
