Correct the Bash completion script behaviour.
[dput.git] / Makefile
blob70f257103c8f5dee6ff548a06dc23f045a07671f
1 #! /usr/bin/make -f
3 # This is free software, and you are welcome to redistribute it under
4 # certain conditions; see the end of this file for copyright
5 # information, grant of license, and disclaimer of warranty.
7 # Makefile for ‘dput’ code base.
9 PYTHON ?= /usr/bin/python2
10 PYTHON_OPTS ?= -3 -tt -bb
12 UNITTEST2 = /usr/bin/unit2
14 PY_MODULE_SUFFIX = .py
15 PY_MODULE_BYTECODE_SUFFIX = .pyc
16 package_modules = $(shell find ${CURDIR}/dput/ -name '*${PY_MODULE_SUFFIX}')
17 python_modules = $(shell find ${CURDIR}/ -name '*${PY_MODULE_SUFFIX}')
19 GENERATED_FILES :=
20 GENERATED_FILES += $(patsubst \
21 %${PY_MODULE_SUFFIX},%${PY_MODULE_BYTECODE_SUFFIX}, \
22 ${python_modules})
23 GENERATED_FILES += ${CURDIR}/*.egg-info
24 GENERATED_FILES += ${CURDIR}/build ${CURDIR}/dist
26 UNITTEST_OPTS ?= --buffer
28 PYTHON_COVERAGE = $(PYTHON) -m coverage
29 COVERAGE_RUN_OPTS ?= --branch
30 COVERAGE_REPORT_OPTS ?=
31 COVERAGE_TEXT_REPORT_OPTS ?=
32 COVERAGE_HTML_REPORT_OPTS ?=
35 .PHONY: all
36 all:
39 .PHONY: clean
40 clean:
41 $(RM) -r ${GENERATED_FILES}
44 .PHONY: tags
45 tags: TAGS
47 GENERATED_FILES += TAGS
49 TAGS: ${python_modules}
50 etags --output "$@" --lang=python ${python_modules}
53 .PHONY: test
54 test: test-unittest
56 .PHONY: test-unittest
57 test-unittest:
58 $(PYTHON) -m unittest discover ${UNITTEST_OPTS}
60 .PHONY: test-coverage
61 test-coverage: test-coverage-run test-coverage-html test-coverage-report
63 GENERATED_FILES += .coverage
65 .PHONY: test-coverage-run
66 test-coverage-run: coverage_opts = ${COVERAGE_RUN_OPTS}
67 test-coverage-run:
68 $(PYTHON) -m coverage run ${coverage_opts} \
69 $(UNITTEST2) discover ${UNITTEST_OPTS}
71 GENERATED_FILES += htmlcov/
73 .PHONY: test-coverage-html
74 test-coverage-html: coverage_opts = ${COVERAGE_REPORT_OPTS} ${COVERAGE_HTML_REPORT_OPTS}
75 test-coverage-html:
76 $(PYTHON_COVERAGE) html ${coverage_opts} ${package_modules}
78 .PHONY: test-coverage-report
79 test-coverage-report: coverage_opts = ${COVERAGE_REPORT_OPTS} ${COVERAGE_TEXT_REPORT_OPTS}
80 test-coverage-report:
81 $(PYTHON_COVERAGE) report ${coverage_opts} ${package_modules}
84 # Copyright © 2015–2016 Ben Finney <bignose@debian.org>
86 # This is free software: you may copy, modify, and/or distribute this work
87 # under the terms of the GNU General Public License as published by the
88 # Free Software Foundation; version 3 of that license or any later version.
89 # No warranty expressed or implied. See the file ‘LICENSE.GPL-3’ for details.
92 # Local variables:
93 # coding: utf-8
94 # mode: make
95 # End:
96 # vim: fileencoding=utf-8 filetype=make :