From a5d713ba1fa5315aae2f86ea5b1de8f3ca4ef418 Mon Sep 17 00:00:00 2001 From: Don BURNS Date: Tue, 18 Mar 2003 18:40:19 +0000 Subject: [PATCH] Added support for versioning to the build system --- GNUmakefile | 1 + Make/makedefs | 32 +++++++++++++++++++++++++++++++- Make/versionrules | 21 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 Make/versionrules diff --git a/GNUmakefile b/GNUmakefile index 8c5b1ddb6..85da62748 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -5,6 +5,7 @@ include $(TOPDIR)/Make/makedefs DIRS = $(TOP_LEVEL_DIRS) include $(TOPDIR)/Make/makedirrules +include $(TOPDIR)/Make/versionrules include $(TOPDIR)/Make/instrules include $(TOPDIR)/Make/distrules include $(TOPDIR)/Make/helprules diff --git a/Make/makedefs b/Make/makedefs index 88a86b658..f8a5b6a22 100644 --- a/Make/makedefs +++ b/Make/makedefs @@ -22,8 +22,38 @@ TOPDIR ?= ../ THISDIR = . MAKEDEPEND = ignore +####################################################################### +## +## VERSIONING SEMANTICS +## +## Version consistes of . . - +## Where: +## major : Production (0 = pre-production) +## minor : 0-7 = Production minor, 8 = Alpha, 9 = Beta +## release : Release tag +## revision: Release revision - 0 = development (cutting edge). +## +## Usage: +## Default - VERSION_REVISION is set to the value defined here +## Env variable PRODUCER_VERSION_REVISION overrides default +## e.g.: +## % setenv PRODUCER_VERSION_REVISION 5 +## % make version +## Command line overrides env variable +## % make VERSION_REVISION= +####################################################################### +VERSION_MAJOR = 0 +VERSION_MINOR = 9 +VERSION_RELEASE = 4 +VERSION_REVISION ?= 0 +ifneq (,$(OSG_VERSION_REVISION)) +VERSION_REVISION = $(OSG_VERSION_REVISION) +endif +VERSION = $(VERSION_MAJOR).$(VERSION_MINOR).$(VERSION_RELEASE) + INC = -I$(TOPDIR)/include -DEF = +DEF = -DOSG_VERSION="$(VERSION)"\ + -DOSG_VERSION_REVISION="$(VERSION_REVISION)" ############################################################################ ## NOTE - Semantics for the use of ARCH, ARCHARGS, and ARCHINST parameters diff --git a/Make/versionrules b/Make/versionrules new file mode 100644 index 000000000..eb56fdf48 --- /dev/null +++ b/Make/versionrules @@ -0,0 +1,21 @@ +####################################################################### +## +## VERSIONING SEMANTICS +## +## Version consistes of . . - +## Where: +## major : Production (0 = pre-production) +## minor : 0-7 = Production minor, 8 = Alpha, 9 = Beta +## release : Release tag +## revision: Release revision - 0 = development (cutting edge). +## +## +## 'make version' will print the version with a +####################################################################### +version : + @if [ "$(VERSION_REVISION)" = "0" ]; then\ + release=`date +%Y%m%e%H%M`;\ + else\ + release=$(VERSION_REVISION);\ + fi;\ + echo $(VERSION)-$$release;