1## 2LOCAL_PATH := $(call my-dir) 3# libv8.so 4# =================================================== 5include $(CLEAR_VARS) 6 7include external/stlport/libstlport.mk 8 9# Set up the target identity 10LOCAL_MODULE := libv8 11LOCAL_MODULE_CLASS := STATIC_LIBRARIES 12intermediates := $(call local-intermediates-dir) 13 14PRIVATE_CLEAN_FILES := $(HOST_OUT)/bin/mksnapshot \ 15 $(HOST_OUT)/obj/EXECUTABLES/mksnapshot_intermediates 16 17# Android.v8common.mk defines common V8_LOCAL_SRC_FILES 18# and V8_LOCAL_JS_LIBRARY_FILES 19V8_LOCAL_SRC_FILES := 20V8_LOCAL_JS_LIBRARY_FILES := 21V8_LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES := 22include $(LOCAL_PATH)/Android.v8common.mk 23 24# Target can only be linux 25V8_LOCAL_SRC_FILES += \ 26 src/platform-linux.cc \ 27 src/platform-posix.cc 28 29ifeq ($(TARGET_ARCH),x86) 30V8_LOCAL_SRC_FILES += src/atomicops_internals_x86_gcc.cc 31endif 32 33LOCAL_SRC_FILES := $(V8_LOCAL_SRC_FILES) 34 35LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_LIBRARY_FILES)) 36LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES)) 37 38# Copy js2c.py to intermediates directory and invoke there to avoid generating 39# jsmin.pyc in the source directory 40JS2C_PY := $(intermediates)/js2c.py $(intermediates)/jsmin.py 41$(JS2C_PY): $(intermediates)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP) 42 @echo "Copying $@" 43 $(copy-file-to-target) 44 45# Generate libraries.cc 46GEN1 := $(intermediates)/libraries.cc 47$(GEN1): SCRIPT := $(intermediates)/js2c.py 48$(GEN1): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY) 49 @echo "Generating libraries.cc" 50 @mkdir -p $(dir $@) 51 python $(SCRIPT) $(GEN1) CORE off $(LOCAL_JS_LIBRARY_FILES) 52V8_GENERATED_LIBRARIES := $(intermediates)/libraries.cc 53 54# Generate experimental-libraries.cc 55GEN2 := $(intermediates)/experimental-libraries.cc 56$(GEN2): SCRIPT := $(intermediates)/js2c.py 57$(GEN2): $(LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES) $(JS2C_PY) 58 @echo "Generating experimental-libraries.cc" 59 @mkdir -p $(dir $@) 60 python $(SCRIPT) $(GEN2) EXPERIMENTAL off $(LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES) 61V8_GENERATED_LIBRARIES += $(intermediates)/experimental-libraries.cc 62 63LOCAL_GENERATED_SOURCES += $(V8_GENERATED_LIBRARIES) 64 65# Generate snapshot.cc 66ifeq ($(ENABLE_V8_SNAPSHOT),true) 67SNAP_GEN := $(intermediates)/snapshot.cc 68MKSNAPSHOT := $(HOST_OUT_EXECUTABLES)/mksnapshot 69$(SNAP_GEN): PRIVATE_CUSTOM_TOOL = $(MKSNAPSHOT) --logfile $(intermediates)/v8.log $(SNAP_GEN) 70$(SNAP_GEN): $(MKSNAPSHOT) 71 $(transform-generated-source) 72LOCAL_GENERATED_SOURCES += $(SNAP_GEN) 73else 74LOCAL_SRC_FILES += \ 75 src/snapshot-empty.cc 76endif 77 78# The -fvisibility=hidden option below prevents exporting of symbols from 79# libv8.a in libwebcore.so. That reduces size of libwebcore.so by 500k. 80LOCAL_CFLAGS += \ 81 -Wno-endif-labels \ 82 -Wno-import \ 83 -Wno-format \ 84 -fno-exceptions \ 85 -fvisibility=hidden \ 86 -DENABLE_DEBUGGER_SUPPORT \ 87 -DENABLE_LOGGING_AND_PROFILING \ 88 -DENABLE_VMSTATE_TRACKING \ 89 -DV8_NATIVE_REGEXP 90 91ifeq ($(TARGET_ARCH),arm) 92 LOCAL_CFLAGS += -DARM -DV8_TARGET_ARCH_ARM 93endif 94 95ifeq ($(TARGET_ARCH),x86) 96 LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32 97endif 98 99ifeq ($(DEBUG_V8),true) 100 LOCAL_CFLAGS += -DDEBUG -UNDEBUG 101endif 102 103LOCAL_C_INCLUDES += $(LOCAL_PATH)/src 104 105include $(BUILD_STATIC_LIBRARY) 106