| 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 |
python -m pip install cython |
| 10 |
cython --cplus edlib.pyx -o edlib.bycython.cpp |
| 11 |
|
| 12 |
# To build package, README.rst is needed, because it goes into long description of package, |
| 13 |
# which is what is visible on PyPI. |
| 14 |
# However, to generate README.rst from README-tmpl.rst, built package is needed (for `import edlib` in cog)! |
| 15 |
# Therefore, we first build package without README.rst, use it to generate README.rst, |
| 16 |
# and then finally build package again but with README.rst. |
| 17 |
|
| 18 |
BUILD_SOURCE_FILES=edlib pyedlib.bycython.cpp setup.py |
| 19 |
|
| 20 |
buildWithoutREADME.rst: ${BUILD_SOURCE_FILES} |
| 21 |
EDLIB_OMIT_README_RST=1 python setup.py build_ext -i |
| 22 |
|
| 23 |
README.rst: buildWithoutREADME.rst README-tmpl.rst |
| 24 |
python -m pip install cogapp |
| 25 |
cog -d -o README.rst README-tmpl.rst |
| 26 |
|
| 27 |
BUILD_FILES=${BUILD_SOURCE_FILES} README.rst |
| 28 |
|
| 29 |
build: ${BUILD_FILES} |
| 30 |
python setup.py build_ext -i |
| 31 |
|
| 32 |
sdist: edlib pyedlib.bycython.cpp setup.py README.rst MANIFEST.in |
| 33 |
python setup.py sdist |
| 34 |
|
| 35 |
publish: clean sdist |
| 36 |
twine upload dist/* |
| 37 |
|
| 38 |
clean: |
| 39 |
rm -rf edlib dist edlib.egg-info build |
| 40 |
rm -f edlib.c *.bycython.* edlib.*.so |
| 41 |
rm -f README.rst |