From 23540a516c4ae4cd38e42a3c3b92f4b84a1fdba4 Mon Sep 17 00:00:00 2001 From: j8takagi Date: Wed, 4 Jun 2014 18:28:21 +0900 Subject: [PATCH] =?utf8?q?make=20gittag=E3=81=AE=E5=8B=95=E4=BD=9C?= =?utf8?q?=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- Makefile | 14 ++++++++++---- VERSION | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c1019d4..bd35b91 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,14 @@ CAT := cat -GITTAG := git tag +GIT := git +WC = wc XARGS := xargs +VERSION := $(shell $(CAT) VERSION) + +VERSIONGITREF := $(shell $(GIT) show-ref -s --tags $(VERSION)) + +MASTERGITREF := $(shell $(GIT) show-ref -s refs/heads/master) + .PHONY: docall gittag doc: @@ -10,6 +17,5 @@ doc: docall: $(MAKE) -C doc all -gittag: VERSION - $(CAT) $^ | $(XARGS) $(GITTAG) - +gittag: + if test `$(GIT) status -s | $(WC) -l` -gt 0; then $(ECHO) "Error: commit, first."; exit 1; fi; if test "$(VERSIONGITREF)" != "$(MASTERGITREF)"; then $(GIT) tag $(VERSION); fi diff --git a/VERSION b/VERSION index f28b352..89e0829 100644 --- a/VERSION +++ b/VERSION @@ -1,2 +1,2 @@ -0.2p7 +0.2p8 -- 2.18.0