From 8049446bb0ba2d9252b2bfeddeaec113dee493ff Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Wed, 10 Jan 2024 22:55:23 +0530 Subject: [PATCH] btrfs-progs: docs: placeholder for contents.rst file on older sphinx version Older versions of sphinx require the contents.rst file otherwise the build fails, while new versions don't need it and use index.rst. Sphinx error: master file btrfs-progs/Documentation/contents.rst not found make[1]: *** [Makefile:37: man] Error 2 make: *** [Makefile:502: build-Documentation] Error 2 This build error is seen on version 1.7.6-3. To make it work on old and new versions create a placeholder empty file but make it a phony build target so new sphinx does not see it and report as not in any TOC. [ci skip] Signed-off-by: Anand Jain Signed-off-by: David Sterba --- .gitignore | 1 + Documentation/Makefile.in | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index 26f1940d..bb719b41 100644 --- a/.gitignore +++ b/.gitignore @@ -79,5 +79,6 @@ /Documentation/Makefile /Documentation/_build +/Documentation/contents.rst *.patch diff --git a/Documentation/Makefile.in b/Documentation/Makefile.in index ffc25386..b4c09dcc 100644 --- a/Documentation/Makefile.in +++ b/Documentation/Makefile.in @@ -28,6 +28,13 @@ man5dir = $(mandir)/man5 man8dir = $(mandir)/man8 .PHONY: all man help +.PHONY: contents.rst + +# Workaround for old sphinx that requires the contents.rst file +contents.rst: + @if [ "$$(sphinx-build --version | cut -d' ' -f2)" \< "1.7.7" ]; then \ + touch contents.rst; \ + fi # Build manual pages by default @@ -53,6 +60,8 @@ uninstall: clean: $(QUIET_RM)$(RM) -rf $(BUILDDIR)/* $(QUIET_RM)$(RM) -df -- $(BUILDDIR) + $(QUIET_RM)$(RM) -f contents.rst + # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).