Add version-stamp machinery (and put "Draft + datestamp" into doc footer).

This commit is contained in:
Graydon Hoare 2010-07-03 00:27:33 -07:00
parent cf19c5132a
commit df0fa603d0
5 changed files with 45 additions and 9 deletions

View File

@ -1,10 +1,14 @@
all: rust.pdf rust.html
%.pdf: %.texi
version.texi: Makefile
git log -1 \
--format='@macro gitversion%n%h %ci%n@end macro%n' >$@
%.pdf: %.texi version.texi
texi2pdf $<
%.html: %.texi
%.html: %.texi version.texi
makeinfo --html --ifhtml --force --no-split --output=$@ $<
clean:

View File

@ -6,15 +6,23 @@
@c %**end of header
@syncodeindex fn cp
@include version.texi
@ifinfo
This manual is for the ``Rust'' programming language.
@uref{http://github.com/graydon/rust}
Version: @gitversion
Copyright 2006-2010 Graydon Hoare
Copyright 2009-2010 Mozilla Foundation
All rights reserved (for the time being).
See accompanying LICENSE.txt for terms.
@end ifinfo
@dircategory Programming
@ -30,13 +38,24 @@ All rights reserved (for the time being).
@page
@vskip 0pt plus 1filll
@uref{http://github.com/graydon/rust}
Version: @gitversion
@sp 2
Copyright @copyright{} 2006-2010 Graydon Hoare
Copyright @copyright{} 2009-2010 Mozilla Foundation
See accompanying LICENSE.txt for terms.
@end titlepage
@everyfooting @| @emph{-- Draft @today --} @|
@ifnottex
@node Top
@top Top

View File

@ -209,7 +209,7 @@ endif
# List them in link order.
# Nobody calculates the link-order DAG automatically, sadly.
UTIL_BOT_MLS := $(addprefix boot/util/, fmt.ml common.ml bits.ml)
UTIL_BOT_MLS := $(addprefix boot/util/, version.ml fmt.ml common.ml bits.ml)
DRIVER_BOT_MLS := $(addprefix boot/driver/, session.ml)
BE_MLS := $(addprefix boot/be/, x86.ml ra.ml pe.ml elf.ml \
macho.ml)
@ -256,10 +256,16 @@ STDLIB_INPUTS := $(wildcard lib/*.rc lib/*.rs lib/*/*.rs)
COMPILER_CRATE := comp/rustc.rc
COMPILER_INPUTS := $(wildcard comp/*.rc comp/*.rs comp/*/*.rs)
all: $(CFG_COMPILER) $(MKFILES) boot/fe/lexer.ml
GENERATED := boot/fe/lexer.ml boot/util/version.ml
all: $(CFG_COMPILER) $(MKFILES) $(GENERATED)
boot/util/version.ml: Makefile
$(CFG_QUIET)git log -1 \
--format='let version = "prerelease (%h %ci)";;' >$@
loc:
wc -l $(BOOT_MLS) $(RUNTIME_CS) $(RUNTIME_HDR)
$(CFG_QUIET)wc -l $(BOOT_MLS) $(RUNTIME_CS) $(RUNTIME_HDR)
$(CFG_RUNTIME): $(RUNTIME_OBJS) $(MKFILES) $(RUNTIME_HDR)
@$(call CFG_ECHO, compile: $<)
@ -742,7 +748,7 @@ tidy:
$(CFG_QUIET) python etc/tidy.py \
$(wildcard ../*.txt) \
../README \
$(filter-out boot/fe/lexer.ml $(PKG_3RDPARTY), $(PKG_FILES))
$(filter-out $(GENERATED) $(PKG_3RDPARTY), $(PKG_FILES))
clean:
@$(call CFG_ECHO, cleaning)
@ -750,7 +756,7 @@ clean:
$(CFG_QUIET)rm -f $(BOOT_CMOS) $(BOOT_CMIS) $(BOOT_CMXS) $(BOOT_OBJS)
$(CFG_QUIET)rm -f $(CFG_COMPILER)
$(CFG_QUIET)rm -f $(ML_DEPFILES) $(C_DEPFILES) $(CRATE_DEPFILES)
$(CFG_QUIET)rm -f boot/fe/lexer.ml
$(CFG_QUIET)rm -f $(GENERATED)
$(CFG_QUIET)rm -f $(CFG_BOOT) $(CFG_RUNTIME) $(CFG_STDLIB)
$(CFG_QUIET)rm -f $(TEST_RPASS_EXES_X86) $(TEST_RPASS_OUTS_X86)
$(CFG_QUIET)rm -f $(TEST_RPASS_EXES_LLVM) $(TEST_RPASS_OUTS_LLVM)

View File

@ -118,6 +118,11 @@ let dump_meta (filename:filename) : unit =
exit 0
;;
let print_version _ =
Printf.fprintf stdout "rustboot %s\n" Version.version;
exit 0;
;;
let flag f opt desc =
(opt, Arg.Unit f, desc)
;;
@ -206,6 +211,8 @@ let argspecs =
"report metadata from DWARF info in compiled file, then exit");
("-rdeps", Arg.Unit (fun _ -> sess.Session.sess_report_deps <- true),
"report dependencies of input, then exit");
("-version", Arg.Unit (fun _ -> print_version()),
"print version information, then exit");
] @ (Glue.alt_argspecs sess)
;;

View File

@ -2238,7 +2238,7 @@ let dwarf_visitor
(SEQ [|
uleb abbrev_code;
(* DW_AT_producer: DW_FORM_string *)
ZSTRING "Rustboot pre-release";
ZSTRING ("Rustboot " ^ Version.version);
(* DW_AT_language: DW_FORM_data4 *)
WORD (word_ty_mach, IMM 0x2L); (* DW_LANG_C *)
(* DW_AT_name: DW_FORM_string *)