ACLOCAL_AMFLAGS = -I m4

MAINTAINERCLEANFILES = \
	config.log config.status \
	$(srcdir)/Makefile.in \
	$(srcdir)/config.h.in $(srcdir)/config.h.in~ $(srcdir)/configure \
	$(srcdir)/install-sh $(srcdir)/ltmain.sh $(srcdir)/missing \
	$(srcdir)/depcomp $(srcdir)/aclocal.m4 \
	$(srcdir)/config.guess $(srcdir)/config.sub \
	$(srcdir)/m4/ltsugar.m4 $(srcdir)/m4/libtool.m4 \
	$(srcdir)/m4/ltversion.m4 $(srcdir)/m4/lt~obsolete.m4 \
	$(srcdir)/m4/ltoptions.m4 \
	$(srcdir)/packaged
EXTRA_DIST = Makefile.mak

DISTCHECK_CONFIGURE_FLAGS = --with-completiondir=/tmp

SUBDIRS = etc src win32 doc MacOSX tests

dist_noinst_SCRIPTS = bootstrap bootstrap.ci
dist_noinst_DATA = README \
	packaging/debian.templates/changelog \
	packaging/debian.templates/compat \
	packaging/debian.templates/control \
	packaging/debian.templates/copyright \
	packaging/debian.templates/docs \
	packaging/debian.templates/opensc.install \
	packaging/debian.templates/rules
dist_doc_DATA = NEWS

include $(top_srcdir)/aminclude_static.am
clean-local: code-coverage-clean
distclean-local: code-coverage-dist-clean

Generate-ChangeLog:
	rm -f ChangeLog.tmp "$(srcdir)/ChangeLog"
	test -n "$(GIT)"
	if test -d "$(top_srcdir)/.git"; then \
		echo "# Generated by Makefile. Do not edit!" > ChangeLog.tmp; \
		$(GIT) log >> ChangeLog.tmp; \
	else \
		echo "Warning: Unable to generate ChangeLog. Need a Git repostiroy." >&2; \
		echo > ChangeLog.tmp; \
	fi
	mv ChangeLog.tmp "$(srcdir)/ChangeLog"
	( cd "$(srcdir)" && autoreconf -ivf )
