# -*- Mode: Makefile -*-
#
# Makefile.am - docs automake file for Redland
#
# Copyright (C) 2000-2009, 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=redland

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

# Extra options to supply to gtkdoc-scan
SCAN_OPTIONS=

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

# Header files that are filtered from the originals which
# are added to IGNORE_HFILES.  These must be absolute paths to
# prevent issues with VPATH and 'make distcheck' (see below)
FILTERED_HS=$(abs_top_srcdir)/src/filtered_rdf_log.h

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

IGNORE_CFILES=

# Headers to ignore
IGNORE_HFILES= \
	rdf_log.h \
	rdf_config.h \
	win32_rdf_config.h \
	rdf_types.h \
	redland.h \
	rdf_internal.h \
	rdf_avltree_internal.h \
	rdf_concepts_internal.h \
	rdf_digest_internal.h \
	rdf_hash_internal.h \
	rdf_init_internal.h \
	rdf_iterator_internal.h \
	rdf_list_internal.h \
	rdf_log_internal.h \
	rdf_model_internal.h \
	rdf_node_internal.h \
	rdf_parser_internal.h \
	rdf_query_internal.h \
	rdf_serializer_internal.h \
	rdf_statement_internal.h \
	rdf_storage_internal.h \
	rdf_stream_internal.h \
	rdf_uri_internal.h
	$(IGNORE_CFILES)


# 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

# Extra options to supply to gtkdoc-mktmpl
MKTMPL_OPTIONS=

# Non-autogenerated SGML files to be included in $(DOC_MAIN_SGML_FILE)
content_files =	\
	redland-chapter-intro.xml \
	redland-chapter-objects.xml \
	redland-chapter-storage-modules.xml \
	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=redland.3

# Other files to distribute
EXTRA_DIST+= README.html README \
storage.html \
redland.pod \
$(man_MANS) \
version.xml.in

CLEANFILES+=README pod2htm* redland-decl.txt redland-decl-list.txt \
$(FILTERED_HS)


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


# Used to remove things that gtkdoc-scan just cannot understand
#
# The
#   gtkdoc-scan --ignore-decorators=DECS
# feature does not help here.
#
# Fixes for 'make distcheck':
# - Use absolute file path to prevent VPATH issues
# - chmod dir writable to allow writing to the normally read-only src dir
$(abs_top_srcdir)/src/filtered_rdf_log.h: $(top_srcdir)/src/rdf_log.h
	chmod u+w $(abs_top_srcdir)/src
	$(SED) -e 's/REDLAND_CALLBACK_STDCALL *//' \
	       -e 's/REDLAND_PRINTF_FORMAT.*;/;/' \
	  $< > $@


if MAINTAINER_MODE
redland.3: redland.pod
	pod2man --section=3 --center="Redland RDF Application Framework" \
	--release="`date +%d-%b-%Y`" --date="@PACKAGE@ @PACKAGE_VERSION@" $< | \
	sed -e "s;REDLAND_VERSION_STRING;@PACKAGE_VERSION@;" \
	    -e 's;^Redland Resource;redland \\- Resource;' > $@
	rm -f pod2htm*
else
redland.3: redland.pod
	@echo "Creating fake $@ since maintainer mode is not enabled"
	touch $@

endif

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