SUBDIRS = src data po doc
DIST_SUBDIRS = src data po doc

INTLTOOL_FILES =                \
  intltool-extract.in           \
  intltool-merge.in             \
  intltool-update.in

EXTRA_DIST =                    \
  $(gnome_calendardoc_DATA)     \
  $(INTLTOOL_FILES)             \
  INSTALL                       \
  THANKS                        \
  HACKING                       \
  TODO                          \
  autogen.sh

DISTCLEANFILES =                \
  intltool-extract              \
  intltool-merge                \
  intltool-update               \
  po/.intltool-merge-cache

DISTCHECK_CONFIGURE_FLAGS =     \
  --enable-appstream-util       \
  --disable-gtk-doc

# Remove doc directory on uninstall
uninstall-local:
	@if test -d "$(docdir)"; \
	then \
		-rm -r $(docdir); \
	fi

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; \
		  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
