SUBDIRS = data po src

EXTRA_DIST = AUTHORS

{{if enable_i18n}}
DISTCLEANFILES = \
	intltool-extract \
	intltool-merge \
	intltool-update \
	po/.intltool-merge-cache

INTLTOOL_FILES = \
	intltool-extract.in \
	intltool-merge.in \
	intltool-update.in \
	$(NULL)

EXTRA_DIST += $(INTLTOOL_FILES)
{{end}}

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" $(SUBDIRS) \
		  | 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

GITIGNOREFILES = \
	**/*.swp \
	*.o \
	aclocal.m4 \
	build-aux \
	ChangeLog \
	config \
	config.h.in \
	gtk-doc.m4 \
	gtk-doc.make \
	INSTALL \
	$(NULL)

-include $(top_srcdir)/git.mk
