-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (38 loc) · 1.42 KB
/
Makefile
File metadata and controls
47 lines (38 loc) · 1.42 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
ifneq ($(strip $(AUDITWHEEL)),)
WHEEL_OUTDIR = ./wheelhouse
else
WHEEL_OUTDIR = ./dist
endif
PYTHON = python
SPHINX_APIDOC = sphinx-apidoc
SPHINX_BUILD = sphinx-build
PYROOTDIR = ./python
PYDOCSRCDIR = ./python/docs/source
PYDOCOUTDIR = ./python/docs/build
.PHONY: all req lint type test dist doc clean
all: lint type test dist doc
req:
$(PYTHON) -m pip install --quiet --upgrade pip
$(PYTHON) -m pip install --quiet --upgrade setuptools wheel build cython pytest mypy flake8 sphinx sphinx-rtd-theme myst-parser
ifneq ($(strip $(AUDITWHEEL)),)
$(PYTHON) -m pip install --quiet --upgrade auditwheel
endif
lint:
$(PYTHON) -m flake8 $(PYROOTDIR)
type:
$(PYTHON) -m pip install --quiet --force-reinstall --no-index --find-links=$(WHEEL_OUTDIR) softfloatpy
$(PYTHON) -m mypy $(PYROOTDIR)
test:
$(PYTHON) -m pip install --quiet --force-reinstall --no-index --find-links=$(WHEEL_OUTDIR) softfloatpy
$(PYTHON) -m pytest $(PYROOTDIR)/tests -vv --doctest-modules
dist:
$(PYTHON) -m build
ifneq ($(strip $(AUDITWHEEL)),)
auditwheel repair dist/softfloatpy-*.whl
endif
doc:
$(PYTHON) -m pip install --quiet --force-reinstall --no-index --find-links=$(WHEEL_OUTDIR) softfloatpy
$(SPHINX_APIDOC) -T -f -o $(PYDOCSRCDIR)/apidoc $(PYROOTDIR)/src
$(SPHINX_BUILD) -b html $(PYDOCSRCDIR) $(PYDOCOUTDIR)/html
clean:
rm -rf $(PYDOCOUTDIR) $(PYROOTDIR)/src/softfloatpy.egg-info $(PYDOCSRCDIR)/apidoc ./dist ./wheelhouse $$(find . -name '__pycache__')