| 1 |
default: build |
| 2 |
|
| 3 |
.PHONY: |
| 4 |
edlib: $(shell find ../../edlib) |
| 5 |
# create a clean (maybe updated) copy of edlib src |
| 6 |
rm -rf edlib && cp -r ../../edlib . |
| 7 |
|
| 8 |
pyedlib.bycython.cpp: edlib.pyx cedlib.pxd |
| •9 |
cython3 --cplus edlib.pyx -o edlib.bycython.cpp |
| 10 |
|
| 11 |
# To build package, README.rst is needed, because it goes into long description of package, |
| 12 |
# which is what is visible on PyPI. |
| 13 |
# However, to generate README.rst from README-tmpl.rst, built package is needed (for `import edlib` in cog)! |
| 14 |
# Therefore, we first build package without README.rst, use it to generate README.rst, |
| 15 |
# and then finally build package again but with README.rst. |
| 16 |
|
| 17 |
BUILD_SOURCE_FILES=edlib pyedlib.bycython.cpp setup.py |
| 18 |
|
| 19 |
buildWithoutREADME.rst: ${BUILD_SOURCE_FILES} |
| •20 |
EDLIB_OMIT_README_RST=1 python3 setup.py build_ext -i |
| 21 |
|
| 22 |
README.rst: buildWithoutREADME.rst README-tmpl.rst |
| 23 |
cog -d -o README.rst README-tmpl.rst |
| 24 |
|
| 25 |
BUILD_FILES=${BUILD_SOURCE_FILES} README.rst |
| 26 |
|
| 27 |
build: ${BUILD_FILES} |
| •28 |
python3 setup.py build_ext -i |
| 29 |
|
| 30 |
sdist: edlib pyedlib.bycython.cpp setup.py README.rst MANIFEST.in |
| •31 |
python3 setup.py sdist |
| 32 |
|
| 33 |
publish: clean sdist |
| 34 |
twine upload dist/* |
| 35 |
|
| 36 |
clean: |
| 37 |
rm -rf edlib dist edlib.egg-info build |
| 38 |
rm -f edlib.c *.bycython.* edlib.*.so |
| 39 |
rm -f README.rst |