Update changelog for 1.0
[stgit.git] / Makefile
blob5cd73cf4f7d3cd1ec04978a18c577ba33bce55c0
1 prefix ?= $(HOME)/.local
2 DESTDIR ?= /
3 PYTHON ?= python3
4 DEFAULT_TEST_TARGET ?= test
5 STG_PROVE_OPTS ?=
7 export DESTDIR PYTHON
9 TEST_PATCHES ?= ..
11 all: build
13 build:
14 $(PYTHON) setup.py build
16 dist:
17 $(PYTHON) setup.py sdist
19 install:
20 $(PYTHON) setup.py install --prefix=$(prefix) --root=$(DESTDIR) --force
22 .PHONY: all build dist install
24 doc:
25 $(MAKE) -C Documentation all
27 install-doc:
28 $(MAKE) -C Documentation install
30 install-html:
31 $(MAKE) -C Documentation install-html
33 .PHONY: doc install-doc install-html
35 lint: lint-black lint-isort lint-flake8 lint-t
37 lint-black:
38 $(PYTHON) -m black --check --quiet --diff . stg
40 lint-isort:
41 $(PYTHON) -m isort --check-only --quiet --diff . stg
43 lint-flake8:
44 $(PYTHON) -m flake8 . stg
46 lint-t:
47 $(MAKE) -C t test-lint
49 .PHONY: lint lint-black lint-isort lint-flake8 lint-t
51 format:
52 $(PYTHON) -m black . stg
53 $(PYTHON) -m isort --quiet . stg
55 test: build
56 $(MAKE) -C t all
58 test-patches:
59 for patch in $$(stg series --noprefix $(TEST_PATCHES)); do \
60 stg goto $$patch && $(MAKE) test || break; \
61 done
63 .PHONY: format test test-patches
65 coverage:
66 $(MAKE) coverage-test
67 $(MAKE) coverage-report
69 coverage-test:
70 rm -f .coverage
71 $(MAKE) .coverage
73 .coverage:
74 rm -rf build
75 -mkdir .cov-files
76 COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
77 $(PYTHON) -m coverage run --context=setup setup.py build
78 COVERAGE_PROCESS_START=$(CURDIR)/pyproject.toml \
79 COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
80 $(MAKE) -C t all
81 COVERAGE_PROCESS_START=$(CURDIR)/pyproject.toml \
82 COVERAGE_FILE=$(CURDIR)/.cov-files/.coverage \
83 $(MAKE) -C Documentation build-txt
84 $(PYTHON) -m coverage combine .cov-files/.coverage.*
85 rm -r .cov-files
87 coverage-report: .coverage
88 $(PYTHON) -m coverage html
89 $(PYTHON) -m coverage report
90 @echo "HTML coverage report: file://$(CURDIR)/htmlcov/index.html"
92 .PHONY: coverage coverage-test coverage-report
94 clean:
95 for dir in Documentation t; do \
96 $(MAKE) -C $$dir clean; \
97 done
98 rm -rf build
99 rm -rf dist
100 rm -f stgit/*.pyc
101 rm -rf stgit/__pycache__
102 rm -f stgit/builtin_version.py
103 rm -f stgit/commands/*.pyc
104 rm -rf stgit/commands/__pycache__
105 rm -f stgit/commands/cmdlist.py
106 rm -f stgit/completion/*.pyc
107 rm -rf stgit/completion/__pycache__
108 rm -f stgit/lib/*.pyc
109 rm -rf stgit/lib/__pycache__
110 rm -f stgit/lib/git/*.pyc
111 rm -rf stgit/lib/git/__pycache__
112 rm -f TAGS tags
113 rm -f MANIFEST
114 rm -f completion/stg.fish
115 rm -f completion/stgit.bash
116 rm -f .coverage
117 rm -rf .cov-files
118 rm -rf htmlcov
120 tags:
121 ctags -R stgit/*
123 TAGS:
124 ctags -e -R stgit/*
126 .PHONY: clean tags TAGS