2010-07-10 04:39:50 +08:00
|
|
|
##===- source/Interpreter/Makefile ------------------------*- Makefile -*-===##
|
|
|
|
#
|
|
|
|
# The LLVM Compiler Infrastructure
|
|
|
|
#
|
|
|
|
# This file is distributed under the University of Illinois Open Source
|
|
|
|
# License. See LICENSE.TXT for details.
|
|
|
|
#
|
|
|
|
##===----------------------------------------------------------------------===##
|
|
|
|
|
|
|
|
LLDB_LEVEL := ../..
|
|
|
|
LIBRARYNAME := lldbInterpreter
|
|
|
|
BUILD_ARCHIVE = 1
|
|
|
|
|
|
|
|
BUILT_SOURCES := LLDBWrapPython.cpp
|
|
|
|
|
|
|
|
include $(LLDB_LEVEL)/Makefile
|
|
|
|
|
|
|
|
LLDB_PYTHON_SWIG_CPP = $(PROJ_OBJ_ROOT)/$(BuildMode)/LLDBWrapPython.cpp
|
2011-06-21 03:06:35 +08:00
|
|
|
PYTHON_DIR := $(ToolDir)
|
2011-05-20 12:09:55 +08:00
|
|
|
ifeq ($(HOST_OS),Darwin)
|
|
|
|
PYTHON_DEST_DIR := /Library/Python/$(shell python -c 'import sys; print sys.version[:3]')/site-packages
|
|
|
|
else
|
2011-05-20 12:22:48 +08:00
|
|
|
PYTHON_DEST_DIR := $(shell python -c 'import sys; print sys.exec_prefix')/lib/python$(shell python -c 'import sys; print sys.version[:3]')/site-packages
|
2011-05-20 12:09:55 +08:00
|
|
|
endif
|
2010-12-16 10:03:06 +08:00
|
|
|
LLDB_SWIG_INCLUDE_DIRS:= -I"$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/include" -I./.
|
2011-06-21 03:06:35 +08:00
|
|
|
LIBLLDB := $(LibDir)/liblldb$(SHLIBEXT)
|
|
|
|
DEST_LIBLLDB := $(DESTDIR)$(PROJ_libdir)/liblldb$(SHLIBEXT)
|
2010-12-16 10:03:06 +08:00
|
|
|
|
|
|
|
# We need Swig to process stdint.h, but by default it will not inspect system
|
|
|
|
# include directories. The following should cover the standard locations on
|
|
|
|
# most platforms.
|
|
|
|
LLDB_SWIG_INCLUDE_DIRS += -I"/usr/local/include"
|
|
|
|
LLDB_SWIG_INCLUDE_DIRS += -I"/usr/include"
|
2010-07-10 04:39:50 +08:00
|
|
|
|
|
|
|
LLDBWrapPython.cpp:
|
2011-05-20 12:09:55 +08:00
|
|
|
$(Echo) Generating LLDBWrapPython.cpp
|
2011-06-01 10:33:12 +08:00
|
|
|
$(Verb) swig -c++ -shadow -python $(LLDB_SWIG_INCLUDE_DIRS) \
|
2011-06-21 03:06:35 +08:00
|
|
|
-D__STDC_LIMIT_MACROS -outdir "$(PYTHON_DIR)" \
|
2010-12-16 08:01:06 +08:00
|
|
|
-o LLDBWrapPython.cpp "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/lldb.swig"
|
2011-06-01 10:33:12 +08:00
|
|
|
$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/modify-python-lldb.py" \
|
2011-06-21 03:06:35 +08:00
|
|
|
"$(PYTHON_DIR)"
|
2011-06-01 10:33:12 +08:00
|
|
|
$(Verb) python "$(PROJ_SRC_DIR)/$(LLDB_LEVEL)/scripts/Python/edit-swig-python-wrapper-file.py" \
|
|
|
|
"$(PROJ_OBJ_DIR)"
|
|
|
|
$(Verb) if test -f "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited"; then \
|
|
|
|
mv "$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp.edited" \
|
|
|
|
"$(PROJ_OBJ_DIR)/LLDBWrapPython.cpp"; fi
|
2011-05-20 12:09:55 +08:00
|
|
|
$(Verb) cp "$(PROJ_SRC_DIR)/embedded_interpreter.py" "$(PYTHON_DIR)"
|
2011-06-21 03:06:35 +08:00
|
|
|
$(Verb) $(RM) -f $(PYTHON_DIR)/_lldb.so
|
|
|
|
$(Verb) $(AliasTool) $(LIBLLDB) $(PYTHON_DIR)/_lldb.so
|
2011-05-20 12:09:55 +08:00
|
|
|
|
2011-06-21 03:06:35 +08:00
|
|
|
install-local:: $(PYTHON_DIR)/lldb.py $(PYTHON_DIR)/embedded_interpreter.py $(DEST_LIBLLDB)
|
2011-05-20 12:09:55 +08:00
|
|
|
$(Echo) Installing $(BuildMode) LLDB python modules
|
|
|
|
$(Verb) $(MKDIR) $(PYTHON_DEST_DIR)/lib-dynload
|
|
|
|
$(Verb) $(DataInstall) $(PYTHON_DIR)/lldb.py $(PYTHON_DEST_DIR)/lldb.py
|
|
|
|
$(Verb) $(DataInstall) $(PYTHON_DIR)/embedded_interpreter.py $(PYTHON_DEST_DIR)/embedded_interpreter.py
|
|
|
|
$(Verb) $(RM) -f $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so
|
2011-06-21 03:06:35 +08:00
|
|
|
$(Verb) $(AliasTool) $(DEST_LIBLLDB) $(PYTHON_DEST_DIR)/lib-dynload/_lldb.so
|