capstone/bindings/python/Makefile

82 lines
2.1 KiB
Makefile
Raw Permalink Normal View History

PYTHON2 ?= python
PYTHON3 ?= python3
.PHONY: gen_const install install3 install_cython sdist sdist3 bdist bdist3 clean check
2013-12-02 20:24:38 +08:00
gen_const:
cd .. && $(PYTHON2) const_generator.py python
2013-12-02 20:24:38 +08:00
install:
2016-10-13 20:59:17 -07:00
rm -rf src/
if test -n "${DESTDIR}"; then \
$(PYTHON2) setup.py build install --root="${DESTDIR}"; \
else \
$(PYTHON2) setup.py build install; \
fi
install3:
2016-10-13 20:59:17 -07:00
rm -rf src/
if test -n "${DESTDIR}"; then \
$(PYTHON3) setup.py build install --root="${DESTDIR}"; \
else \
$(PYTHON3) setup.py build install; \
fi
2014-01-08 22:55:06 +08:00
# NOTE: Newer cython can be installed by: sudo pip install --upgrade cython
install_cython:
rm -rf src/
if test -n "${DESTDIR}"; then \
$(PYTHON2) setup_cython.py build install --root="${DESTDIR}"; \
else \
$(PYTHON2) setup_cython.py build install; \
fi
install3_cython:
rm -rf src/
if test -n "${DESTDIR}"; then \
$(PYTHON3) setup_cython.py build install --root="${DESTDIR}"; \
else \
$(PYTHON3) setup_cython.py build install; \
fi
2015-02-03 11:45:20 +08:00
# build & upload PyPi package with source code of the core
sdist:
rm -rf src/ dist/
$(PYTHON2) setup.py sdist register upload
2015-02-03 11:45:20 +08:00
# build & upload PyPi package with source code of the core
sdist3:
rm -rf src/ dist/
$(PYTHON3) setup.py sdist register upload
2015-02-03 11:45:20 +08:00
# build & upload PyPi package with prebuilt core
bdist:
rm -rf src/ dist/
$(PYTHON2) setup.py bdist_wheel register upload
2015-02-03 11:45:20 +08:00
# build & upload PyPi package with prebuilt core
bdist3:
rm -rf src/ dist/
$(PYTHON3) setup.py bdist_wheel register upload
2013-11-27 12:11:31 +08:00
clean:
rm -rf build/ src/ dist/ *.egg-info
rm -rf capstone/lib capstone/include pyx/lib pyx/include
rm -f pyx/*.c pyx/__init__.py
for f in capstone/*.py; do rm -f pyx/$$(basename $$f)x; done
rm -f MANIFEST
rm -f *.pyc capstone/*.pyc
2014-10-01 16:42:29 +08:00
2015-08-03 18:45:08 +02:00
TESTS = test_basic.py test_detail.py test_arm.py test_arm64.py test_m68k.py test_mips.py
TESTS += test_ppc.py test_sparc.py test_systemz.py test_x86.py test_xcore.py test_tms320c64x.py
TESTS += test_m680x.py test_skipdata.py test_mos65xx.py
2018-07-20 12:36:50 +08:00
2014-10-01 16:42:29 +08:00
check:
@for t in $(TESTS); do \
echo Check $$t ... ; \
2016-06-29 11:08:13 -04:00
./$$t > /dev/null; \
if [ $$? -eq 0 ]; then echo OK; else echo FAILED; exit 1; fi \
2014-10-01 16:42:29 +08:00
done