-
Notifications
You must be signed in to change notification settings - Fork 3
/
Makefile
49 lines (41 loc) · 1.17 KB
/
Makefile
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
# -*- makefile -*-
VERSION:=$(shell git describe --tags | sed -e s/_/~/ -e s/-/+/ -e s/-/~/)
PV_FILE=lib/xapers/version.py
.PHONY: all
all:
.PHONY: test
test:
./test/xapers-test
.PHONY: update-version
update-version:
echo "__version__ = '$(VERSION)'" >$(PV_FILE)
.PHONY: release
ifdef V
update-version: VERSION:=$(V)
release: VERSION:=$(V)
release: update-version
head -1 NEWS.md | grep "^Xapers $(VERSION) "
make test
git commit -m "Update version for release $(VERSION)." $(PV_FILE) || true
git tag --sign -m "Xapers $(VERSION) release." $(VERSION)
else
release:
git tag -l | grep -v debian/
endif
.PHONY: deb-snapshot debian-snapshot
debian-snapshot: deb-snapshot
deb-snapshot:
rm -rf build/snapshot
mkdir -p build/snapshot/debian
git archive HEAD | tar -x -C build/snapshot/
git archive debian:debian | tar -x -C build/snapshot/debian/
cd build/snapshot; make update-version
cd build/snapshot; dch -b -v $(VERSION) -D UNRELEASED 'test build, not for upload'
cd build/snapshot; echo '3.0 (native)' > debian/source/format
cd build/snapshot; debuild -us -uc
.PHONY: clean
clean:
rm -rf build
rm -rf test/test-results
rm -rf test/tmp.*
debuild clean 2>/dev/null || true