summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2013-04-03 10:19:11 +0200
committerStef Walter <stefw@gnome.org>2013-04-03 10:19:11 +0200
commitbd6e31c485cd84746f474a64a63c15a7ea87d650 (patch)
tree46ac7acbb8f66a8321c64f656af2057d7d5727b7
parente67c0e4465607560e0f6af9e9b0395a9ee78adbc (diff)
downloadp11-kit-bd6e31c485cd84746f474a64a63c15a7ea87d650.tar.gz
Fix documentation so it builds out of tree
-rw-r--r--doc/manual/Makefile.am7
-rw-r--r--doc/manual/p11-kit-docs.xml (renamed from doc/manual/p11-kit-docs.sgml)0
-rw-r--r--gtk-doc.make189
3 files changed, 123 insertions, 73 deletions
diff --git a/doc/manual/Makefile.am b/doc/manual/Makefile.am
index 59c8624..79e9e4a 100644
--- a/doc/manual/Makefile.am
+++ b/doc/manual/Makefile.am
@@ -9,13 +9,13 @@ AUTOMAKE_OPTIONS = 1.6
DOC_MODULE=p11-kit
# The top-level SGML file. You can change this if you want to.
-DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.sgml
+DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml
# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk
-DOC_SOURCE_DIR=../../p11-kit
+DOC_SOURCE_DIR=$(top_srcdir)/p11-kit
# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS= --version
@@ -32,6 +32,8 @@ MKDB_OPTIONS=--sgml-mode --output-format=xml
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
MKTMPL_OPTIONS=
+# MKHTML_OPTIONS=--path="$(builddir)/html $(srcdir)/html"
+
# Extra options to supply to gtkdoc-fixref. Not normally needed.
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
FIXXREF_OPTIONS=
@@ -69,6 +71,7 @@ content_files=p11-kit-config.xml p11-kit-sharing.xml \
p11-kit-devel.xml \
p11-kit-trust.xml \
p11-kit.xml \
+ pkcs11.conf.xml \
annotation-glossary.xml \
$(NULL)
diff --git a/doc/manual/p11-kit-docs.sgml b/doc/manual/p11-kit-docs.xml
index 0397169..0397169 100644
--- a/doc/manual/p11-kit-docs.sgml
+++ b/doc/manual/p11-kit-docs.xml
diff --git a/gtk-doc.make b/gtk-doc.make
index c0ccd79..1f75dfd 100644
--- a/gtk-doc.make
+++ b/gtk-doc.make
@@ -5,12 +5,12 @@
####################################
if GTK_DOC_USE_LIBTOOL
-GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(LIBTOOL) --tag=CC --mode=compile $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(LIBTOOL) --tag=CC --mode=link $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
GTKDOC_RUN = $(LIBTOOL) --mode=execute
else
-GTKDOC_CC = $(CC) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-GTKDOC_LD = $(CC) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
+GTKDOC_CC = $(CC) $(INCLUDES) $(GTKDOC_DEPS_CFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+GTKDOC_LD = $(CC) $(GTKDOC_DEPS_LIBS) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS)
GTKDOC_RUN =
endif
@@ -23,18 +23,19 @@ GPATH = $(srcdir)
TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
-EXTRA_DIST = \
+SETUP_FILES = \
$(content_files) \
- $(HTML_IMAGES) \
$(DOC_MAIN_SGML_FILE) \
$(DOC_MODULE)-sections.txt \
- $(DOC_MODULE)-overrides.txt \
- style.css
+ $(DOC_MODULE)-overrides.txt
+
+EXTRA_DIST = \
+ $(HTML_IMAGES) \
+ $(SETUP_FILES)
-DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
- pdf-build.stamp \
- $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
- $(srcdir)/pdf.stamp
+DOC_STAMPS=setup-build.stamp scan-build.stamp tmpl-build.stamp sgml-build.stamp \
+ html-build.stamp pdf-build.stamp \
+ tmpl.stamp sgml.stamp html.stamp pdf.stamp
SCANOBJ_FILES = \
$(DOC_MODULE).args \
@@ -71,22 +72,47 @@ docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
$(REPORT_FILES): sgml-build.stamp
+#### setup ####
+
+setup-build.stamp:
+ -@if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ echo ' DOC Preparing build'; \
+ files=`echo $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types`; \
+ if test "x$$files" != "x" ; then \
+ for file in $$files ; do \
+ test -f $(abs_srcdir)/$$file && \
+ cp -pu $(abs_srcdir)/$$file $(abs_builddir)/ || true; \
+ done; \
+ fi; \
+ test -d $(abs_srcdir)/tmpl && \
+ { cp -rp $(abs_srcdir)/tmpl $(abs_builddir)/; \
+ chmod -R u+w $(abs_builddir)/tmpl; } \
+ fi
+ @touch setup-build.stamp
+
#### scan ####
scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
- @echo 'gtk-doc: Scanning header files'
- @-chmod -R u+w $(srcdir)
- @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ @echo ' DOC Scanning header files'
+ @_source_dir='' ; \
+ for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
- done ; \
- cd $(srcdir) && \
- gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
- @if grep -l '^..*$$' $(srcdir)/$(DOC_MODULE).types > /dev/null 2>&1 ; then \
- CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" gtkdoc-scangobj $(SCANGOBJ_OPTIONS) --module=$(DOC_MODULE) --output-dir=$(srcdir) ; \
+ done ; \
+ gtkdoc-scan --module=$(DOC_MODULE) --ignore-headers="$(IGNORE_HFILES)" $${_source_dir} $(SCAN_OPTIONS) $(EXTRA_HFILES)
+ @if grep -l '^..*$$' $(DOC_MODULE).types > /dev/null 2>&1 ; then \
+ echo " DOC Introspecting gobjects"; \
+ scanobj_options=""; \
+ gtkdoc-scangobj 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ scanobj_options="--verbose"; \
+ fi; \
+ fi; \
+ CC="$(GTKDOC_CC)" LD="$(GTKDOC_LD)" RUN="$(GTKDOC_RUN)" CFLAGS="$(GTKDOC_CFLAGS) $(CFLAGS)" LDFLAGS="$(GTKDOC_LIBS) $(LDFLAGS)" \
+ gtkdoc-scangobj $(SCANGOBJ_OPTIONS) $$scanobj_options --module=$(DOC_MODULE); \
else \
- cd $(srcdir) ; \
for i in $(SCANOBJ_FILES) ; do \
- test -f $$i || touch $$i ; \
+ test -f $$i || touch $$i ; \
done \
fi
@touch scan-build.stamp
@@ -96,10 +122,14 @@ $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)
#### templates ####
-tmpl-build.stamp: $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
- @echo 'gtk-doc: Rebuilding template files'
- @-chmod -R u+w $(srcdir)
- @cd $(srcdir) && gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+tmpl-build.stamp: setup-build.stamp $(DOC_MODULE)-decl.txt $(SCANOBJ_FILES) $(DOC_MODULE)-sections.txt $(DOC_MODULE)-overrides.txt
+ @echo ' DOC Rebuilding template files'
+ @gtkdoc-mktmpl --module=$(DOC_MODULE) $(MKTMPL_OPTIONS)
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ if test -w $(abs_srcdir) ; then \
+ cp -rp $(abs_builddir)/tmpl $(abs_srcdir)/; \
+ fi \
+ fi
@touch tmpl-build.stamp
tmpl.stamp: tmpl-build.stamp
@@ -111,13 +141,13 @@ $(srcdir)/tmpl/*.sgml:
#### xml ####
sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
- @echo 'gtk-doc: Building XML'
+ @echo ' DOC Building XML'
@-chmod -R u+w $(srcdir)
- @_source_dir='' ; for i in $(DOC_SOURCE_DIR) ; do \
+ @_source_dir='' ; \
+ for i in $(DOC_SOURCE_DIR) ; do \
_source_dir="$${_source_dir} --source-dir=$$i" ; \
- done ; \
- cd $(srcdir) && \
- gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
+ done ; \
+ gtkdoc-mkdb --module=$(DOC_MODULE) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $${_source_dir} $(MKDB_OPTIONS)
@touch sgml-build.stamp
sgml.stamp: sgml-build.stamp
@@ -125,61 +155,80 @@ sgml.stamp: sgml-build.stamp
#### html ####
-html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files) $(srcdir)/style.css
- @echo 'gtk-doc: Building HTML'
- @-chmod -R u+w $(srcdir)
- @rm -rf $(srcdir)/html
- @mkdir $(srcdir)/html
+html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
+ @echo ' DOC Building HTML'
+ @rm -rf html
+ @mkdir html
@mkhtml_options=""; \
+ gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkhtml_options="$$mkhtml_options --verbose"; \
+ fi; \
+ fi; \
gtkdoc-mkhtml 2>&1 --help | grep >/dev/null "\-\-path"; \
if test "$(?)" = "0"; then \
- mkhtml_options=--path="$(srcdir)"; \
+ mkhtml_options="$$mkhtml_options --path=\"$(abs_srcdir)\""; \
fi; \
- cd $(srcdir)/html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
- @test "x$(HTML_IMAGES)" = "x" || ( cd $(srcdir) && cp $(HTML_IMAGES) html )
- @echo 'gtk-doc: Fixing cross-references'
- @cd $(srcdir) && gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS) | grep -v "no link for.*CK-.*CAPS" || true
- @mv $(srcdir)/html/style.css $(srcdir)/html/gtk-doc.css
- @cp $(srcdir)/style.css $(srcdir)/html/style.css
+ cd html && gtkdoc-mkhtml $$mkhtml_options $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ -@test "x$(HTML_IMAGES)" = "x" || \
+ for file in $(HTML_IMAGES) ; do \
+ if test -f $(abs_srcdir)/$$file ; then \
+ cp $(abs_srcdir)/$$file $(abs_builddir)/html; \
+ fi; \
+ if test -f $(abs_builddir)/$$file ; then \
+ cp $(abs_builddir)/$$file $(abs_builddir)/html; \
+ fi; \
+ done;
+ @echo ' DOC Fixing cross-references'
+ @gtkdoc-fixxref --module=$(DOC_MODULE) --module-dir=html --html-dir=$(HTML_DIR) $(FIXXREF_OPTIONS)
@touch html-build.stamp
#### pdf ####
pdf-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
- @echo 'gtk-doc: Building PDF'
- @-chmod -R u+w $(srcdir)
- @rm -rf $(srcdir)/$(DOC_MODULE).pdf
- @mkpdf_imgdirs=""; \
+ @echo ' DOC Building PDF'
+ @rm -f $(DOC_MODULE).pdf
+ @mkpdf_options=""; \
+ gtkdoc-mkpdf 2>&1 --help | grep >/dev/null "\-\-verbose"; \
+ if test "$(?)" = "0"; then \
+ if test "x$(V)" = "x1"; then \
+ mkpdf_options="$$mkpdf_options --verbose"; \
+ fi; \
+ fi; \
if test "x$(HTML_IMAGES)" != "x"; then \
for img in $(HTML_IMAGES); do \
part=`dirname $$img`; \
- echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+ echo $$mkpdf_options | grep >/dev/null "\-\-imgdir=$$part "; \
if test $$? != 0; then \
- mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+ mkpdf_options="$$mkpdf_options --imgdir=$$part"; \
fi; \
done; \
fi; \
- cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_options $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
@touch pdf-build.stamp
##############
clean-local:
- rm -f *~ *.bak
- rm -rf .libs
+ @rm -f *~ *.bak
+ @rm -rf .libs
distclean-local:
- cd $(srcdir) && \
- rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
- $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+ @rm -rf xml html $(REPORT_FILES) $(DOC_MODULE).pdf \
+ $(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
+ @if test "$(abs_srcdir)" != "$(abs_builddir)" ; then \
+ rm -f $(SETUP_FILES) $(expand_content_files) $(DOC_MODULE).types; \
+ rm -rf tmpl; \
+ fi
maintainer-clean-local: clean
- cd $(srcdir) && rm -rf xml html
+ @rm -rf xml html
install-data-local:
- @installfiles=`echo $(srcdir)/html/*`; \
- if test "$$installfiles" = '$(srcdir)/html/*'; \
- then echo '-- Nothing to install' ; \
+ @installfiles=`echo $(builddir)/html/*`; \
+ if test "$$installfiles" = '$(builddir)/html/*'; \
+ then echo 1>&2 'Nothing to install' ; \
else \
if test -n "$(DOC_MODULE_VERSION)"; then \
installdir="$(DESTDIR)$(TARGET_DIR)-$(DOC_MODULE_VERSION)"; \
@@ -188,14 +237,12 @@ install-data-local:
fi; \
$(mkinstalldirs) $${installdir} ; \
for i in $$installfiles; do \
- echo '-- Installing '$$i ; \
+ echo ' $(INSTALL_DATA) '$$i ; \
$(INSTALL_DATA) $$i $${installdir}; \
done; \
if test -n "$(DOC_MODULE_VERSION)"; then \
mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
$${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
- mv -f $${installdir}/$(DOC_MODULE).devhelp \
- $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
fi; \
$(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
fi
@@ -220,14 +267,14 @@ dist-check-gtkdoc:
endif
dist-hook: dist-check-gtkdoc dist-hook-local
- mkdir $(distdir)/tmpl
- mkdir $(distdir)/html
- -cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
- cp $(srcdir)/html/* $(distdir)/html
- -cp $(srcdir)/$(DOC_MODULE).pdf $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE).types $(distdir)/
- -cp $(srcdir)/$(DOC_MODULE)-sections.txt $(distdir)/
- cd $(distdir) && rm -f $(DISTCLEANFILES)
- $(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
+ @mkdir $(distdir)/tmpl
+ @mkdir $(distdir)/html
+ @-cp ./tmpl/*.sgml $(distdir)/tmpl
+ @cp ./html/* $(distdir)/html
+ @-cp ./$(DOC_MODULE).pdf $(distdir)/
+ @-cp ./$(DOC_MODULE).types $(distdir)/
+ @-cp ./$(DOC_MODULE)-sections.txt $(distdir)/
+ @cd $(distdir) && rm -f $(DISTCLEANFILES)
+ @$(GTKDOC_REBASE) --online --relative --html-dir=$(distdir)/html
.PHONY : dist-hook-local docs