Skip to content

Commit f847ea2

Browse files
committed
Refactor makefile to support building multiple wheel targets
1 parent 6c2732f commit f847ea2

1 file changed

Lines changed: 16 additions & 2 deletions

File tree

Makefile

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
11
all: source manylinux
22

3+
POLICY := manylinux_2_28
4+
PLATFORM := x86_64
5+
TAGS := cp312-cp312
6+
37
source:
48
python3 setup.py sdist
59

610
manylinux:
7-
docker run --rm -it -e PLAT=manylinux_2_28 -v $(PWD):/io -w /io quay.io/pypa/manylinux_2_28_x86_64 bash -c "yum install -y fuse-devel && /opt/python/cp312-cp312/bin/python setup.py bdist_wheel && auditwheel repair dist/*.whl"
11+
docker run --rm -v $(PWD):/io -w /io quay.io/pypa/$(POLICY)_$(PLATFORM) \
12+
make build-wheels \
13+
POLICY=$(POLICY) PLATFORM=$(PLATFORM) TAGS="$(TAGS)"
14+
15+
build-wheels:
16+
yum install -y fuse-devel
17+
$(foreach tag,$(TAGS),$(MAKE) build-wheel TAG=$(tag) PATH="/opt/python/$(tag)/bin:$(PATH)";)
18+
19+
build-wheel:
20+
python -m build --wheel --outdir dist-$(POLICY)-$(PLATFORM)-$(TAG)
21+
auditwheel repair dist-$(POLICY)-$(PLATFORM)-$(TAG)/*.whl
822

923
clean:
1024
python3 setup.py clean --all
11-
rm -fr build dist fuse_python.egg-info wheelhouse
25+
rm -fr build dist dist-* fuse_python.egg-info wheelhouse

0 commit comments

Comments
 (0)