Generate the build number from the most recent mercurial tag
authorNorm Jacobs <Norm.Jacobs@Sun.COM>
Wed, 21 Jul 2010 12:59:53 -0500
changeset 29 eb4177698749
parent 28 b1e1ec9707cd
child 30 440b6ca0641d
Generate the build number from the most recent mercurial tag
make-rules/shared-macros.mk
--- a/make-rules/shared-macros.mk	Wed Jul 21 12:42:04 2010 -0500
+++ b/make-rules/shared-macros.mk	Wed Jul 21 12:59:53 2010 -0500
@@ -24,9 +24,13 @@
 CONSOLIDATION =	userland
 PUBLISHER =	$(CONSOLIDATION)-build
 
+# get the most recent build number from the last mercurial tag
+LAST_HG_TAG =	$(shell hg tags -q | head -2 | tail -1)
+LAST_BUILD_NUM = $(LAST_HG_TAG:build-%=%)
+
 OS_VERSION =		$(shell uname -r)
 SOLARIS_VERSION =	$(OS_VERSION:5.%=2.%)
-BUILD_NUM =		0.140
+BUILD_NUM =		0.$(shell expr $(LAST_BUILD_NUM) + 1)
 BUILD_VERSION =		$(OS_VERSION)-$(BUILD_NUM)
 
 COMPILER =		studio