From 9c0c0e41d8b72825606da0db897a419c59658a56 Mon Sep 17 00:00:00 2001 From: Florian Krohm Date: Fri, 3 Oct 2025 16:26:55 +0000 Subject: [PATCH] Control building documentation (BZ 495483) Introduce Makefile variable BUILD_DOCS with these possible values: none - does not build any documentation all - builds all documentation html - builds HTML docs but skips building PDFs BUILD_ALL_DOCS is still recognised for backward compatibility and is mapped to BUILD_DOCS like so: If not specified --> BUILD_DOCS=all BUILD_ALL_DOCS=yes --> BUILD_DOCS=all BUILD_ALL_DOCS=no --> BUILD_DOCS=html README_DEVELOPERS adjusted. Fixes https://bugs.kde.org/show_bug.cgi?id=495483 --- README_DEVELOPERS | 2 +- docs/Makefile.am | 35 ++++++++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 8 deletions(-) diff --git a/README_DEVELOPERS b/README_DEVELOPERS index 22e229bd4..5d9fb823f 100644 --- a/README_DEVELOPERS +++ b/README_DEVELOPERS @@ -37,7 +37,7 @@ will also attempt to build the documentation. If you only want to test whether the generated tarball is complete and runs regression tests successfully, building documentation is not needed. - make dist BUILD_ALL_DOCS=no + make dist BUILD_DOCS=none If you insist on building documentation some embarrassing instructions can be found in docs/README. diff --git a/docs/Makefile.am b/docs/Makefile.am index 8672e8dd2..7e5ed389c 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -4,10 +4,26 @@ ## tools to do so is impractical / too difficult ##------------------------------------------------------------- -# Comment out the next line to skip building print docs. The default -# is not to skip building print docs. Note, after changing it -# you need to re-run autogen.sh and configure to make it take effect. -BUILD_ALL_DOCS=yes +# Building documentation is a pain. It takes longish and requires certain +# tools you may not have installed. +# The variable BUILD_DOCS allows you to control what documentation gets +# built: +# +# BUILD_DOCS=all builds all documentation +# BUILD_DOCS=html builds HTML docs but skips building PDFs +# BUILD_DOCS=none does not build any documentation +# +# Use it on the command line. E.g.: make dist BUILD_DOCS=none +# +ifndef BUILD_ALL_DOCS + BUILD_DOCS ?= all + else + ifeq "$(BUILD_ALL_DOCS)" "yes" + BUILD_DOCS ?= all + else + BUILD_DOCS ?= html + endif + endif # Whether to run xmlto pdf --with-fop # This is de fault, set to empty to use the default fo to pdf @@ -281,7 +297,7 @@ install-data-hook: cp $$f $(DESTDIR)$(mandir)/man1; \ fi \ done - ifeq ($(BUILD_ALL_DOCS),yes) + ifeq ($(BUILD_DOCS),all) set -e; \ if test -r index.pdf ; then \ mkdir -p $(DESTDIR)$(datadir)/doc/valgrind; \ @@ -297,18 +313,23 @@ install-data-hook: # This is done at 'make dist' time. It builds the html docs, print # docs and man pages and copies them into the docs/ directory in the # tarball. - ifeq ($(BUILD_ALL_DOCS),yes) + ifeq ($(BUILD_DOCS),none) +dist-hook: + + else + ifeq ($(BUILD_DOCS),all) dist-hook: FAQ.txt html-docs man-pages print-docs cp -r html $(distdir) cp FAQ.txt $(distdir)/.. cp *.1 $(distdir) cp print/index.pdf $(distdir) cp print/index.ps $(distdir) - else + else dist-hook: FAQ.txt html-docs man-pages cp -r html $(distdir) cp FAQ.txt $(distdir)/.. cp *.1 $(distdir) + endif endif distclean-local: -- 2.47.3