summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorGui Chen <gui.chen@intel.com>2013-09-12 04:17:22 -0400
committerGui Chen <gui.chen@intel.com>2013-09-15 22:06:35 -0400
commit97c8050134816c2e406d79dba121646dd650f951 (patch)
treec802301a6a5ad87fa94b3bca618ab7a0815e4f41 /Makefile
parent64074f140509c7b366e5011b331c6f7691621b25 (diff)
downloadmic-97c8050134816c2e406d79dba121646dd650f951.tar.gz
mic-97c8050134816c2e406d79dba121646dd650f951.tar.bz2
mic-97c8050134816c2e406d79dba121646dd650f951.zip
update Makefile
update handling of TAGVER drop bz2 compress add new target 'release' to track taring release tag Change-Id: Ief896cec98a5b36c96d7a481db88fa720d7c1c1c Signed-off-by: Gui Chen <gui.chen@intel.com>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 16 insertions, 25 deletions
diff --git a/Makefile b/Makefile
index dc1d030..99052d1 100644
--- a/Makefile
+++ b/Makefile
@@ -1,33 +1,28 @@
PYTHON ?= python
VERSION = $(shell sed -ne 's/__version__\s*=\s*"\(.*\)"/\1/p ' mic/__init__.py)
-TAGVER = $(shell echo $(VERSION) | sed -e "s/\([0-9\.]*\).*/\1/")
+TAGVER = $(shell git describe --abbrev=0 --tags)
PKGNAME = mic
-ifeq ($(VERSION), $(TAGVER))
- TAG = $(TAGVER)
-else
- TAG = "HEAD"
-endif
-
-
all: build
build:
$(PYTHON) setup.py build
-dist-common: man
- git archive --format=tar --prefix=$(PKGNAME)-$(TAGVER)/ $(TAG) | tar xpf -
- git show $(TAG) --oneline | head -1 > $(PKGNAME)-$(TAGVER)/commit-id
- rm -rf $(PKGNAME)-$(TAGVER)/tests
+_archive: man
+ git archive --format=tar --prefix=$(PKGNAME)-$(VER)/ $(TAG) | tar xpf -
+ git show $(TAG) --oneline | head -1 > $(PKGNAME)-$(VER)/commit-id
+ rm -rf $(PKGNAME)-$(VER)/tests
+ tar zcpf $(PKGNAME)_$(VER).tar.gz $(PKGNAME)-$(VER)
+ rm -rf $(PKGNAME)-$(VER)
-dist-bz2: dist-common
- tar jcpf $(PKGNAME)-$(TAGVER).tar.bz2 $(PKGNAME)-$(TAGVER)
- rm -rf $(PKGNAME)-$(TAGVER)
+dist: VER=$(VERSION)
+dist: TAG='HEAD'
+dist: _archive
-dist-gz: dist-common
- tar zcpf $(PKGNAME)-$(TAGVER).tar.gz $(PKGNAME)-$(TAGVER)
- rm -rf $(PKGNAME)-$(TAGVER)
+release: VER=$(TAGVER)
+release: TAG=$(TAGVER)
+release: _archive
man:
rst2man doc/man.rst > doc/mic.1
@@ -39,14 +34,10 @@ develop: build
$(PYTHON) setup.py develop
test:
- cd tests/ && $(PYTHON) suite.py
+ cd tests/ && $(PYTHON) suite.py
clean:
rm -f *.tar.gz
- rm -f *.tar.bz2
- rm -f mic/__version__.*
- rm -f tools/*.py[co]
- rm -f mic.1
+ rm -f doc/mic.1
rm -rf *.egg-info
- rm -rf build/
- rm -rf dist/
+ rm -rf build/ dist/