Skip to content

Commit

Permalink
Polish makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
perklet committed Feb 1, 2024
1 parent 7b9a975 commit 02f1d69
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ SHELL := bash
VERSION := 0.6.0b9
CURL_VERSION := curl-8.1.1

curl_artifacts:
$(CURL_VERSION):
curl -L "https://curl.se/download/$(CURL_VERSION).tar.xz" \
-o "$(CURL_VERSION).tar.xz"
tar -xf $(CURL_VERSION).tar.xz
Expand All @@ -12,8 +12,7 @@ curl_artifacts:
-o "curl-impersonate-$(VERSION).tar.gz"
tar -xf curl-impersonate-$(VERSION).tar.gz

# TODO add the headers to sdist package
curl_cffi/include/curl/curl.h: curl_artifacts
curl_cffi/include/curl/curl.h: $(CURL_VERSION)
cd $(CURL_VERSION)
for p in $</curl-*.patch; do patch -p1 < ../$$p; done
# Re-generate the configure script
Expand All @@ -22,27 +21,23 @@ curl_cffi/include/curl/curl.h: curl_artifacts
cp -R include/curl/* ../curl_cffi/include/curl/

preprocess: curl_cffi/include/curl/curl.h
@echo preprocess
@echo generating patched libcurl header files

upload: dist/*.whl
twine upload dist/*.whl

test:
python -bb -m pytest tests/unittest

install-local: preprocess
install-editable: curl_cffi/include/curl/curl.h
pip install -e .

build: preprocess
build: curl_cffi/include/curl/curl.h
rm -rf dist/
pip install build delocate twine
pip install build
python -m build --wheel
delocate-wheel dist/*.whl

test:
python -bb -m pytest tests/unittest

clean:
rm -rf build/ dist/ curl_cffi.egg-info/ $(CURL_VERSION)/ curl-impersonate-$(VERSION)/
rm -rf curl_cffi/*.o curl_cffi/*.so curl_cffi/_wrapper.c
rm -rf $(CURL_VERSION).tar.xz curl-impersonate-$(VERSION).tar.gz
rm -rf curl_cffi/include/

.PHONY: clean build test install-local upload preprocess
.PHONY: clean build test install-editable preprocess

0 comments on commit 02f1d69

Please sign in to comment.