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