summaryrefslogtreecommitdiffstats
path: root/Makefile.inc
blob: 2b4fd059caab177374fd6fe74b21b1b2e5eccfa0 (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
53
SELFDIR    := $(dir $(lastword $(MAKEFILE_LIST)))
PYTHONPATH ?= $(HOME)/workspace/python_sandbox
DEVELOPDIR ?= $(shell echo $(PYTHONPATH) | cut -d : -f 1)
VERSION    ?= $(shell cat $(SELFDIR)/VERSION)
# these can be used only after the setup.py is created
EGGNAME     = $(shell python setup.py --name)
SRCDIST     = $(EGGNAME)-$(VERSION).tar.gz

.PHONY: readme sdist develop upload_docs clean all doc setup

all: sdist

setup: setup.py doc/conf.py

%.py: %.py.skel $(SELFDIR)/VERSION
	sed 's/@@VERSION@@/$(VERSION)/g' <$*.py.skel >$@

sdist: setup .$(VERSION).sdist

.$(VERSION).sdist:
	python setup.py sdist
	touch $@

develop: setup
	python setup.py develop --install-dir=$(DEVELOPDIR)

readme: README.txt

%.txt: %.md
	pandoc --from=markdown --to=rst -o $@ $?

doc: setup
	make -C doc

upload: setup .$(VERSION).upload

.$(VERSION).upload:
	python setup.py sdist upload
	touch $@

upload_docs: setup .$(VERSION).upload_docs

.$(VERSION).upload_docs:
	make -C doc html
	python setup.py upload_docs
	touch $@

clean:
	-rm README.txt setup.py doc/conf.py .$(VERSION).*
	-rm -rf dist/
	make -C doc clean

# ex: ft=make noet sw=8 ts=8