-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
81 lines (70 loc) · 2.02 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
# Copyright (c) 2020 John Martinez <[email protected]>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <https://www.gnu.org/licenses/>.
# ============================================================================
SHELL := /bin/bash
PREFIX := demiurge
IMAGE := stable
TAG := latest
PY_VERSION := 3.7.7
PYBIND11_VERSION := 2.4.3
# PROJECT_DIR := stable
.PHONY: build-image
build-image:
docker build \
--build-arg PY_VERSION=$(PY_VERSION) \
--build-arg PYBIND11_VERSION=$(PYBIND11_VERSION) \
-t $(PREFIX)/$(IMAGE):$(TAG) \
-f Dockerfile .
.PHONY: build
build:
docker run --rm \
-v `pwd`:/app \
-w /app \
$(PREFIX)/$(IMAGE):$(TAG) \
make build-local
build-local:
mkdir -p $(PROJECT_DIR)/build \
&& cd $(PROJECT_DIR)/build \
&& cmake -DPython_TARGET_VERSION="3.7.7" -DBUILD_TYPE=debug ../ \
&& make \
&& cd ../ \
&& rm -rf build
.PHONY: test
test:
docker run --rm \
-v `pwd`:/app \
-w /app \
$(PREFIX)/$(IMAGE):$(TAG) \
/bin/bash -c """make build-local && pip install -e . && make test-local"""
test-local: test-local-lint
pytest -W ignore . -vv
test-local-lint:
flake8 stable --filename="*.py" --ignore E111
.PHONY: clean
clean:
docker run --rm \
-v `pwd`:/app \
-w /app \
$(PREFIX)/$(IMAGE):$(TAG) \
make clean-local
clean-py:
$(shell find stable -name "*.py[co]" -o -name __pycache__ -exec rm -rf {} +)
clean-local: clean-py
$(RM) -rf $(PROJECT_DIR)/build
$(RM) -rf dist/
$(RM) -rf build/
$(RM) -rf .pytest_cache/
$(RM) *.o
$(RM) *.so