Amend mic cr option of run_script
[platform/upstream/mic.git] / Makefile
1 PYTHON ?= python
2 VERSION = $(shell sed -ne 's/__version__\s*=\s*"\(.*\)"/\1/p ' mic/__init__.py)
3 TAGVER = $(shell git describe --abbrev=0 --tags)
4
5 PKGNAME = mic
6
7 all: build
8
9 build:
10         $(PYTHON) setup.py build
11
12 _archive: man
13         git archive --format=tar --prefix=$(PKGNAME)-$(VER)/ $(TAG) | tar xpf -
14         git show $(TAG) --oneline | head -1 > $(PKGNAME)-$(VER)/commit-id
15         rm -rf $(PKGNAME)-$(VER)/tests
16         tar zcpf $(PKGNAME)_$(VER).tar.gz $(PKGNAME)-$(VER)
17         rm -rf $(PKGNAME)-$(VER)
18
19 dist: VER=$(VERSION)
20 dist: TAG='HEAD'
21 dist: _archive
22
23 release: VER=$(TAGVER)
24 release: TAG=$(TAGVER)
25 release: _archive
26
27 man:
28         rst2man doc/man.rst > doc/mic.1
29
30 install: build
31         $(PYTHON) setup.py install
32
33 develop: build
34         $(PYTHON) setup.py develop
35
36 test:
37         cd tests/ && $(PYTHON) suite.py
38
39 clean:
40         rm -f *.tar.gz
41         rm -f doc/mic.1
42         rm -rf *.egg-info
43         rm -rf build/ dist/