Skip to content

Commit e53e86a

Browse files
committed
Add a compiler-docs target
1 parent 8ca1c34 commit e53e86a

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

mk/docs.mk

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
######################################################################
1414

1515
DOCS :=
16+
CDOCS :=
1617
DOCS_L10N :=
1718

1819
BASE_DOC_OPTS := --from=markdown --standalone --toc --number-sections
@@ -232,12 +233,21 @@ doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
232233
DOCS += doc/$(1)/index.html
233234
endef
234235

236+
define compiledoc
237+
doc/$(1)/index.html: $$(RUSTDOC) $$(TLIB2_T_$(3)_H_$(3))/$(CFG_STDLIB_$(3))
238+
@$$(call E, rustdoc: $$@)
239+
$(Q)$(RUSTDOC) --cfg stage2 $(2)
240+
241+
CDOCS += doc/$(1)/index.html
242+
endef
243+
235244
$(eval $(call libdoc,std,$(STDLIB_CRATE),$(CFG_BUILD)))
236245
$(eval $(call libdoc,extra,$(EXTRALIB_CRATE),$(CFG_BUILD)))
237246
$(eval $(call libdoc,native,$(LIBNATIVE_CRATE),$(CFG_BUILD)))
238247
$(eval $(call libdoc,green,$(LIBGREEN_CRATE),$(CFG_BUILD)))
239-
$(eval $(call libdoc,rustc,$(COMPILER_CRATE),$(CFG_BUILD)))
240-
$(eval $(call libdoc,syntax,$(LIBSYNTAX_CRATE),$(CFG_BUILD)))
248+
249+
$(eval $(call compiledoc,rustc,$(COMPILER_CRATE),$(CFG_BUILD)))
250+
$(eval $(call compiledoc,syntax,$(LIBSYNTAX_CRATE),$(CFG_BUILD)))
241251

242252

243253
ifdef CFG_DISABLE_DOCS
@@ -260,6 +270,7 @@ doc/version_info.html: version_info.html.template $(MKFILE_DEPS) \
260270
GENERATED += doc/version.md doc/version_info.html
261271

262272
docs: $(DOCS)
273+
compiler-docs: $(CDOCS)
263274

264275
docs-l10n: $(DOCS_L10N)
265276

0 commit comments

Comments
 (0)