summaryrefslogtreecommitdiff
path: root/gtk-doc.make
diff options
context:
space:
mode:
authorSimon Josefsson <simon@josefsson.org>2010-05-20 14:51:16 +0200
committerSimon Josefsson <simon@josefsson.org>2010-05-20 14:51:16 +0200
commit1e1c6702f4b0a7b9b7d95a1c2ef52d98b7151a39 (patch)
tree33b2747480b762a4cc0ade72819726435271e3ff /gtk-doc.make
parent7f36c1c5b302f2257b8d323513a469402e84212c (diff)
downloadlibtasn1-1e1c6702f4b0a7b9b7d95a1c2ef52d98b7151a39.tar.gz
libtasn1-1e1c6702f4b0a7b9b7d95a1c2ef52d98b7151a39.tar.bz2
libtasn1-1e1c6702f4b0a7b9b7d95a1c2ef52d98b7151a39.zip
Upgrade GTK-DOC files to get PDF files.
Diffstat (limited to 'gtk-doc.make')
-rw-r--r--gtk-doc.make65
1 files changed, 51 insertions, 14 deletions
diff --git a/gtk-doc.make b/gtk-doc.make
index 6646365..57fab98 100644
--- a/gtk-doc.make
+++ b/gtk-doc.make
@@ -23,7 +23,7 @@ GPATH = $(srcdir)
TARGET_DIR=$(HTML_DIR)/$(DOC_MODULE)
-EXTRA_DIST = \
+EXTRA_DIST = \
$(content_files) \
$(HTML_IMAGES) \
$(DOC_MAIN_SGML_FILE) \
@@ -31,10 +31,12 @@ EXTRA_DIST = \
$(DOC_MODULE)-overrides.txt
DOC_STAMPS=scan-build.stamp tmpl-build.stamp sgml-build.stamp html-build.stamp \
- $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp
+ pdf-build.stamp \
+ $(srcdir)/tmpl.stamp $(srcdir)/sgml.stamp $(srcdir)/html.stamp \
+ $(srcdir)/pdf.stamp
-SCANOBJ_FILES = \
- $(DOC_MODULE).args \
+SCANOBJ_FILES = \
+ $(DOC_MODULE).args \
$(DOC_MODULE).hierarchy \
$(DOC_MODULE).interfaces \
$(DOC_MODULE).prerequisites \
@@ -48,12 +50,23 @@ REPORT_FILES = \
CLEANFILES = $(SCANOBJ_FILES) $(REPORT_FILES) $(DOC_STAMPS)
if ENABLE_GTK_DOC
-all-local: html-build.stamp
+if GTK_DOC_BUILD_HTML
+HTML_BUILD_STAMP=html-build.stamp
+else
+HTML_BUILD_STAMP=
+endif
+if GTK_DOC_BUILD_PDF
+PDF_BUILD_STAMP=pdf-build.stamp
+else
+PDF_BUILD_STAMP=
+endif
+
+all-local: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
else
all-local:
endif
-docs: html-build.stamp
+docs: $(HTML_BUILD_STAMP) $(PDF_BUILD_STAMP)
$(REPORT_FILES): sgml-build.stamp
@@ -62,8 +75,11 @@ $(REPORT_FILES): sgml-build.stamp
scan-build.stamp: $(HFILE_GLOB) $(CFILE_GLOB)
@echo 'gtk-doc: Scanning header files'
@-chmod -R u+w $(srcdir)
- @cd $(srcdir) && \
- gtkdoc-scan --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --ignore-headers="$(IGNORE_HFILES)" $(SCAN_OPTIONS) $(EXTRA_HFILES)
+ @_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) ; \
else \
@@ -96,8 +112,11 @@ $(srcdir)/tmpl/*.sgml:
sgml-build.stamp: tmpl.stamp $(DOC_MODULE)-sections.txt $(srcdir)/tmpl/*.sgml $(expand_content_files)
@echo 'gtk-doc: Building XML'
@-chmod -R u+w $(srcdir)
- @cd $(srcdir) && \
- gtkdoc-mkdb --module=$(DOC_MODULE) --source-dir=$(DOC_SOURCE_DIR) --output-format=xml --expand-content-files="$(expand_content_files)" --main-sgml-file=$(DOC_MAIN_SGML_FILE) $(MKDB_OPTIONS)
+ @_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)
@touch sgml-build.stamp
sgml.stamp: sgml-build.stamp
@@ -115,12 +134,31 @@ html-build.stamp: sgml.stamp $(DOC_MAIN_SGML_FILE) $(content_files)
if test "$(?)" = "0"; then \
mkhtml_options=--path="$(srcdir)"; \
fi; \
- cd $(srcdir)/html && gtkdoc-mkhtml $(mkhtml_options) $(MKHTML_OPTIONS) $(DOC_MODULE) ../$(DOC_MAIN_SGML_FILE)
+ 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)
@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=""; \
+ if test "x$(HTML_IMAGES)" != "x"; then \
+ for img in $(HTML_IMAGES); do \
+ part=`dirname $$img`; \
+ echo $$mkpdf_imgdirs | grep >/dev/null "\-\-imgdir=$$part "; \
+ if test $$? != 0; then \
+ mkpdf_imgdirs="$$mkpdf_imgdirs --imgdir=$$part"; \
+ fi; \
+ done; \
+ fi; \
+ cd $(srcdir) && gtkdoc-mkpdf --path="$(abs_srcdir)" $$mkpdf_imgdirs $(DOC_MODULE) $(DOC_MAIN_SGML_FILE) $(MKPDF_OPTIONS)
+ @touch pdf-build.stamp
+
##############
clean-local:
@@ -129,7 +167,7 @@ clean-local:
distclean-local:
cd $(srcdir) && \
- rm -rf xml $(REPORT_FILES) \
+ rm -rf xml $(REPORT_FILES) $(DOC_MODULE).pdf \
$(DOC_MODULE)-decl-list.txt $(DOC_MODULE)-decl.txt
maintainer-clean-local: clean
@@ -180,11 +218,10 @@ endif
dist-hook: dist-check-gtkdoc dist-hook-local
mkdir $(distdir)/tmpl
- mkdir $(distdir)/xml
mkdir $(distdir)/html
-cp $(srcdir)/tmpl/*.sgml $(distdir)/tmpl
- -cp $(srcdir)/xml/*.xml $(distdir)/xml
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)