summaryrefslogtreecommitdiff
path: root/Makefile
blob: dc1d030cfa1c1a37a880913134c5343255bf678a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
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/")

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

dist-bz2: dist-common
	tar jcpf $(PKGNAME)-$(TAGVER).tar.bz2 $(PKGNAME)-$(TAGVER)
	rm -rf $(PKGNAME)-$(TAGVER)

dist-gz: dist-common
	tar zcpf $(PKGNAME)-$(TAGVER).tar.gz $(PKGNAME)-$(TAGVER)
	rm -rf $(PKGNAME)-$(TAGVER)

man:
	rst2man doc/man.rst > doc/mic.1

install: build
	$(PYTHON) setup.py install

develop: build
	$(PYTHON) setup.py develop

test:
	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 -rf *.egg-info
	rm -rf build/
	rm -rf dist/