# -*- Mode: Makefile -*-
#
# Makefile.am - docs automake file for rasqal
#
# Copyright (C) 2000-2008, David Beckett http://www.dajobe.org/
# Copyright (C) 2000-2005, University of Bristol, UK http://www.bristol.ac.uk/
# 
# This package is Free Software and part of Redland http://librdf.org/
# 
# It is licensed under the following three licenses as alternatives:
#   1. GNU Lesser General Public License (LGPL) V2.1 or any newer version
#   2. GNU General Public License (GPL) V2 or any newer version
#   3. Apache License, V2.0 or any newer version
# 
# You may not use this file except in compliance with at least one of
# the above three licenses.
# 
# See LICENSE.html or LICENSE.txt at the top of this package for the
# complete terms and further detail along with the license texts for
# the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively.
# 
# 

# The name of the module.
DOC_MODULE=rasqal

# The top-level SGML file.
DOC_MAIN_SGML_FILE=rasqal-docs.xml

# Extra options to supply to gtkdoc-scan
SCAN_OPTIONS=

# The directory containing the source code. Relative to $(srcdir)
DOC_SOURCE_DIR=../src

# Used for dependencies
HFILE_GLOB=$(top_srcdir)/src/rasqal.h
CFILE_GLOB=$(top_srcdir)/src/rasqal_*.c

IGNORE_CFILES= \
rasqal_xsd_datatypes.c \
rdql_lexer.c \
rdql_parser.c \
sparql_lexer.c \
sparql_parser.c \
strcasecmp.c \
rasqal_internal.h \
rasqal_graph.c

# Headers to ignore
IGNORE_HFILES= \
	rasqal_config.h \
	rasqal_getopt.h \
	rasqal_internal.h \
	rdql_common.h \
	rdql_lexer.h \
	rdql_parser.h \
	sparql_common.h \
	sparql_lexer.h \
	sparql_parser.h \
	win32_rasqal_config.h

# CFLAGS and LDFLAGS for compiling scan program. Only needed
# if $(DOC_MODULE).types is non-empty.
AM_CPPFLAGS =
GTKDOC_LIBS =

# Extra options to supply to gtkdoc-mkdb
MKDB_OPTIONS=--sgml-mode --output-format=xml --ignore-files="$(IGNORE_CFILES)"

# Extra options to supply to gtkdoc-mktmpl
MKTMPL_OPTIONS=

# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
content_files = version.xml

# Images to copy into HTML directory
HTML_IMAGES =

# Extra options to supply to gtkdoc-fixref
FIXXREF_OPTIONS=

include $(top_srcdir)/gtk-doc.make

man_MANS = librasqal.3

EXTRA_DIST+= README.html README \
$(man_MANS) \
version.xml.in

CLEANFILES+= README

# Create some text files from HTML sources
LYNX=lynx
LYNXARGS=-dump -nolist

if MAINTAINER_MODE
librasqal.html: $(srcdir)/librasqal.3 $(srcdir)/../fix-groff-xhtml
	-groff -man -Thtml -P-l $< | tidy -asxml -wrap 1000 2>/dev/null | $(PERL) $(srcdir)/../fix-groff-xhtml $@

# FIXME: automate updating the rasqal-overrides.txt definition of
#   rasqal_triples_match  rasqal_triples_source
# based on the definitions of the struct NAME_s in ../src/rasqal.h
#
# rasqal-overrides.txt: rasqal-overrides.txt.in $(srcdir)/src/rasqal.h
#	$(PERL) $(srcdir)/update-overrides $< $(srcdir)/src/rasqal.h $@
endif


README: README.html
	$(LYNX) $(LYNXARGS) $< > $@
