From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 2/4] Documentation: factor out build rules into stand-alone Makefile
Date: Fri, 28 Nov 2025 19:49:15 +0100 [thread overview]
Message-ID: <20251128184920.109552-2-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20251128184920.109552-1-a.fatoum@pengutronix.de>
To make it easier to invoke from CI, let's add a dedicated Documentation
Makefile.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
Documentation/Makefile | 35 +++++++++++++++++++++++++++++++++++
Makefile | 20 +++++++++++---------
2 files changed, 46 insertions(+), 9 deletions(-)
create mode 100644 Documentation/Makefile
diff --git a/Documentation/Makefile b/Documentation/Makefile
new file mode 100644
index 000000000000..825cd3ba0e7f
--- /dev/null
+++ b/Documentation/Makefile
@@ -0,0 +1,35 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Makefile for Sphinx documentation
+# This was not generated by sphinx-quickstart, but nonetheless copies some
+# of its variable name conventions for easier integration with existing tooling
+
+SPHINXBUILD = sphinx-build
+SPHINXOPTS =
+
+# Internal variables.
+ALLSPHINXOPTS = $(SPHINXOPTS)
+
+srctree ?= $(realpath $(dir $(lastword $(MAKEFILE_LIST)))/..)
+objtree ?= $(srctree)
+
+docs: htmldocs FORCE
+
+htmldocs: FORCE
+ @mkdir -p $(srctree)/Documentation/commands
+ @$(srctree)/Documentation/gen_commands.py $(srctree) $(srctree)/Documentation/commands
+ @$(SPHINXBUILD) -b html -d $(objtree)/doctrees $(srctree)/Documentation \
+ $(objtree)/Documentation/html $(ALLSPHINXOPTS)
+
+dochelp: FORCE
+ @echo ' barebox internal documentation from ReST:'
+ @echo ' htmldocs - HTML'
+ @echo ' docs - alias for htmldocs'
+ @echo
+ @echo ' Default location for the generated documents is Documentation/html'
+
+
+PHONY += FORCE
+FORCE:
+
+.PHONY: $(PHONY)
diff --git a/Makefile b/Makefile
index b138ae674878..22e306e69d9e 100644
--- a/Makefile
+++ b/Makefile
@@ -1491,6 +1491,8 @@ endif
@echo ' tags/TAGS - Generate tags file for editors'
@echo ' cscope - Generate cscope index'
@echo ' (default: $(INSTALL_HDR_PATH))'
+ @echo 'Documentation targets:'
+ @$(MAKE) -f $(srctree)/Documentation/Makefile dochelp
@echo ''
@echo 'Architecture specific targets ($(SRCARCH)):'
@$(if $(archhelp),$(archhelp),\
@@ -1515,6 +1517,15 @@ endif
@echo 'Execute "make" or "make all" to build all targets marked with [*] '
@echo 'For further info see the documentation'
+
+# Documentation targets
+# ---------------------------------------------------------------------------
+DOC_TARGETS := docs htmldocs dochelp
+
+PHONY += $(DOC_TARGETS)
+$(DOC_TARGETS):
+ $(Q)$(MAKE) -f $(srctree)/Documentation/Makefile $@
+
# Code Coverage
# ---------------------------------------------------------------------------
@@ -1541,15 +1552,6 @@ quiet_cmd_tags = GEN $@
tags TAGS cscope gtags: FORCE
$(call cmd,tags)
-SPHINXBUILD = sphinx-build
-ALLSPHINXOPTS = source
-
-docs: FORCE
- @mkdir -p $(srctree)/Documentation/commands
- @$(srctree)/Documentation/gen_commands.py $(srctree) $(srctree)/Documentation/commands
- @$(SPHINXBUILD) -b html -d $(objtree)/doctrees $(srctree)/Documentation \
- $(objtree)/Documentation/html
-
bareboxversion:
@echo $(KERNELVERSION)
--
2.47.3
next prev parent reply other threads:[~2025-11-28 18:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-28 18:49 [PATCH 1/4] Documentation: migration-guides: don't warn about migration-master Ahmad Fatoum
2025-11-28 18:49 ` Ahmad Fatoum [this message]
2025-11-28 18:49 ` [PATCH 3/4] ci: add workflow to check documentation build is warning free Ahmad Fatoum
2025-11-28 18:49 ` [PATCH 4/4] ARM: Rockchip: document changing console baud rate Ahmad Fatoum
2025-12-01 11:09 ` [PATCH 1/4] Documentation: migration-guides: don't warn about migration-master Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20251128184920.109552-2-a.fatoum@pengutronix.de \
--to=a.fatoum@pengutronix.de \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox