Migrate `run-make/rustdoc-scrape-examples-multiple` to `rmake.rs`

This commit is contained in:
Guillaume Gomez 2024-05-21 11:26:57 +02:00
parent 1d0e4afd4c
commit f8c992f8b4
4 changed files with 6 additions and 27 deletions

View File

@ -235,7 +235,6 @@ run-make/rmeta-preferred/Makefile
run-make/rustc-macro-dep-files/Makefile
run-make/rustdoc-io-error/Makefile
run-make/rustdoc-scrape-examples-macros/Makefile
run-make/rustdoc-scrape-examples-multiple/Makefile
run-make/rustdoc-verify-output-files/Makefile
run-make/rustdoc-with-output-option/Makefile
run-make/rustdoc-with-short-out-dir-option/Makefile

View File

@ -1,5 +0,0 @@
deps := ex ex2
include ./scrape.mk
all: scrape

View File

@ -0,0 +1,6 @@
#[path = "../rustdoc-scrape-examples-remap/scrape.rs"]
mod scrape;
fn main() {
scrape::scrape(&[]);
}

View File

@ -1,21 +0,0 @@
include ../tools.mk
OUTPUT_DIR := "$(TMPDIR)/rustdoc"
$(TMPDIR)/%.calls: $(TMPDIR)/libfoobar.rmeta
$(RUSTDOC) examples/$*.rs --crate-name $* --crate-type bin --output $(OUTPUT_DIR) \
--extern foobar=$(TMPDIR)/libfoobar.rmeta \
-Z unstable-options \
--scrape-examples-output-path $@ \
--scrape-examples-target-crate foobar \
$(extra_flags)
$(TMPDIR)/lib%.rmeta: src/lib.rs
$(RUSTC) src/lib.rs --crate-name $* --crate-type lib --emit=metadata
scrape: $(foreach d,$(deps),$(TMPDIR)/$(d).calls)
$(RUSTDOC) src/lib.rs --crate-name foobar --crate-type lib --output $(OUTPUT_DIR) \
-Z unstable-options \
$(foreach d,$(deps),--with-examples $(TMPDIR)/$(d).calls)
$(HTMLDOCCK) $(OUTPUT_DIR) src/lib.rs