-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
50 lines (39 loc) · 919 Bytes
/
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
# Makefile for base64c project
PYTHON ?= python3
PIP ?= pip3
PYTEST ?= pytest
ifeq ($(OS),Windows_NT)
RM = del /Q
SEP = \\
else
RM = rm -f
SEP = /
endif
.PHONY: all clean build install test dist publish
all: build
build:
$(PYTHON) setup.py build_ext --inplace
clean:
$(RM) -r build dist *.egg-info
find . -type d -name "__pycache__" -exec $(RM) -r {} +
find . -type f -name "*.so" -o -name "*.pyd" -exec $(RM) {} +
install: build
$(PIP) install -e .
test:
$(PYTEST) -v
dist: clean
$(PYTHON) setup.py sdist bdist_wheel
publish: dist
@if [ -z "$(PYPI_TOKEN)" ]; then \
echo "Error: PYPI_TOKEN environment variable is not set"; \
exit 1; \
fi
twine upload dist/* -u __token__ -p $(PYPI_TOKEN)
# Add platform-specific targets if needed
ifeq ($(OS),Windows_NT)
windows_build:
# Add Windows-specific build commands here
else
unix_build:
# Add Unix-specific build commands here
endif