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