2015-08-21 10:04:50 +03:00
|
|
|
# Python binding for Unicorn engine. Nguyen Anh Quynh <aquynh@gmail.com>
|
|
|
|
|
2016-09-13 00:02:14 +03:00
|
|
|
.PHONY: gen_const install install3 clean sdist sdist3 bdist bdist3 sdist_win bdist_win
|
2015-08-21 10:04:50 +03:00
|
|
|
|
|
|
|
gen_const:
|
2021-10-26 14:10:59 +03:00
|
|
|
cd .. && python3 const_generator.py python
|
2015-08-21 10:04:50 +03:00
|
|
|
|
|
|
|
install:
|
2016-09-13 00:02:14 +03:00
|
|
|
rm -rf src/ dist/
|
2015-08-21 10:04:50 +03:00
|
|
|
rm -rf prebuilt/win64/unicorn.dll
|
|
|
|
rm -rf prebuilt/win32/unicorn.dll
|
|
|
|
if test -n "${DESTDIR}"; then \
|
2021-10-26 14:10:59 +03:00
|
|
|
python3 setup.py install --root="${DESTDIR}"; \
|
2015-08-21 10:04:50 +03:00
|
|
|
else \
|
2021-10-26 14:10:59 +03:00
|
|
|
python3 setup.py install; \
|
2015-08-21 10:04:50 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
install3:
|
2016-09-13 00:02:14 +03:00
|
|
|
rm -rf src/ dist/
|
2015-08-21 10:04:50 +03:00
|
|
|
rm -rf prebuilt/win64/unicorn.dll
|
|
|
|
rm -rf prebuilt/win32/unicorn.dll
|
|
|
|
if test -n "${DESTDIR}"; then \
|
2016-09-13 00:02:14 +03:00
|
|
|
python3 setup.py install --root="${DESTDIR}"; \
|
2015-08-21 10:04:50 +03:00
|
|
|
else \
|
2016-09-13 00:02:14 +03:00
|
|
|
python3 setup.py install; \
|
2015-08-21 10:04:50 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
# build & upload PyPi package with source code of the core
|
|
|
|
sdist:
|
|
|
|
rm -rf src/ dist/
|
|
|
|
rm -rf prebuilt/win64/unicorn.dll
|
|
|
|
rm -rf prebuilt/win32/unicorn.dll
|
2021-10-26 14:10:59 +03:00
|
|
|
python3 setup.py sdist register upload
|
2015-08-21 10:04:50 +03:00
|
|
|
|
|
|
|
# build & upload PyPi package with source code of the core
|
|
|
|
sdist3:
|
|
|
|
rm -rf src/ dist/
|
|
|
|
rm -rf prebuilt/win64/unicorn.dll
|
|
|
|
rm -rf prebuilt/win32/unicorn.dll
|
|
|
|
python3 setup.py sdist register upload
|
|
|
|
|
2016-08-15 10:29:38 +03:00
|
|
|
# build & upload PyPi package with precompiled core
|
|
|
|
bdist:
|
|
|
|
rm -rf src/ dist/
|
|
|
|
rm -rf prebuilt/win64/unicorn.dll
|
|
|
|
rm -rf prebuilt/win32/unicorn.dll
|
2021-10-26 14:10:59 +03:00
|
|
|
python3 setup.py bdist_wheel register upload
|
2016-08-15 10:29:38 +03:00
|
|
|
|
|
|
|
# build & upload PyPi package with precompiled core
|
|
|
|
bdist3:
|
|
|
|
rm -rf src/ dist/
|
|
|
|
rm -rf prebuilt/win64/unicorn.dll
|
|
|
|
rm -rf prebuilt/win32/unicorn.dll
|
|
|
|
python3 setup.py bdist_wheel register upload
|
|
|
|
|
2015-08-21 10:04:50 +03:00
|
|
|
# build & upload PyPi package with prebuilt core
|
|
|
|
# NOTE: be sure to have precompiled core under prebuilt/win*/ beforehand
|
|
|
|
sdist_win:
|
|
|
|
rm -rf src/ dist/
|
2021-10-26 14:10:59 +03:00
|
|
|
python3 setup.py sdist register upload
|
2015-08-21 10:04:50 +03:00
|
|
|
|
|
|
|
# build & upload PyPi package with prebuilt core
|
|
|
|
# NOTE: be sure to have precompiled core under prebuilt/win*/ beforehand
|
|
|
|
sdist3_win:
|
|
|
|
rm -rf src/ dist/
|
|
|
|
python3 setup.py sdist register upload
|
|
|
|
|
|
|
|
clean:
|
2016-09-13 00:02:14 +03:00
|
|
|
rm -rf src/ dist/ build/ MANIFEST
|
2015-08-21 10:04:50 +03:00
|
|
|
rm -rf prebuilt/win64/unicorn.dll
|
|
|
|
rm -rf prebuilt/win32/unicorn.dll
|
2016-08-15 10:29:38 +03:00
|
|
|
rm -rf unicorn/lib unicorn/include
|
|
|
|
rm -rf unicorn/*.pyc
|
|
|
|
rm -rf unicorn.egg-info
|
2015-08-21 10:04:50 +03:00
|
|
|
|
|
|
|
|
|
|
|
SAMPLES = sample_arm.py sample_arm64.py sample_mips.py
|
|
|
|
SAMPLES += sample_sparc.py sample_m68k.py sample_x86.py
|
|
|
|
check:
|
|
|
|
@for t in $(SAMPLES); do \
|
|
|
|
echo Check $$t ... ; \
|
|
|
|
./$$t > /dev/null && echo OK || echo FAILED; \
|
|
|
|
done
|
|
|
|
|