From 1e03f004047668e80ea4e1469addd0484ef48fbc Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Fri, 6 May 2011 11:21:51 -0700 Subject: Use #env to bake a git revision string into rustc's --version output. --- Makefile.in | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'Makefile.in') diff --git a/Makefile.in b/Makefile.in index 3daf9e8d..c32ac1e4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -35,6 +35,14 @@ CFG_RUNTIME :=$(call CFG_LIB_NAME,rustrt) CFG_RUSTLLVM :=$(call CFG_LIB_NAME,rustllvm) CFG_STDLIB :=$(call CFG_LIB_NAME,std) +# version-string calculation +CFG_GIT_DIR := $(CFG_SRC_DIR).git +CFG_VERSION := prerelease +ifneq ($(wildcard $(CFG_GIT_DIR)),) + CFG_VERSION += $(shell git --git-dir=$(CFG_GIT_DIR) log -1 \ + --pretty=format:'(%h %ci)') +endif + ifdef CFG_OCAMLC_OPT $(info cfg: have ocaml native compiler) OPT=.opt @@ -140,6 +148,7 @@ SREQ2 := stage2/rustc$(X) $(LREQ) stage3/glue.o stage3/$(CFG_STDLIB) ###################################################################### export CFG_SRC_DIR +export CFG_VERSION ###################################################################### # Subprograms -- cgit v1.2.3