DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc --enable-vala --enable-gi-system-install=no --with-ui --enable-tools

if HAVE_LIBXSLT
XSLT_DIR=libgda-xslt
XSLT_PC=libgda-xslt-$(GDA_ABI_VERSION).pc
endif

if HAVE_UI
UI_DIR=libgda-ui
UI_PC=libgda-ui-$(GDA_ABI_VERSION).pc
endif

if ENABLE_TOOLS
TOOLS_DIR=tools
if HAVE_UI
UI_TOOLS_DIR=control-center
endif
endif

SUBDIRS = \
	po \
	libgda \
	providers \
	libgda-report \
	$(XSLT_DIR) \
	$(UI_DIR) \
	$(TOOLS_DIR) \
	$(UI_TOOLS_DIR) \
	tests \
	testing \
	data \
	doc

example_files = \
	samples/SimpleExample/Makefile \
	samples/SimpleExample/example.c \
	samples/SimpleExample/README \
	samples/TableCopy/common.h \
	samples/TableCopy/common.c \
	samples/TableCopy/Makefile \
	samples/TableCopy/table-copy.c \
	samples/TableCopy/table-copy-easier.c \
	samples/TableCopy/README \
	samples/BDB/Makefile \
	samples/BDB/README \
	samples/BDB/access-custom.c \
	samples/BDB/access-raw.c \
	samples/BDB/common.h \
	samples/BDB/custom-bdb-model.c \
	samples/BDB/custom-bdb-model.h \
	samples/BDB/fill.c \
	samples/DirDataModel/Makefile \
	samples/DirDataModel/README \
	samples/DirDataModel/find-duplicates.c \
	samples/DDL/Makefile \
	samples/DDL/README \
	samples/DDL/ddl.c \
	samples/F-Spot/Makefile \
	samples/F-Spot/README \
	samples/F-Spot/VirtualConnectionSetup.dia \
	samples/F-Spot/repair-path.c \
	samples/README \
	samples/Report/customers-report.c \
	samples/Report/customers-report-docbook.c \
	samples/Report/customers-report-rml.c \
	samples/Report/customers-report-rml.rml \
	samples/Report/customers-report-spec.xml \
	samples/Report/schema-report.c \
	samples/Report/schema-report-spec.xml \
	samples/Report/Makefile \
	samples/Report/README \
	samples/Virtual/Makefile \
	samples/Virtual/README \
	samples/Virtual/city.csv \
	samples/Virtual/country.csv \
	samples/Virtual/virtual-test.c \
	samples/XSLT/Makefile \
	samples/XSLT/README \
	samples/XSLT/data.xml \
	samples/XSLT/data2.xml \
	samples/XSLT/test.xsl \
	samples/XSLT/transform.c \
	samples/MetaStore/Makefile \
	samples/MetaStore/README \
	samples/MetaStore/background.c \
	samples/MetaStore/example.c \
	samples/Tree/Makefile \
	samples/Tree/README \
	samples/Tree/example.c \
	samples/SqlBuilder/Makefile \
	samples/SqlBuilder/README \
	samples/SqlBuilder/example.c \
	samples/AsyncExec/Makefile \
	samples/AsyncExec/README \
	samples/AsyncExec/example.c \
	samples/WritableSelect/README \
	samples/WritableSelect/example.c \
	samples/WritableSelect/Makefile \
	samples/SimpleUIForm/README \
	samples/SimpleUIForm/example.c \
	samples/SimpleUIForm/Makefile \
	samples/SimpleUIForm/ScreenShot.png \
	samples/Blobs/blobtest.c \
	samples/Blobs/Makefile \
	samples/Blobs/README \
	samples/Blobs/testblob.db \
	samples/Gir/Makefile \
	samples/Gir/README \
	samples/Gir/libgda.js \
	samples/LdapBrowser/Makefile \
	samples/LdapBrowser/README \
	samples/LdapBrowser/ldap-browser.c \
	samples/CustomUIPlugin/Makefile \
	samples/CustomUIPlugin/README \
	samples/CustomUIPlugin/custom-entry-password.c \
	samples/CustomUIPlugin/custom-entry-password.h \
	samples/CustomUIPlugin/custom-entry-password.xml \
	samples/CustomUIPlugin/libmain.c

EXTRA_DIST = \
	COPYING \
	libgda.spec \
	intltool-extract.in \
	intltool-merge.in \
	intltool-update.in \
	$(example_files) \
	getsp.class \
	getsp.java

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 $(top_srcdir)/gitlog2changelog.py ) > 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

pkgconfigdir=$(libdir)/pkgconfig
pkgconfig_DATA = libgda-$(GDA_ABI_VERSION).pc libgda-report-$(GDA_ABI_VERSION).pc $(XSLT_PC) $(UI_PC)

all-local: libgda.spec

CLEANFILES = intltool-extract intltool-merge intltool-update

