Skip to content

Commit 28a4e77

Browse files
committed
Add doc rules to Makefile.in
1 parent c1bc010 commit 28a4e77

File tree

1 file changed

+39
-2
lines changed

1 file changed

+39
-2
lines changed

Makefile.in

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,20 @@ ifdef NO_VALGRIND
172172
CFG_VALGRIND :=
173173
endif
174174

175+
DOCS :=
176+
ifeq ($(CFG_MAKEINFO),)
177+
$(info cfg: no makeinfo found, omitting doc/rust.html)
178+
else
179+
DOCS += doc/rust.html
180+
endif
181+
182+
ifeq ($(CFG_TEXI2PDF),)
183+
$(info cfg: no texi2pdf found, omitting doc/rust.pdf)
184+
else
185+
DOCS += doc/rust.pdf
186+
endif
187+
188+
175189
######################################################################
176190
# Target-and-rule "utility variables"
177191
######################################################################
@@ -347,14 +361,15 @@ COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/comp/, \
347361
rustc.rc *.rs */*.rs))
348362

349363
######################################################################
350-
# test dependency variables
364+
# Test dependency variables
351365
######################################################################
352366

353367
LREQ := rt/$(CFG_RUNTIME) rustllvm/$(CFG_RUSTLLVM)
354368
BREQ := boot/rustboot$(X) boot/$(CFG_STDLIB)
355369
SREQ0 := stage0/rustc$(X) $(LREQ)
356370
SREQ1 := stage1/rustc$(X) $(LREQ)
357371

372+
358373
######################################################################
359374
# Single-target rules
360375
######################################################################
@@ -366,7 +381,8 @@ all: boot/rustboot$(X) \
366381
stage0/rustc$(X) \
367382
stage0/glue.o \
368383
stage0/$(CFG_STDLIB) \
369-
$(GENERATED)
384+
$(GENERATED) \
385+
$(DOCS)
370386

371387
rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF)
372388
@$(call E, link: $@)
@@ -480,6 +496,24 @@ rustllvm/%.o: rustllvm/%.cpp $(MKFILES)
480496
$(Q)ocamllex$(OPT) -q -o $@ $<
481497

482498

499+
######################################################################
500+
# Doc rules
501+
######################################################################
502+
503+
doc/version.texi: $(MKFILES) rust.texi
504+
git log -1 \
505+
--pretty=format:'@macro gitversion%n%h %ci%n@end macro%n' >$@
506+
507+
doc/%.pdf: %.texi doc/version.texi
508+
texi2pdf -I doc -o $@ --clean $<
509+
510+
doc/%.html: %.texi doc/version.texi
511+
makeinfo -I doc --html --ifhtml --force --no-split --output=$@ $<
512+
513+
docsnap: doc/rust.pdf
514+
mv $< doc/rust-$(shell date +"%Y-%m-%d")-snap.pdf
515+
516+
483517
######################################################################
484518
# Testing variables
485519
######################################################################
@@ -1106,3 +1140,6 @@ clean:
11061140
boot$(X) stage0$(X) stage1$(X) stage2$(X) \
11071141
bc o s exe dSYM, \
11081142
$(wildcard test/*/*.$(ext) test/bench/*/*.$(ext)))
1143+
$(Q)rm -Rf $(foreach ext, \
1144+
aux cp fn ky log pdf html pg toc tp vr cps texi \
1145+
$(wildcard doc/*.$(ext)))

0 commit comments

Comments
 (0)