@@ -59,6 +59,12 @@ PAPEROPT_letter = -D latex_paper_size=letter
59
59
KERNELDOC = $(srctree ) /scripts/kernel-doc
60
60
KERNELDOC_CONF = -D kerneldoc_srctree=$(srctree ) -D kerneldoc_bin=$(KERNELDOC )
61
61
ALLSPHINXOPTS = $(KERNELDOC_CONF ) $(PAPEROPT_$(PAPER ) ) $(SPHINXOPTS )
62
+ ifneq ($(wildcard $(srctree ) /.config) ,)
63
+ ifeq ($(CONFIG_RUST ) ,y)
64
+ # Let Sphinx know we will include rustdoc
65
+ ALLSPHINXOPTS += -t rustdoc
66
+ endif
67
+ endif
62
68
# the i18n builder cannot share the environment and doctrees with the others
63
69
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER ) ) $(SPHINXOPTS ) .
64
70
@@ -95,6 +101,16 @@ htmldocs:
95
101
@$(srctree ) /scripts/sphinx-pre-install --version-check
96
102
@+$(foreach var,$(SPHINXDIRS ) ,$(call loop_cmd,sphinx,html,$(var ) ,,$(var ) ) )
97
103
104
+ # If Rust support is available and .config exists, add rustdoc generated contents.
105
+ # If there are any, the errors from this make rustdoc will be displayed but
106
+ # won't stop the execution of htmldocs
107
+
108
+ ifneq ($(wildcard $(srctree ) /.config) ,)
109
+ ifeq ($(CONFIG_RUST ) ,y)
110
+ $(Q)$(MAKE) rustdoc || true
111
+ endif
112
+ endif
113
+
98
114
texinfodocs :
99
115
@$(srctree ) /scripts/sphinx-pre-install --version-check
100
116
@+$(foreach var,$(SPHINXDIRS ) ,$(call loop_cmd,sphinx,texinfo,$(var ) ,texinfo,$(var ) ) )
0 commit comments