EXTRA_DIST +=\
	examples/Makefile

bin_PROGRAMS +=\
	examples/copydatabase\
	examples/simpleexpand\
	examples/simpleindex\
	examples/simplesearch\
	examples/xapian-metadata\
	examples/xapian-pos

examples_copydatabase_SOURCES = examples/copydatabase.cc
examples_copydatabase_LDADD = $(libxapian_la)

examples_simpleexpand_SOURCES = examples/simpleexpand.cc
examples_simpleexpand_LDADD = $(libxapian_la)

examples_simpleindex_SOURCES = examples/simpleindex.cc
examples_simpleindex_LDADD = $(libxapian_la)

examples_simplesearch_SOURCES = examples/simplesearch.cc
examples_simplesearch_LDADD = $(libxapian_la)

examples_xapian_metadata_SOURCES = examples/xapian-metadata.cc
examples_xapian_metadata_LDADD = $(libxapian_la)

examples_xapian_pos_SOURCES = examples/xapian-pos.cc
examples_xapian_pos_LDADD = libgetopt.la $(libxapian_la)

if !MAINTAINER_NO_DOCS
dist_man_MANS +=\
	examples/copydatabase.1\
	examples/xapian-metadata.1\
	examples/xapian-pos.1
endif

if DOCUMENTATION_RULES
examples/copydatabase.1: examples/copydatabase$(EXEEXT) makemanpage
	./makemanpage examples/copydatabase $(srcdir)/examples/copydatabase.cc examples/copydatabase.1

examples/xapian-metadata.1: examples/xapian-metadata$(EXEEXT) makemanpage
	./makemanpage examples/xapian-metadata $(srcdir)/examples/xapian-metadata.cc examples/xapian-metadata.1

examples/xapian-pos.1: examples/xapian-pos$(EXEEXT) makemanpage
	./makemanpage examples/xapian-pos $(srcdir)/examples/xapian-pos.cc examples/xapian-pos.1
endif
