-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
89 lines (75 loc) · 2.11 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
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
83
84
85
86
87
88
89
##
#
#
##
# Project version and release
#
version ?= 0.1
release := $(shell git describe | sed 's/-[^-]*$$//;s/-/.post/')
##
# Python-related configuration
#
python ?= python
flake8 ?= flake8
setuplib ?= distutils.core
##
# Python -W flags:
#
# ignore -- completely ignore
# default -- default action
# all -- print all warnings
# module -- print the first warning occurence for a module
# once -- print each warning only once
# error -- fail on any warning
#
# Would you like to know more? See man 1 python
#
wlevel ?= once
##
# Other options
#
# root -- install root (default: platform default)
# lib -- lib installation target (default: platform default)
# coverage -- whether to produce html coverage (default: false)
# pdb -- whether to run pdb on errors (default: false)
# module -- run only the specified test module (default: run all)
#
ifdef root
override root := "--root=${root}"
endif
ifdef lib
override lib := "--install-lib=${lib}"
endif
all:
@echo targets:
@echo
@echo \* clean -- clean all generated files
@echo \* install -- install lib into the system
@echo \* develop -- run \"setup.py develop\" \(requires setuptools\)
@echo
clean: clean-version
@rm -rf dist build MANIFEST
@rm -rf dtcd.egg-info
@find dtcd -name "*pyc" -exec rm -f "{}" \;
@find dtcd -name "*pyo" -exec rm -f "{}" \;
setup.ini:
@awk 'BEGIN {print "[setup]\nversion=${version}\nrelease=${release}\nsetuplib=${setuplib}"}' >setup.ini
clean-version:
@rm -f setup.ini
force-version: clean-version update-version
update-version: setup.ini
upload: clean force-version
${python} setup.py sdist
${python} -m twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
dist: clean force-version
@${python} setup.py sdist >/dev/null 2>&1
install: clean force-version
${python} setup.py install ${root} ${lib}
# in order to get it working, one should install the project
# with setuplib=setuptools, otherwise the project files
# will be silently left not uninstalled
uninstall: clean
${python} -m pip uninstall dtcd
develop: setuplib = "setuptools"
develop: clean force-version
${python} setup.py develop