2020-05-30 05:51:02 +03:00
|
|
|
PYTHON2 ?= python
|
|
|
|
|
PYTHON3 ?= python3
|
2018-08-29 06:26:53 +02:00
|
|
|
|
2016-10-19 13:56:50 -07:00
|
|
|
.PHONY: gen_const install install3 install_cython sdist sdist3 bdist bdist3 clean check
|
2013-12-02 20:24:38 +08:00
|
|
|
|
2013-12-03 13:39:49 +08:00
|
|
|
gen_const:
|
2018-08-29 06:26:53 +02:00
|
|
|
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/
|
2015-04-06 16:40:31 -04:00
|
|
|
if test -n "${DESTDIR}"; then \
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON2) setup.py build install --root="${DESTDIR}"; \
|
2015-04-06 16:40:31 -04:00
|
|
|
else \
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON2) setup.py build install; \
|
2015-04-06 16:40:31 -04:00
|
|
|
fi
|
2013-12-01 13:46:49 -06:00
|
|
|
|
2014-04-14 16:33:04 +08:00
|
|
|
install3:
|
2016-10-13 20:59:17 -07:00
|
|
|
rm -rf src/
|
2015-04-06 16:40:31 -04:00
|
|
|
if test -n "${DESTDIR}"; then \
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON3) setup.py build install --root="${DESTDIR}"; \
|
2015-04-06 16:40:31 -04:00
|
|
|
else \
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON3) setup.py build install; \
|
2015-04-06 16:40:31 -04:00
|
|
|
fi
|
2014-04-14 16:33:04 +08:00
|
|
|
|
2014-01-08 22:55:06 +08:00
|
|
|
# NOTE: Newer cython can be installed by: sudo pip install --upgrade cython
|
2014-01-08 23:18:28 +08:00
|
|
|
install_cython:
|
2016-10-19 13:56:50 -07:00
|
|
|
rm -rf src/
|
|
|
|
|
if test -n "${DESTDIR}"; then \
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON2) setup_cython.py build install --root="${DESTDIR}"; \
|
2016-10-19 13:56:50 -07:00
|
|
|
else \
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON2) setup_cython.py build install; \
|
2016-10-19 13:56:50 -07:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
install3_cython:
|
|
|
|
|
rm -rf src/
|
|
|
|
|
if test -n "${DESTDIR}"; then \
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON3) setup_cython.py build install --root="${DESTDIR}"; \
|
2016-10-19 13:56:50 -07:00
|
|
|
else \
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON3) setup_cython.py build install; \
|
2016-10-19 13:56:50 -07:00
|
|
|
fi
|
2014-01-08 15:56:53 +08:00
|
|
|
|
2015-02-03 11:45:20 +08:00
|
|
|
# build & upload PyPi package with source code of the core
|
2015-01-30 14:19:45 +08:00
|
|
|
sdist:
|
2015-02-03 22:30:10 +08:00
|
|
|
rm -rf src/ dist/
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON2) setup.py sdist register upload
|
2015-01-30 14:19:45 +08:00
|
|
|
|
2015-02-03 11:45:20 +08:00
|
|
|
# build & upload PyPi package with source code of the core
|
2015-01-30 14:19:45 +08:00
|
|
|
sdist3:
|
2015-02-03 22:30:10 +08:00
|
|
|
rm -rf src/ dist/
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON3) setup.py sdist register upload
|
2015-02-03 09:24:14 +08:00
|
|
|
|
2015-02-03 11:45:20 +08:00
|
|
|
# build & upload PyPi package with prebuilt core
|
2016-10-19 13:56:50 -07:00
|
|
|
bdist:
|
2015-02-03 22:30:10 +08:00
|
|
|
rm -rf src/ dist/
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON2) setup.py bdist_wheel register upload
|
2015-02-03 09:24:14 +08:00
|
|
|
|
2015-02-03 11:45:20 +08:00
|
|
|
# build & upload PyPi package with prebuilt core
|
2016-10-19 13:56:50 -07:00
|
|
|
bdist3:
|
2015-02-03 22:30:10 +08:00
|
|
|
rm -rf src/ dist/
|
2018-08-29 06:26:53 +02:00
|
|
|
$(PYTHON3) setup.py bdist_wheel register upload
|
2015-01-30 14:19:45 +08:00
|
|
|
|
2013-11-27 12:11:31 +08:00
|
|
|
clean:
|
2016-10-19 13:56:50 -07:00
|
|
|
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
|
2016-10-25 22:12:54 -07:00
|
|
|
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
|
2018-12-04 21:47:03 +01:00
|
|
|
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
|
|
|
|
|
|