Andrew Dutcher | f4aed60 | 2016-10-19 13:56:50 -0700 | [diff] [blame] | 1 | .PHONY: gen_const install install3 install_cython sdist sdist3 bdist bdist3 clean check |
Nguyen Anh Quynh | 210e94d | 2013-12-02 20:24:38 +0800 | [diff] [blame] | 2 | |
Nguyen Anh Quynh | 75c4475 | 2013-12-03 13:39:49 +0800 | [diff] [blame] | 3 | gen_const: |
danghvu | 0c478ab | 2014-05-12 14:35:54 -0500 | [diff] [blame] | 4 | cd .. && python const_generator.py python |
Nguyen Anh Quynh | 210e94d | 2013-12-02 20:24:38 +0800 | [diff] [blame] | 5 | |
| 6 | install: |
Andrew Dutcher | d8111c1 | 2016-10-13 20:59:17 -0700 | [diff] [blame] | 7 | rm -rf src/ |
Hank Leininger | 1c02880 | 2015-04-06 16:40:31 -0400 | [diff] [blame] | 8 | if test -n "${DESTDIR}"; then \ |
Andrew Dutcher | d8111c1 | 2016-10-13 20:59:17 -0700 | [diff] [blame] | 9 | python setup.py build install --root="${DESTDIR}"; \ |
Hank Leininger | 1c02880 | 2015-04-06 16:40:31 -0400 | [diff] [blame] | 10 | else \ |
Andrew Dutcher | d8111c1 | 2016-10-13 20:59:17 -0700 | [diff] [blame] | 11 | python setup.py build install; \ |
Hank Leininger | 1c02880 | 2015-04-06 16:40:31 -0400 | [diff] [blame] | 12 | fi |
danghvu | cfb0120 | 2013-12-01 13:46:49 -0600 | [diff] [blame] | 13 | |
Nguyen Anh Quynh | e5d30e6 | 2014-04-14 16:33:04 +0800 | [diff] [blame] | 14 | install3: |
Andrew Dutcher | d8111c1 | 2016-10-13 20:59:17 -0700 | [diff] [blame] | 15 | rm -rf src/ |
Hank Leininger | 1c02880 | 2015-04-06 16:40:31 -0400 | [diff] [blame] | 16 | if test -n "${DESTDIR}"; then \ |
Andrew Dutcher | d8111c1 | 2016-10-13 20:59:17 -0700 | [diff] [blame] | 17 | python3 setup.py build install --root="${DESTDIR}"; \ |
Hank Leininger | 1c02880 | 2015-04-06 16:40:31 -0400 | [diff] [blame] | 18 | else \ |
Andrew Dutcher | d8111c1 | 2016-10-13 20:59:17 -0700 | [diff] [blame] | 19 | python3 setup.py build install; \ |
Hank Leininger | 1c02880 | 2015-04-06 16:40:31 -0400 | [diff] [blame] | 20 | fi |
Nguyen Anh Quynh | e5d30e6 | 2014-04-14 16:33:04 +0800 | [diff] [blame] | 21 | |
Nguyen Anh Quynh | 6b8445b | 2014-01-08 22:55:06 +0800 | [diff] [blame] | 22 | # NOTE: Newer cython can be installed by: sudo pip install --upgrade cython |
Nguyen Anh Quynh | b3923cf | 2014-01-08 23:18:28 +0800 | [diff] [blame] | 23 | install_cython: |
Andrew Dutcher | f4aed60 | 2016-10-19 13:56:50 -0700 | [diff] [blame] | 24 | rm -rf src/ |
| 25 | if test -n "${DESTDIR}"; then \ |
| 26 | python setup_cython.py build install --root="${DESTDIR}"; \ |
| 27 | else \ |
| 28 | python setup_cython.py build install; \ |
| 29 | fi |
| 30 | |
| 31 | install3_cython: |
| 32 | rm -rf src/ |
| 33 | if test -n "${DESTDIR}"; then \ |
| 34 | python3 setup_cython.py build install --root="${DESTDIR}"; \ |
| 35 | else \ |
| 36 | python3 setup_cython.py build install; \ |
| 37 | fi |
Nguyen Anh Quynh | 4544ba1 | 2015-04-02 22:54:52 +0800 | [diff] [blame] | 38 | |
Nguyen Anh Quynh | 35ceed7 | 2015-02-03 11:45:20 +0800 | [diff] [blame] | 39 | # build & upload PyPi package with source code of the core |
Nguyen Anh Quynh | bf54d4b | 2015-01-30 14:19:45 +0800 | [diff] [blame] | 40 | sdist: |
Nguyen Anh Quynh | a87c0b0 | 2015-02-03 22:30:10 +0800 | [diff] [blame] | 41 | rm -rf src/ dist/ |
Nguyen Anh Quynh | 35ceed7 | 2015-02-03 11:45:20 +0800 | [diff] [blame] | 42 | python setup.py sdist register upload |
Nguyen Anh Quynh | bf54d4b | 2015-01-30 14:19:45 +0800 | [diff] [blame] | 43 | |
Nguyen Anh Quynh | 35ceed7 | 2015-02-03 11:45:20 +0800 | [diff] [blame] | 44 | # build & upload PyPi package with source code of the core |
Nguyen Anh Quynh | bf54d4b | 2015-01-30 14:19:45 +0800 | [diff] [blame] | 45 | sdist3: |
Nguyen Anh Quynh | a87c0b0 | 2015-02-03 22:30:10 +0800 | [diff] [blame] | 46 | rm -rf src/ dist/ |
Nguyen Anh Quynh | 35ceed7 | 2015-02-03 11:45:20 +0800 | [diff] [blame] | 47 | python3 setup.py sdist register upload |
Nguyen Anh Quynh | 00eb3de | 2015-02-03 09:24:14 +0800 | [diff] [blame] | 48 | |
Nguyen Anh Quynh | 35ceed7 | 2015-02-03 11:45:20 +0800 | [diff] [blame] | 49 | # build & upload PyPi package with prebuilt core |
Andrew Dutcher | f4aed60 | 2016-10-19 13:56:50 -0700 | [diff] [blame] | 50 | bdist: |
Nguyen Anh Quynh | a87c0b0 | 2015-02-03 22:30:10 +0800 | [diff] [blame] | 51 | rm -rf src/ dist/ |
Andrew Dutcher | f4aed60 | 2016-10-19 13:56:50 -0700 | [diff] [blame] | 52 | python setup.py bdist_wheel register upload |
Nguyen Anh Quynh | 00eb3de | 2015-02-03 09:24:14 +0800 | [diff] [blame] | 53 | |
Nguyen Anh Quynh | 35ceed7 | 2015-02-03 11:45:20 +0800 | [diff] [blame] | 54 | # build & upload PyPi package with prebuilt core |
Andrew Dutcher | f4aed60 | 2016-10-19 13:56:50 -0700 | [diff] [blame] | 55 | bdist3: |
Nguyen Anh Quynh | a87c0b0 | 2015-02-03 22:30:10 +0800 | [diff] [blame] | 56 | rm -rf src/ dist/ |
Andrew Dutcher | f4aed60 | 2016-10-19 13:56:50 -0700 | [diff] [blame] | 57 | python3 setup.py bdist_wheel register upload |
Nguyen Anh Quynh | bf54d4b | 2015-01-30 14:19:45 +0800 | [diff] [blame] | 58 | |
Nguyen Anh Quynh | 26ee41a | 2013-11-27 12:11:31 +0800 | [diff] [blame] | 59 | clean: |
Andrew Dutcher | f4aed60 | 2016-10-19 13:56:50 -0700 | [diff] [blame] | 60 | rm -rf build/ src/ dist/ *.egg-info |
| 61 | rm -rf capstone/lib capstone/include pyx/lib pyx/include |
| 62 | rm -f pyx/*.c pyx/__init__.py |
| 63 | for f in capstone/*.py; do rm -f pyx/$$(basename $$f)x; done |
| 64 | rm -f MANIFEST |
Andrew Dutcher | 106d241 | 2016-10-25 22:12:54 -0700 | [diff] [blame] | 65 | rm -f *.pyc capstone/*.pyc |
Nguyen Anh Quynh | 984d450 | 2014-10-01 16:42:29 +0800 | [diff] [blame] | 66 | |
| 67 | |
Daniel Collin | 2ee675c | 2015-08-03 18:45:08 +0200 | [diff] [blame] | 68 | TESTS = test_basic.py test_detail.py test_arm.py test_arm64.py test_m68k.py test_mips.py |
Wolfgang Schwotzer | 22b4d0e | 2017-10-21 15:44:36 +0200 | [diff] [blame^] | 69 | TESTS += test_ppc.py test_sparc.py test_systemz.py test_x86.py test_xcore.py test_tms320c64x.py test_m680x.py test_skipdata.py |
Nguyen Anh Quynh | 984d450 | 2014-10-01 16:42:29 +0800 | [diff] [blame] | 70 | check: |
| 71 | @for t in $(TESTS); do \ |
| 72 | echo Check $$t ... ; \ |
Pranith Kumar | 94f8aef | 2016-06-29 11:08:13 -0400 | [diff] [blame] | 73 | ./$$t > /dev/null; \ |
| 74 | if [ $$? -eq 0 ]; then echo OK; else echo FAILED; exit 1; fi \ |
Nguyen Anh Quynh | 984d450 | 2014-10-01 16:42:29 +0800 | [diff] [blame] | 75 | done |
| 76 | |