This repository has been archived by the owner on Sep 2, 2021. It is now read-only.
forked from canonical/curtin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
76 lines (55 loc) · 1.76 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
TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
CWD := $(shell pwd)
PYTHON2 ?= python2
PYTHON3 ?= python3
COVERAGE ?= 1
DEFAULT_COVERAGEOPTS = --with-coverage --cover-erase --cover-branches --cover-package=curtin --cover-inclusive
ifeq ($(COVERAGE), 1)
coverageopts ?= $(DEFAULT_COVERAGEOPTS)
endif
CURTIN_VMTEST_IMAGE_SYNC ?= False
export CURTIN_VMTEST_IMAGE_SYNC
noseopts ?= -vv
pylintopts ?= --rcfile=pylintrc --errors-only
target_dirs ?= curtin tests tools
build:
bin/curtin: curtin/pack.py tools/write-curtin
$(PYTHON) tools/write-curtin bin/curtin
check: unittest
style-check: pep8 pyflakes pyflakes3
coverage: coverageopts ?= $(DEFAULT_COVERAGEOPTS)
coverage: unittest
pep8:
@$(CWD)/tools/run-pep8
pyflakes:
$(PYTHON2) -m pyflakes $(target_dirs)
pyflakes3:
$(PYTHON3) -m pyflakes $(target_dirs)
pylint:
$(PYTHON2) -m pylint $(pylintopts) $(target_dirs)
pylint3:
$(PYTHON3) -m pylint $(pylintopts) $(target_dirs)
unittest2:
$(PYTHON2) -m nose $(coverageopts) $(noseopts) tests/unittests
unittest3:
$(PYTHON3) -m nose $(coverageopts) $(noseopts) tests/unittests
unittest: unittest2 unittest3
schema-validate:
@$(CWD)/tools/schema-validate-storage
docs: check-doc-deps
make -C doc html
check-doc-deps:
@which sphinx-build && $(PYTHON) -c 'import sphinx_rtd_theme' || \
{ echo "Missing doc dependencies. Install with:"; \
pkgs="python3-sphinx-rtd-theme python3-sphinx"; \
echo sudo apt-get install -qy $$pkgs ; exit 1; }
# By default don't sync images when running all tests.
vmtest: schema-validate
$(PYTHON3) -m nose $(noseopts) tests/vmtests
vmtest-deps:
@$(CWD)/tools/vmtest-system-setup
sync-images:
@$(CWD)/tools/vmtest-sync-images
clean:
rm -rf doc/_build
.PHONY: all clean test pyflakes pyflakes3 pep8 build style-check check-doc-deps