From 377686f9bec656a1635eeb029312a3f4a9c863c0 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Thu, 25 Jul 2013 10:46:45 +0900 Subject: [PATCH] =?utf8?q?make=20gittag=E3=81=A7=E3=80=81=E8=87=AA?= =?utf8?q?=E5=8B=95=E7=9A=84=E3=81=ABVERSION=E3=83=95=E3=82=A1=E3=82=A4?= =?utf8?q?=E3=83=AB=E3=81=AE=E3=83=91=E3=83=83=E3=83=81=E7=95=AA=E5=8F=B7?= =?utf8?q?=E3=82=92=E3=82=A2=E3=83=83=E3=83=97=E3=81=99=E3=82=8B=E6=A9=9F?= =?utf8?q?=E8=83=BD=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Makefile | 17 ++++++++++++----- VERSION | 2 +- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 1730124..590022e 100644 --- a/Makefile +++ b/Makefile @@ -10,18 +10,23 @@ CMD := casl2 comet2 dumpword CAT := cat CP := cp -ECHO := echo -GITTAG := git tag +ECHO := /bin/echo +GIT := git GREP := grep GTAGS := gtags INSTALL := install SED := sed WHICH := which +EXPR := expr +XARGS := xargs prefix ?= ~ bindir ?= $(prefix)/bin -VERSION = $(shell $(CAT) VERSION) +VERSION := $(shell $(CAT) VERSION) +VER := $(shell $(ECHO) $(VERSION) | $(SED) -e 's/^v\([0-9.]*\)p\([0-9]*\)/\1/') +PATCH := $(shell $(ECHO) $(VERSION) | $(SED) -e 's/^v[0-9.]*p\([0-9]*\)/\1/') + VERSIONFILES = include/package.h \ test/system/casl2/opt_v/0.txt \ test/system/comet2/opt_v/0.txt \ @@ -65,8 +70,10 @@ version: $(VERSIONFILES) $(VERSIONFILES): VERSION @$(SED) -e "s/@@VERSION@@/$(VERSION)/g" $@.version >$@ -gittag: VERSION - $(GITTAG) | $(GREP) $(VERSION) || $(GITTAG) $(VERSION) +gittag: + patch=$(PATCH); while ($(GIT) tag | $(GREP) v$(VER)p$${patch}); do $(EXPR) $${patch} + 1; done; $(ECHO) v$(VER)p$${patch} >VERSION + if ($(GIT) status -s | $(GREP) VERSION); then $(GIT) add VERSION; $(GIT) commit --amend --no-edit; fi + $(CAT) VERSION | $(XARGS) $(GIT) tag distclean: cmd-clean src-distclean gtags-clean version-clean clean diff --git a/VERSION b/VERSION index a6066f6..c461b2c 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -v0.2p20 +v0.2p22 -- 2.18.0