~ chicken-core (chicken-5) 5be8296e051da543b3caa4625a86f276a5220edd
commit 5be8296e051da543b3caa4625a86f276a5220edd Author: felix <felix@call-with-current-continuation.org> AuthorDate: Tue Jul 19 22:15:33 2011 +0200 Commit: felix <felix@call-with-current-continuation.org> CommitDate: Tue Jul 19 22:15:33 2011 +0200 fiddling with build to ensure buildconfig-files are only generated when their content would change diff --git a/Makefile.mingw b/Makefile.mingw index 56a159ae..1f075439 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -31,8 +31,6 @@ endif SEP = $(strip \) SRCDIR =.$(SEP) -BRANCHNAME = -BUILD_ID = # platform configuration diff --git a/build-version.scm b/build-version.scm index 933dffab..f79b4385 100644 --- a/build-version.scm +++ b/build-version.scm @@ -1,7 +1,6 @@ ;;;; build-version.scm ; -; Copyright (c) 2008-2011, The Chicken Team -; Copyright (c) 2000-2007, Felix L. Winkelmann +; Copyright (c) 2011, The Chicken Team ; All rights reserved. ; ; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following @@ -31,13 +30,14 @@ ;; (read-version filename): Read line from FILENAME and return ;; as a string; return #f if non-existent file or blank line. (define-syntax read-version - (lambda (x r c) - (let ((fn (cadr x))) - (and (file-exists? fn) - (let ((ver (with-input-from-file (cadr x) read-line))) - (if (string=? ver "") - #f - ver)))))) + (er-macro-transformer + (lambda (x r c) + (let ((fn (cadr x))) + (and (file-exists? fn) + (let ((ver (with-input-from-file (cadr x) read-line))) + (if (string=? ver "") + #f + ver))))))) (define ##sys#build-version (read-version "buildversion")) (define ##sys#build-tag (read-version "buildtag")) diff --git a/buildbinaryversion b/buildbinaryversion deleted file mode 100644 index 56a6051c..00000000 --- a/buildbinaryversion +++ /dev/null @@ -1 +0,0 @@ -1 \ No newline at end of file diff --git a/defaults.make b/defaults.make index 9b3e0ef5..76f8f581 100644 --- a/defaults.make +++ b/defaults.make @@ -43,7 +43,6 @@ SEP ?= / SRCDIR ?= .$(SEP) DESTDIR ?= PREFIX ?= /usr/local -BRANCHNAME ?= $(shell sh $(SRCDIR)identify-branch.sh $(SRCDIR)) BINDIR = $(PREFIX)/bin LIBDIR = $(PREFIX)/lib @@ -226,18 +225,15 @@ LIBCHICKEN_SO_LIBRARIES ?= $(LIBRARIES) # other settings -HOSTNAME ?= $(shell hostname) - ifdef WINDOWS_SHELL BUILD_TIME ?= $(shell date /t) COPY_COMMAND = copy /Y +HOSTNAME ?= $(shell hostname) +UNAME_SYS ?= Windows +BUILD_TAG ?= compiled $(BUILD_TIME) on $(HOSTNAME) ($(UNAME_SYS)) else -BUILD_TIME ?= $(shell date +%Y-%m-%d) -UNAME_SYS ?= $(shell uname) COPY_COMMAND = cp endif -BUILD_TAG ?= compiled $(BUILD_TIME) on $(HOSTNAME) ($(UNAME_SYS)) -BUILD_ID ?= $(shell sh $(SRCDIR)identify-revision.sh $(SRCDIR)) COPYMANY = diff --git a/distribution/manifest b/distribution/manifest index 32a20544..c10fd596 100644 --- a/distribution/manifest +++ b/distribution/manifest @@ -6,8 +6,7 @@ LICENSE NEWS README config-arch.sh -identify-branch.sh -identify-revision.sh +identify.sh banner.scm batch-driver.scm batch-driver.c diff --git a/identify-branch.sh b/identify-branch.sh deleted file mode 100755 index 89a68f13..00000000 --- a/identify-branch.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/sh -# -# identify-branch.sh - check for .git directory and obtain branchname (unless "master") -# -# usage: identify-branch SOURCEDIR - -if test -d "$1/.git"; then - branchname=`GIT_DIR="$1/.git" git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'` - case ${branchname} in - "") ;; - "master") ;; - *) echo "${branchname}";; - esac -fi diff --git a/identify-revision.sh b/identify-revision.sh deleted file mode 100755 index a7980ea3..00000000 --- a/identify-revision.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -# -# identify-revision.sh - check for .git directory and obtain checked out revision -# -# usage: identify-revision.sh SOURCEDIR - -if test -d "$1/.git"; then - GIT_DIR="$1/.git" git rev-parse --short HEAD 2>/dev/null -fi diff --git a/rules.make b/rules.make index 16ebe631..95306662 100644 --- a/rules.make +++ b/rules.make @@ -18,7 +18,7 @@ # OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR # CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROd CUREMENT OF SUBSTITUTE GOODS OR # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE @@ -463,9 +463,9 @@ endif # build versioning -#.PHONY: buildtag buildbranch buildid - ifdef WINDOWS_SHELL +.PHONY: buildtag buildbranch buildid + buildtag: echo.$(BUILD_TAG)>buildtag buildbranch: @@ -473,12 +473,14 @@ buildbranch: buildid: echo.$(BUILD_ID)>buildid else -buildtag: - echo "$(BUILD_TAG)" > buildtag -buildbranch: - echo "$(BRANCHNAME)" > buildbranch -buildid: - echo "$(BUILD_ID)" > buildid +.PHONY: identify-me + +identify-me: + sh identify.sh $(SRCDIR) + +buildtag: identify-me +buildbranch: identify-me +buildid: identify-me endif # bootstrapping c sources @@ -657,17 +659,6 @@ bench: $(CHICKEN_SHARED_EXECUTABLE) $(CSI_SHARED_EXECUTABLE) $(CSC_PROGRAM) cd tests; echo >>bench.log; date >>bench.log; sh runbench.sh 2>&1 | tee -a bench.log -# build current head in sub-directory - -.PHONY: buildhead - -buildhead: - rm -fr chicken-`cat buildversion` - git archive --format=tar --prefix=chicken-`cat buildversion`/ $(HEAD) | tar x - cd chicken-`cat buildversion`; $(MAKE) -f Makefile.$(PLATFORM) \ - PLATFORM=$(PLATFORM) PREFIX=`pwd` CONFIG= CHICKEN=$(CHICKEN) all install - - # build static bootstrapping chicken .PHONY: boot-chickenTrap