forked from Metaswitch/python-phonenumbers
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
82 lines (64 loc) · 2.88 KB
/
Copy pathmakefile
File metadata and controls
82 lines (64 loc) · 2.88 KB
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
alldata: metadata geodata locale
# Dump the JRE's Locale information
DumpLocale.class: DumpLocale.java
javac $<
phonenumbers/geodata/locale.py: DumpLocale.class
java DumpLocale > $@
locale: phonenumbers/geodata/locale.py
phonenumbers/geodata/__init__.py: buildgeocodingdata.py ../resources/geocoding
python buildgeocodingdata.py ../resources/geocoding $@
tests/testgeodata/__init__.py: buildgeocodingdata.py ../resources/test/geocoding
python buildgeocodingdata.py ../resources/test/geocoding $@
geodata: phonenumbers/geodata/__init__.py tests/testgeodata/__init__.py
phonenumbers/data/__init__.py: ../resources/PhoneNumberMetaData.xml buildmetadatafromxml.py
python buildmetadatafromxml.py ../resources/PhoneNumberMetaData.xml phonenumbers/data
metadata: phonenumbers/data/__init__.py tests/testdata/__init__.py geodata
tests/testdata/__init__.py: ../resources/PhoneNumberMetaDataForTesting.xml buildmetadatafromxml.py
python buildmetadatafromxml.py ../resources/PhoneNumberMetaDataForTesting.xml tests/testdata
test: alldata tests/testdata/__init__.py
python phonenumbers/__init__.py
python phonenumbers/re_util.py
python phonenumbers/unicode_util.py
python phonenumbers/geocoder.py
python tests/__init__.py
# Coverage; requires coverage module
COVERAGE=$(shell hash python-coverage 2>&- && echo python-coverage || echo coverage)
COVERAGE_FILES=phonenumbers/*.py
coverage: coverage_clean coverage_generate coverage_report
coverage_clean:
$(COVERAGE) -e
coverage_generate:
$(COVERAGE) -x phonenumbers/re_util.py
$(COVERAGE) -x phonenumbers/unicode_util.py
$(COVERAGE) -x tests/__init__.py
coverage_report:
$(COVERAGE) -m -r $(COVERAGE_FILES)
coverage_annotate:
$(COVERAGE) annotate $(COVERAGE_FILES)
VERSION=$(shell grep __version__ phonenumbers/__init__.py | sed 's/__version__ = "\(.*\)"/\1/')
TARBALL=dist/phonenumbers-$(VERSION).tar.gz
# Build setuptools packaged tarball $(TARBALL)
sdist: alldata
python setup.py sdist
$(TARBALL): sdist
install: alldata
python setup.py build
sudo python setup.py install
clean:
rm -f MANIFEST *.pyc phonenumbers/*.pyc phonenumbers/data/*.pyc phonenumbers/geodata/*.pyc
rm -f tests/*.pyc tests/data/*.pyc tests/geodata/*.pyc
rm -rf build deb_dist dist
rm -f DumpLocale.class
distclean: clean
rm -rf phonenumbers/data tests/testdata
rm -rf phonenumbers.egg-info
rm -rf build
# Cehcks that the prerequisites for building the deb are installed.
deb_prechecks:
hash py2dsc 2>&- || { echo >&2 "Building the deb requires py2dsc, but it's not installed. Aborting.\nOn Ubuntu, 'sudo apt-get install python-stdeb' should do the trick."; exit 1; }
# Create Debian package. Requires py2dsc, included in the python-stdeb package.
DEB_VERSION=$(VERSION)-1_all
deb: deb_prechecks deb_dist/python-phonenumbers_$(DEB_VERSION).deb
deb_dist/python-phonenumbers_$(VERSION)-1_all.deb: $(TARBALL)
py2dsc $(TARBALL)
cd deb_dist/phonenumbers-$(VERSION) && dpkg-buildpackage -us -uc -nc