Add doc rules to Makefile.in

This commit is contained in:
Graydon Hoare 2011-03-23 10:37:35 -07:00
parent c1bc0101ca
commit 28a4e778f3

View file

@ -172,6 +172,20 @@ ifdef NO_VALGRIND
CFG_VALGRIND :=
endif
DOCS :=
ifeq ($(CFG_MAKEINFO),)
$(info cfg: no makeinfo found, omitting doc/rust.html)
else
DOCS += doc/rust.html
endif
ifeq ($(CFG_TEXI2PDF),)
$(info cfg: no texi2pdf found, omitting doc/rust.pdf)
else
DOCS += doc/rust.pdf
endif
######################################################################
# Target-and-rule "utility variables"
######################################################################
@ -347,7 +361,7 @@ COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/comp/, \
rustc.rc *.rs */*.rs))
######################################################################
# test dependency variables
# Test dependency variables
######################################################################
LREQ := rt/$(CFG_RUNTIME) rustllvm/$(CFG_RUSTLLVM)
@ -355,6 +369,7 @@ BREQ := boot/rustboot$(X) boot/$(CFG_STDLIB)
SREQ0 := stage0/rustc$(X) $(LREQ)
SREQ1 := stage1/rustc$(X) $(LREQ)
######################################################################
# Single-target rules
######################################################################
@ -366,7 +381,8 @@ all: boot/rustboot$(X) \
stage0/rustc$(X) \
stage0/glue.o \
stage0/$(CFG_STDLIB) \
$(GENERATED)
$(GENERATED) \
$(DOCS)
rt/$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR) $(RUNTIME_DEF)
@$(call E, link: $@)
@ -480,6 +496,24 @@ rustllvm/%.o: rustllvm/%.cpp $(MKFILES)
$(Q)ocamllex$(OPT) -q -o $@ $<
######################################################################
# Doc rules
######################################################################
doc/version.texi: $(MKFILES) rust.texi
git log -1 \
--pretty=format:'@macro gitversion%n%h %ci%n@end macro%n' >$@
doc/%.pdf: %.texi doc/version.texi
texi2pdf -I doc -o $@ --clean $<
doc/%.html: %.texi doc/version.texi
makeinfo -I doc --html --ifhtml --force --no-split --output=$@ $<
docsnap: doc/rust.pdf
mv $< doc/rust-$(shell date +"%Y-%m-%d")-snap.pdf
######################################################################
# Testing variables
######################################################################
@ -1106,3 +1140,6 @@ clean:
boot$(X) stage0$(X) stage1$(X) stage2$(X) \
bc o s exe dSYM, \
$(wildcard test/*/*.$(ext) test/bench/*/*.$(ext)))
$(Q)rm -Rf $(foreach ext, \
aux cp fn ky log pdf html pg toc tp vr cps texi \
$(wildcard doc/*.$(ext)))