| 1 |
PYTHON2 ?= python2 |
| 2 |
PYTHON3 ?= python3 |
| 3 |
|
| 4 |
.PHONY: gen_const install sdist bdist clean check |
| 5 |
|
| 6 |
gen_const: |
| 7 |
cd .. && $(PYTHON2) const_generator.py python |
| 8 |
|
| 9 |
install: |
| 10 |
rm -rf src/ |
| 11 |
if test -n "${DESTDIR}"; then \ |
| 12 |
$(PYTHON2) setup.py build install --root="${DESTDIR}"; \ |
| 13 |
else \ |
| 14 |
$(PYTHON2) setup.py build install; \ |
| 15 |
fi |
| 16 |
|
| 17 |
install3: |
| 18 |
rm -rf src/ |
| 19 |
if test -n "${DESTDIR}"; then \ |
| 20 |
$(PYTHON3) setup.py build install --root="${DESTDIR}"; \ |
| 21 |
else \ |
| 22 |
$(PYTHON3) setup.py build install; \ |
| 23 |
fi |
| 24 |
|
| 25 |
|
| 26 |
sdist: |
| 27 |
rm -rf src/ dist/ |
| 28 |
$(PYTHON2) setup.py sdist register upload |
| 29 |
|
| 30 |
|
| 31 |
sdist3: |
| 32 |
rm -rf src/ dist/ |
| 33 |
$(PYTHON3) setup.py sdist register upload |
| 34 |
|
| 35 |
|
| 36 |
bdist: |
| 37 |
rm -rf src/ dist/ |
| 38 |
$(PYTHON2) setup.py bdist_wheel register upload |
| 39 |
|
| 40 |
|
| 41 |
bdist3: |
| 42 |
rm -rf src/ dist/ |
| 43 |
$(PYTHON3) setup.py bdist_wheel register upload |
| 44 |
|
| 45 |
clean: |
| 46 |
rm -rf build/ src/ dist/ *.egg-info |
| 47 |
rm -rf capstone/lib capstone/include pyx/lib pyx/include |
| 48 |
rm -f pyx/*.c pyx/__init__.py |
| 49 |
for f in capstone/*.py; do rm -f pyx/$$(basename $$f)x; done |
| 50 |
rm -f MANIFEST |
| 51 |
rm -f *.pyc capstone/*.pyc |
| 52 |
|
| 53 |
|
| 54 |
TESTS = test_basic.py test_detail.py test_arm.py test_arm64.py test_m68k.py test_mips.py |
| 55 |
TESTS += test_ppc.py test_sparc.py test_systemz.py test_x86.py test_xcore.py test_tms320c64x.py |
| 56 |
TESTS += test_m680x.py test_skipdata.py test_mos65xx.py test_bpf.py test_riscv.py |
| 57 |
TESTS += test_evm.py |
| 58 |
|
| 59 |
check: |
| 60 |
@for t in $(TESTS); do \ |
| 61 |
echo Check $$t ... ; \ |
| 62 |
./$$t > /dev/null; \ |
| 63 |
if [ $$? -eq 0 ]; then echo OK; else echo FAILED; exit 1; fi \ |
| 64 |
done |
| 65 |
|