ACLOCAL_AMFLAGS = -I m4
SUBDIRS = src doc
EXTRA_DIST = \
	AUTHORS \
	tap-test \
	$(NULL)

pcfiledir = $(libdir)/pkgconfig
pcfile_DATA = libgrss.pc

DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-introspection

GITIGNOREFILES = \
	**/*.swp \
	*.o \
	m4/ \
	aclocal.m4 \
	build-aux \
	ChangeLog \
	compile \
	config \
	config.guess \
	config.h.in \
	config.sub \
	depcomp \
	gtk-doc.make \
	install-sh \
	ltmain.sh \
	missing \
	INSTALL \
	test-driver \
	tap-driver.sh \
	$(NULL)

AUTHORS:
	@if test -d "$(srcdir)/.git"; \
	then \
		echo Creating $@ && \
		( cd "$(top_srcdir)" && \
		  echo '# Generated by Makefile. Do not edit.'; echo; \
		  git log --no-merges --pretty=format:"%an" src \
		  | sort | uniq ) > $@.tmp \
		&& mv -f $@.tmp $@ \
		|| ( rm -f $@.tmp ; \
		     echo Failed to generate $@ >&2 ); \
	fi

dist-hook:
	@if test -d "$(srcdir)/.git"; \
	then \
		echo Creating ChangeLog && \
		( cd "$(top_srcdir)" && \
		  echo '# Generated by Makefile. Do not edit.'; echo; \
		  $(top_srcdir)/missing --run git log --stat ) > ChangeLog.tmp \
		&& mv -f ChangeLog.tmp $(top_distdir)/ChangeLog \
		|| ( rm -f ChangeLog.tmp ; \
		     echo Failed to generate ChangeLog >&2 ); \
	else \
		echo A git clone is required to generate a ChangeLog >&2; \
	fi

.PHONY: AUTHORS

-include $(top_srcdir)/git.mk
