## Process this file with automake to produce Makefile.in

EXTRA_PROGRAMS=refdbd refdbib refdbc refdba refdbxp eenc bib2ris
bin_PROGRAMS= @server_bins@ @client_bins@ @BIB2RIS@
BUILT_SOURCES=refdbd.h refstat.h svn_version.c svn_dist_version
EXTRA_DIST=refdbd.h.in refstat.h svn_dist_version
MAINTAINERCLEANFILES=refstat.h
CLEANFILES=refdbd.h

RISXVERSION = $(shell grep DOCTYPE $(srcdir)/../dtd/risx.dtd | sed 's%.*V\([^/]*\).*%\1%')
XNOTEVERSION = $(shell grep DOCTYPE $(srcdir)/../dtd/xnote.dtd | sed 's%.*V\([^/]*\).*%\1%')
CITESTYLEXVERSION = $(shell grep DOCTYPE $(srcdir)/../dtd/citestylex.dtd | sed 's%.*V\([^/]*\).*%\1%')
CITATIONLISTXVERSION = $(shell grep DOCTYPE $(srcdir)/../dtd/citationlistx.dtd | sed 's%.*V\([^/]*\).*%\1%')

refdba_SOURCES = refdba.c pref.c strfncs.c readln.c page.c refdb-client.c client-commands.c connect.c getopt.c tokenize.c readris.c linklist.c enigma.c cgi.c atoll.c passwd.c svn_version.c refdb.h refdba.h pref.h strfncs.h readln.h page.h refdb-client.h client-commands.h connect.h getopt.h tokenize.h readris.h linklist.h enigma.h cgi.h passwd.h

refdbib_SOURCES = refdbib.c getopt.c strfncs.c pref.c refdb-client.c connect.c page.c tokenize.c readris.c linklist.c enigma.c cgi.c atoll.c passwd.c svn_version.c refdb.h refdbib.h getopt.h strfncs.h pref.h refdb-client.h connect.h page.h tokenize.h readris.h linklist.h enigma.h cgi.h passwd.h outformats.h

refdbc_SOURCES = refdbc.c pref.c strfncs.c readln.c page.c refdb-client.c client-commands.c readris.c connect.c tokenize.c getopt.c linklist.c enigma.c cgi.c atoll.c passwd.c svn_version.c refdb.h refdbc.h pref.h strfncs.h readln.h page.h refdb-client.h client-commands.h readris.h connect.h tokenize.h getopt.h linklist.h enigma.h cgi.h passwd.h

refdbd_SOURCES = refdbd.c refdbdref.c refdbda.c refdbdbib.c pref.c strfncs.c tokenize.c connect.c risdb.c writeris.c getopt.c readris.c backend.c backend-scrn.c backend-ris.c backend-risx.c backend-mods.c backend-db31.c backend-teix.c backend-bibtex.c backend-html.c backend-dbib.c backend-dbiba.c backend-citationlistx.c backend-rtfbib.c linklist.c xmlhandler.c enigma.c cgi.c atoll.c dbfncs.c xmlout.c risxhandler.c authorinfo.c risdata.c noteshandler.c refdbdnote.c writenote.c backendn-scrn.c backendn-notex.c backendn-html.c xmlhelper.c rtfhelper.c mset.c refdbdgetref.c refdbdgetrefx.c refdbdupdb.c passwd.c refdbdcheckref.c svn_version.c refdb.h refdbd.h pref.h strfncs.h tokenize.h connect.h risdb.h writeris.h getopt.h readris.h backend.h backend-scrn.h backend-ris.h backend-risx.h backend-mods.h backend-db31.h backend-teix.h backend-bibtex.h backend-html.h backend-dbib.h backend-citationlistx.h backend-rtfbib.h linklist.h xmlhandler.h enigma.h cgi.h dbfncs.h xmlout.h risxhandler.h authorinfo.h risdata.h noteshandler.h writenote.h backendn-scrn.h backendn-notex.h xmlhelper.h rtfhelper.h backendn-html.h mset.h refdbdgetref.h refdbdgetrefx.h refdbdupdb.h passwd.h refdbdgetref.h refdbdcheckref.h outformats.h

refdbxp_SOURCES = refdbxp.c getopt.c strfncs.c svn_version.c getopt.h strfncs.h

eenc_SOURCES = eenc.c getopt.c enigma.c svn_version.c getopt.h enigma.h refdb.h

bib2ris_SOURCES = bib2ris.c getopt.c strfncs.c pref.c linklist.c cgi.c atoll.c svn_version.c bib2ris.h getopt.h strfncs.h pref.h linklist.h cgi.h

refdba_LDADD = @refdba_LDADD@
refdbc_LDADD = @refdbc_LDADD@
refdbd_LDADD = @refdbd_LDADD@ @LIBICONV@
bib2ris_LDADD = @bib2ris_LDADD@
main_db = @main_db@
main_meta = @main_meta@

AM_CPPFLAGS=-DSYSCONFDIR=\"$(sysconfdir)/@PACKAGE@\" -DULLSPEC=\"@ULLSPEC@\"

refdbd.h: refdbd.h.in
	sed 's%<risxversion>%$(RISXVERSION)%g' < $(top_srcdir)/src/refdbd.h.in | \
	sed 's%<xnoteversion>%$(XNOTEVERSION)%g' | \
	sed 's%<citestylexversion>%$(CITESTYLEXVERSION)%g' | \
	sed 's%<citationlistxversion>%$(CITATIONLISTXVERSION)%g' | \
	sed 's%<db_dir>%$(db_dir)%' | \
	sed 's%<main_db>%$(main_db)%' > refdbd.h

refstat.h: $(top_srcdir)/scripts/statgen.pl
	$(top_srcdir)/scripts/statgen.pl c > refstat.h

svn_version.c: FORCE
	echo -n 'const char* svn_version(void) { const char* SVN_Version = "' > svn_version.c
	@mysvnversion@                    >> svn_version.c
	echo '"; return SVN_Version; }'   >> svn_version.c

if HAVESVNWC
svn_dist_version: FORCE
	@mysvnversion@ > svn_dist_version
endif

FORCE:

