summaryrefslogtreecommitdiff
path: root/doc/doc.am
diff options
context:
space:
mode:
authorBertrand Garrigues <bertrand.garrigues@laposte.net>2014-09-08 23:20:39 +0200
committerBertrand Garrigues <bertrand.garrigues@laposte.net>2015-01-27 23:13:14 +0100
commitcfe916ecb8b6728183efd2880fdb5a565c1a215e (patch)
tree69d2d9ba12713d62fa60aef5f0300a54990e846f /doc/doc.am
parenta03ce68b86d22becb9d56841b8087d9c9cd3fd21 (diff)
downloadgroff-git-cfe916ecb8b6728183efd2880fdb5a565c1a215e.tar.gz
Support of configure option to build the documentation.
Add automake conditionals plugged to the option --with-doc of configure, to decide whether or not to build some doc formats (pdf, html, examples).
Diffstat (limited to 'doc/doc.am')
-rw-r--r--doc/doc.am25
1 files changed, 24 insertions, 1 deletions
diff --git a/doc/doc.am b/doc/doc.am
index fbb38bee5..16c619387 100644
--- a/doc/doc.am
+++ b/doc/doc.am
@@ -29,6 +29,7 @@ DOC_GROFF=\
$(GROFFBIN) -I$(abs_top_builddir) -M $(doc_srcdir) $(TFLAG) $(FFLAG) -Upet -ww
# Other doc, installed in $(docdir)
+if BUILD_OTHERDOC
# Files located in the source tree
DOCFILES= \
doc/meref.me \
@@ -46,15 +47,20 @@ otherdocdir = $(docdir)
dist_otherdoc_DATA = $(DOCFILES)
nodist_otherdoc_DATA = $(PROCESSEDDOCFILES)
MOSTLYCLEANFILES += $(PROCESSEDDOCFILES)
+else
+EXTRA_DIST += $(DOCFILES)
+endif
# GNU PIC html documentation, installed in $(htmldocdir)
# Other pic*.html files are installed by the local rule
+if BUILD_HTML
HTMLDOCFILES = \
doc/pic.html
htmlpicdir = $(htmldocdir)
htmlpic_DATA = $(HTMLDOCFILES)
HTMLDOCFILESALL = pic*.html
HTMLDOCIMAGEFILES = pic*
+endif
# Examples files, installed in $(exampledir)
@@ -65,6 +71,7 @@ EXAMPLEFILES = \
doc/grnexmpl.g \
doc/grnexmpl.me
+if BUILD_EXAMPLES
# Generated in the build tree
PROCESSEDEXAMPLEFILES = \
doc/webpage.ps \
@@ -77,6 +84,9 @@ docexamplesdir = $(exampledir)
dist_docexamples_DATA = $(EXAMPLEFILES)
nodist_docexamples_DATA = $(HTMLEXAMPLEFILES) $(PROCESSEDEXAMPLEFILES)
MOSTLYCLEANFILES += $(PROCESSEDEXAMPLEFILES)
+else
+EXTRA_DIST += $(EXAMPLEFILES)
+endif
imagedir = img
htmldocimagedir = $(htmldocdir)/img
@@ -144,6 +154,7 @@ doc/grnexmpl.ps: doc/grnexmpl.me doc/grnexmpl.g
# Note that we remove groff.css only if out-of-source build tree
mostlyclean-local: mostlyclean_doc
mostlyclean_doc:
+if BUILD_HTML
if test -d $(doc_builddir); then \
cd $(doc_builddir) && \
for f in $(HTMLDOCFILESALL); do \
@@ -156,10 +167,12 @@ mostlyclean_doc:
$(RM) $$f; \
done; \
fi
+endif
if test $(top_builddir) != $(top_srcdir); then \
$(RM) $(top_builddir)/doc/groff.css; \
fi
+if BUILD_EXAMPLES
if test -d $(doc_builddir); then \
cd $(doc_builddir) && \
for f in $(HTMLEXAMPLEFILESALL); do \
@@ -172,9 +185,11 @@ mostlyclean_doc:
$(RM) $$f; \
done; \
fi
+endif
install-data-hook: install_doc_htmldoc
install_doc_htmldoc:
+if BUILD_HTML
cd $(doc_builddir) && \
for f in `ls $(HTMLDOCFILESALL)`; do \
$(RM) $(DESTDIR)$(htmldocdir)/$$f; \
@@ -185,9 +200,10 @@ install_doc_htmldoc:
$(RM) $(DESTDIR)$(htmldocimagedir)/$(HTMLDOCIMAGEFILES)
$(INSTALL_DATA) $(doc_builddir)/$(imagedir)/$(HTMLDOCIMAGEFILES) \
$(DESTDIR)$(htmldocimagedir)
+endif
install-data-hook: install_doc_examples
-
+if BUILD_EXAMPLES
install_doc_examples: gnu.eps
# Prefer gnu.eps in builddir over srcdir.
d=.; test -f "gnu.eps" || d=$(doc_srcdir); \
@@ -203,9 +219,13 @@ install_doc_examples: gnu.eps
$(RM) $(DESTDIR)$(exampleimagedir)/$(HTMLEXAMPLEIMAGEFILES)
$(INSTALL_DATA) $(doc_builddir)/$(imagedir)/$(HTMLEXAMPLEIMAGEFILES) \
$(DESTDIR)$(exampleimagedir)
+else
+install_doc_examples:
+endif
uninstall-hook: uninstall_doc_examples uninstall_doc_htmldoc uninstall_mom
uninstall_doc_examples:
+if BUILD_EXAMPLES
-test -d $(DESTDIR)$(docexamplesdir) && \
cd $(DESTDIR)$(docexamplesdir) && \
for f in $(HTMLEXAMPLEFILESALL); do \
@@ -219,8 +239,10 @@ uninstall_doc_examples:
$(RM) $(DESTDIR)$(exampledir)/gnu.eps
-rmdir $(DESTDIR)$(docexamplesdir)/$(imagedir)
-rmdir $(DESTDIR)$(docexamplesdir)
+endif
uninstall_doc_htmldoc:
+if BUILD_HTML
-test -d $(DESTDIR)$(htmldocdir) && \
cd $(DESTDIR)$(htmldocdir) && \
for f in $(HTMLDOCFILESALL); do \
@@ -233,6 +255,7 @@ uninstall_doc_htmldoc:
done
-rmdir $(DESTDIR)$(htmldocdir)/$(imagedir)
-rmdir $(DESTDIR)$(htmldocdir)
+endif
# Texinfo doc
#