This repository has been archived by the owner on May 21, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathMakefile
70 lines (64 loc) · 1.92 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
# NOTE(ww): Make sure to update the platform tag in .github/workflows/release.yml
# if you update this image. The two MUST remain in sync to ensure correct wheel builds.
MANYLINUX_IMAGE := quay.io/pypa/manylinux_2_28_x86_64
CLANG_FORMAT := clang-format
ALL_PY_SRCS := $(shell \
find . \
-type f \
\( -path */third_party/* \) -prune \
-o -name '*.py' \
-print \
)
ALL_CXX_SRCS := $(shell \
find . \
-type f \
\( -path */third_party/* \) -prune \
-o \( -name '*.cpp' -o -name '*.h' \) \
-print \
)
ALL_LISTFILES := $(shell \
find . \
-type f \
\( -path */third_party/* \) -prune \
-o \( -name 'CMakeLists.txt' -o -name '*.cmake' \) \
-print \
)
.PHONY: all
all:
@echo "This Makefile does not build anything."
.PHONY: format
format: blacken clang-format cmake-format
.PHONY: blacken
blacken:
black $(ALL_PY_SRCS)
git diff --exit-code
.PHONY: clang-format
clang-format:
$(CLANG_FORMAT) -i -style=file $(ALL_CXX_SRCS)
git diff --exit-code
.PHONY: cmake-format
cmake-format:
cmake-format -i $(ALL_LISTFILES)
git diff --exit-code
.PHONY: manylinux
manylinux:
docker pull $(MANYLINUX_IMAGE)
# NOTE(ww): We pass PYTHON through the environment here for the XED
# build, which is Python based. The version doesn't matter, as long
# as mbuild itself is okay with it. It is **not** related to the wheel
# builds, which happen subsequently.
docker run -e PYTHON=/opt/python/cp38-cp38/bin/python \
--rm -v $(shell pwd):/io $(MANYLINUX_IMAGE) \
/io/scripts/bootstrap.sh
docker run \
--rm -v $(shell pwd):/io $(MANYLINUX_IMAGE) \
/opt/python/cp37-cp37m/bin/pip wheel /io -w /io/dist
docker run \
--rm -v $(shell pwd):/io $(MANYLINUX_IMAGE) \
/opt/python/cp38-cp38/bin/pip wheel /io -w /io/dist
docker run \
--rm -v $(shell pwd):/io $(MANYLINUX_IMAGE) \
/opt/python/cp39-cp39/bin/pip wheel /io -w /io/dist
docker run \
--rm -v $(shell pwd):/io $(MANYLINUX_IMAGE) \
/opt/python/cp310-cp310/bin/pip wheel /io -w /io/dist