@@ -8,7 +8,7 @@ COVERAGE=coverage
8
8
PYFLAGS =
9
9
DEST_DIR =/
10
10
11
- # Horrid hack to ensure setuptools is installed in ourPython environment. This
11
+ # Horrid hack to ensure setuptools is installed in ourpython environment. This
12
12
# is necessary with Python 3.3's venvs which don't install it by default.
13
13
ifeq ($(shell python -c "import setuptools" 2>&1) ,)
14
14
SETUPTOOLS: =
@@ -43,7 +43,8 @@ DEB_SOURCES:=debian/changelog \
43
43
DOC_SOURCES: =docs/conf.py\
44
44
$(wildcard docs/* .png) \
45
45
$(wildcard docs/* .svg) \
46
- $(wildcard docs/* .rst)
46
+ $(wildcard docs/* .rst) \
47
+ $(wildcard docs/* .pdf)
47
48
48
49
# Calculate the name of all outputs
49
50
DIST_EGG =dist/$(NAME ) -$(VER ) -$(PYVER ) .egg
@@ -55,6 +56,7 @@ DIST_DEB=dist/python-$(NAME)_$(VER)-1$(DEB_SUFFIX)_all.deb \
55
56
DIST_DSC =dist/$(NAME ) _$(VER ) -1$(DEB_SUFFIX ) .tar.gz\
56
57
dist/$(NAME ) _$(VER ) -1$(DEB_SUFFIX ) .dsc\
57
58
dist/$(NAME ) _$(VER ) -1$(DEB_SUFFIX ) _source.changes
59
+ MAN_PAGES =
58
60
59
61
60
62
# Default target
@@ -77,7 +79,7 @@ install:
77
79
$(PYTHON ) $(PYFLAGS ) setup.py install --root$(DEST_DIR )
78
80
79
81
doc :$(DOC_SOURCES )
80
- $(PYTHON ) $( PYFLAGS ) setup.py build_sphinx -b html
82
+ $(MAKE ) -C docs html latexpdf
81
83
82
84
source :$(DIST_TAR ) $(DIST_ZIP )
83
85
@@ -92,7 +94,7 @@ deb: $(DIST_DEB) $(DIST_DSC)
92
94
dist :$(DIST_EGG ) $(DIST_DEB ) $(DIST_DSC ) $(DIST_TAR ) $(DIST_ZIP )
93
95
94
96
develop : tags
95
- $(PIP ) install -e.
97
+ $(PIP ) install -e .[doc,test]
96
98
97
99
test :
98
100
$(COVERAGE ) run -m$(PYTEST ) tests -v
@@ -101,12 +103,18 @@ test:
101
103
clean :
102
104
$(PYTHON ) $(PYFLAGS ) setup.py clean
103
105
$(MAKE ) -f$(CURDIR ) /debian/rules clean
106
+ $(MAKE ) -C docs clean
104
107
rm -fr build/ dist/$(NAME ) .egg-info/ tags
105
108
find$(CURDIR ) -name" *.pyc" -delete
106
109
107
110
tags :$(PY_SOURCES )
108
111
ctags -R --exclude=" build/*" --exclude=" debian/*" --exclude=" docs/*" --languages=" Python"
109
112
113
+ $(MAN_PAGES ) :$(DOC_SOURCES )
114
+ $(MAKE ) -C docs man
115
+ mkdir -p man/
116
+ cp docs/_build/man/* .1 man/
117
+
110
118
$(DIST_TAR ) :$(PY_SOURCES )
111
119
$(PYTHON ) $(PYFLAGS ) setup.py sdist --formats gztar
112
120
@@ -116,25 +124,26 @@ $(DIST_ZIP): $(PY_SOURCES)
116
124
$(DIST_EGG ) :$(PY_SOURCES )
117
125
$(PYTHON ) $(PYFLAGS ) setup.py bdist_egg
118
126
119
- $(DIST_DEB ) :$(PY_SOURCES ) $(DEB_SOURCES )
120
- # build the binarypackages in the parent directory then rename it to
127
+ $(DIST_DEB ) :$(PY_SOURCES ) $(DEB_SOURCES ) $( MAN_PAGES )
128
+ # build the binarypackage in the parent directory then rename it to
121
129
# project_version.orig.tar.gz
122
130
$(PYTHON ) $(PYFLAGS ) setup.py sdist --dist-dir=../
123
131
rename -f' s/$(NAME)-(.*)\.tar\.gz/$(NAME)_$$1\.orig\.tar\.gz/' ../*
124
- debuild -b -i -I -Idist -Ibuild -Icoverage -I__pycache__ -I.coverage -Itags -I* .pyc -I* .vim -rfakeroot
132
+ debuild -b -i -I -Idist -Ibuild -Idocs/_build - Icoverage -I__pycache__ -I.coverage -Itags -I* .pyc -I* .vim -I * .xcf -rfakeroot
125
133
mkdir -p dist/
126
134
for f in $( DIST_DEB) ; do cp ../$$ {f## */} dist/; done
127
135
128
- $(DIST_DSC ) :$(PY_SOURCES ) $(DEB_SOURCES )
136
+ $(DIST_DSC ) :$(PY_SOURCES ) $(DEB_SOURCES ) $( MAN_PAGES )
129
137
# build the source package in the parent directory then rename it to
130
138
# project_version.orig.tar.gz
131
139
$(PYTHON ) $(PYFLAGS ) setup.py sdist --dist-dir=../
132
140
rename -f' s/$(NAME)-(.*)\.tar\.gz/$(NAME)_$$1\.orig\.tar\.gz/' ../*
133
- debuild -S -i -I -Idist -Ibuild -Icoverage -I__pycache__ -I.coverage -Itags -I* .pyc -I* .vim -rfakeroot
141
+ debuild -S -i -I -Idist -Ibuild -Idocs/_build - Icoverage -I__pycache__ -I.coverage -Itags -I* .pyc -I* .vim -I * .xcf -rfakeroot
134
142
mkdir -p dist/
135
143
for f in $( DIST_DSC) ; do cp ../$$ {f## */} dist/; done
136
144
137
145
release :$(PY_SOURCES ) $(DOC_SOURCES ) $(DEB_SOURCES )
146
+ $(MAKE ) clean
138
147
# ensure there are no current uncommitted changes
139
148
test -z" $( shell git status --porcelain) "
140
149
# update the changelog with new release information
@@ -153,6 +162,7 @@ upload: $(PY_SOURCES) $(DOC_SOURCES) $(DIST_DEB) $(DIST_DSC)
153
162
# build the deb source archive and upload to the PPA
154
163
dput waveform-ppa dist/$(NAME ) _$(VER ) -1$(DEB_SUFFIX ) _source.changes
155
164
git push --tags
165
+ git push
156
166
157
167
.PHONY : all install develop test doc source egg zip tar deb dist clean tags release upload
158
168