Edit Makefile to appropriate with new setup.py

This commit is contained in:
Nguyen Tan Cong 2015-01-29 23:21:35 +07:00 committed by Nguyen Anh Quynh
parent 60dcfa0948
commit b54c60c063
2 changed files with 10 additions and 5 deletions

View File

@ -11,11 +11,11 @@ gen_const:
install:
rm -rf $(OBJDIR)
python setup.py build -b $(OBJDIR) install
python setup.py install --do-not-build-core
install3:
rm -rf $(OBJDIR)
python3 setup.py build -b $(OBJDIR) install
python3 setup.py install --do-not-build-core
# NOTE: Newer cython can be installed by: sudo pip install --upgrade cython
install_cython:

View File

@ -20,6 +20,7 @@ VERSION = '3.0'
SYSTEM = platform.system().lower()
FLAG_DONT_BUILD_CORE = "--do-not-build-core"
DONT_BUILD_CORE = False
# parse parameters to detect if FLAG_DONT_BUILD_CORE exists
parser = OptionParser()
parser.add_option(
@ -30,7 +31,11 @@ parser.add_option(
default=False,
)
(option, _) = parser.parse_args()
try:
(option, _) = parser.parse_args()
DONT_BUILD_CORE = option.do_not_build_core
except:
pass
# remove FLAG_DONT_BUILD_CORE to prevent it pass to distutils setup parameters
if FLAG_DONT_BUILD_CORE in sys.argv:
@ -41,7 +46,7 @@ SITE_PACKAGES = os.path.join(get_python_lib(), "capstone")
SETUP_DATA_FILES = []
if not option.do_not_build_core:
if not DONT_BUILD_CORE:
if SYSTEM == "darwin":
SETUP_DATA_FILES.append("src/libcapstone.dylib")
elif SYSTEM != "win32":
@ -126,7 +131,7 @@ class custom_build_clib(build_clib):
build_clib.finalize_options(self)
def build_libraries(self, libraries):
if option.do_not_build_core:
if DONT_BUILD_CORE:
return
for (lib_name, build_info) in libraries: