1313# #####################################################################
1414
1515DOCS :=
16+ CDOCS :=
1617DOCS_L10N :=
1718
1819BASE_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))
232233DOCS += doc/$(1 ) /index.html
233234endef
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
243253ifdef CFG_DISABLE_DOCS
@@ -260,6 +270,7 @@ doc/version_info.html: version_info.html.template $(MKFILE_DEPS) \
260270GENERATED += doc/version.md doc/version_info.html
261271
262272docs : $(DOCS )
273+ compiler-docs : $(CDOCS )
263274
264275docs-l10n : $(DOCS_L10N )
265276
0 commit comments