@@ -172,6 +172,20 @@ ifdef NO_VALGRIND
172
172
CFG_VALGRIND :=
173
173
endif
174
174
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
+
175
189
# #####################################################################
176
190
# Target-and-rule "utility variables"
177
191
# #####################################################################
@@ -347,14 +361,15 @@ COMPILER_INPUTS := $(wildcard $(addprefix $(S)src/comp/, \
347
361
rustc.rc * .rs * /* .rs) )
348
362
349
363
# #####################################################################
350
- # test dependency variables
364
+ # Test dependency variables
351
365
# #####################################################################
352
366
353
367
LREQ := rt/$(CFG_RUNTIME ) rustllvm/$(CFG_RUSTLLVM )
354
368
BREQ := boot/rustboot$(X ) boot/$(CFG_STDLIB )
355
369
SREQ0 := stage0/rustc$(X ) $(LREQ )
356
370
SREQ1 := stage1/rustc$(X ) $(LREQ )
357
371
372
+
358
373
# #####################################################################
359
374
# Single-target rules
360
375
# #####################################################################
@@ -366,7 +381,8 @@ all: boot/rustboot$(X) \
366
381
stage0/rustc$(X) \
367
382
stage0/glue.o \
368
383
stage0/$(CFG_STDLIB) \
369
- $(GENERATED)
384
+ $(GENERATED) \
385
+ $(DOCS)
370
386
371
387
rt/$(CFG_RUNTIME ) : $(RUNTIME_OBJS ) $(MKFILES ) $(RUNTIME_HDR ) $(RUNTIME_DEF )
372
388
@$(call E, link: $@ )
@@ -480,6 +496,24 @@ rustllvm/%.o: rustllvm/%.cpp $(MKFILES)
480
496
$(Q ) ocamllex$(OPT ) -q -o $@ $<
481
497
482
498
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
+
483
517
# #####################################################################
484
518
# Testing variables
485
519
# #####################################################################
@@ -1106,3 +1140,6 @@ clean:
1106
1140
boot$(X) stage0$(X) stage1$(X) stage2$(X) \
1107
1141
bc o s exe dSYM, \
1108
1142
$(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