Android.mksnapshot.mk revision 0de1e4345105e23da77663351f2019a015ab98b8
1a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block## 2a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block# mksnapshot 3a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block# =================================================== 4a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_PATH := $(call my-dir) 5a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockinclude $(CLEAR_VARS) 6a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 7a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block# Set up the target identity 8a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_IS_HOST_MODULE := true 9a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_MODULE := mksnapshot 10a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_MODULE_CLASS := EXECUTABLES 11a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockintermediates := $(call local-intermediates-dir) 12a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 13a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockV8_LOCAL_SRC_FILES := 14a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockV8_LOCAL_JS_LIBRARY_FILES := 15a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockinclude $(LOCAL_PATH)/Android.v8common.mk 16a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 17a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockV8_LOCAL_SRC_FILES += \ 18a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block src/mksnapshot.cc \ 19a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block src/arm/simulator-arm.cc \ 20a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block src/snapshot-empty.cc 21a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 22a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockifeq ($(HOST_OS),linux) 23a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockV8_LOCAL_SRC_FILES += \ 24a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block src/platform-linux.cc \ 25a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block src/platform-posix.cc 26a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockendif 27a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockifeq ($(HOST_OS),darwin) 28a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockV8_LOCAL_SRC_FILES += \ 29a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block src/platform-macos.cc \ 30a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block src/platform-posix.cc 31a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockendif 32a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 33a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_SRC_FILES := $(V8_LOCAL_SRC_FILES) 34a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 35a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_LIBRARY_FILES)) 36a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 37a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block# Copy js2c.py to intermediates directory and invoke there to avoid generating 38a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block# jsmin.pyc in the source directory 39a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockJS2C_PY := $(intermediates)/js2c.py $(intermediates)/jsmin.py 40a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block$(JS2C_PY): $(intermediates)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP) 41a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block @echo "Copying $@" 42a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block $(copy-file-to-target) 43a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 44a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block# Generate libraries.cc 4596c8582ea8a7a732db659dc99a625bd7889cfa4dSteve BlockGEN2 := $(intermediates)/libraries.cc $(intermediates)/libraries-empty.cc 4696c8582ea8a7a732db659dc99a625bd7889cfa4dSteve Block$(GEN2): SCRIPT := $(intermediates)/js2c.py 4796c8582ea8a7a732db659dc99a625bd7889cfa4dSteve Block$(GEN2): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY) 48a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block @echo "Generating libraries.cc" 49a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block @mkdir -p $(dir $@) 5096c8582ea8a7a732db659dc99a625bd7889cfa4dSteve Block python $(SCRIPT) $(GEN2) CORE $(LOCAL_JS_LIBRARY_FILES) 51a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_GENERATED_SOURCES := $(intermediates)/libraries.cc 52a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 53a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_CFLAGS := \ 54a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block -Wno-endif-labels \ 55a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block -Wno-import \ 56a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block -Wno-format \ 57a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block -ansi \ 582007755a32dfa1ac843f501dec4fb872f8bbcc52Andrei Popescu -fno-rtti \ 596a927b2a077ba8a767bd21abcfbf1c4e3d1b11e0Andrei Popescu -DENABLE_DEBUGGER_SUPPORT \ 600de1e4345105e23da77663351f2019a015ab98b8Ben Murdoch -DENABLE_LOGGING_AND_PROFILING \ 610de1e4345105e23da77663351f2019a015ab98b8Ben Murdoch -DENABLE_VMSTATE_TRACKING \ 626a927b2a077ba8a767bd21abcfbf1c4e3d1b11e0Andrei Popescu -DV8_NATIVE_REGEXP 63a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 64a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockifeq ($(TARGET_ARCH),arm) 65a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block LOCAL_CFLAGS += -DV8_TARGET_ARCH_ARM 66a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockendif 67a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 682f6dc263a8ff03d497c60c4ec5413b9d1c25e9a2Andrei Popescuifeq ($(TARGET_CPU_ABI),armeabi-v7a) 690c144899d55fcfcd667438a604cf7879fd8624d3Colin Cross ifeq ($(ARCH_ARM_HAVE_VFP),true) 702f6dc263a8ff03d497c60c4ec5413b9d1c25e9a2Andrei Popescu LOCAL_CFLAGS += -DCAN_USE_VFP_INSTRUCTIONS -DCAN_USE_ARMV7_INSTRUCTIONS 712f6dc263a8ff03d497c60c4ec5413b9d1c25e9a2Andrei Popescu endif 722f6dc263a8ff03d497c60c4ec5413b9d1c25e9a2Andrei Popescuendif 732f6dc263a8ff03d497c60c4ec5413b9d1c25e9a2Andrei Popescu 742007755a32dfa1ac843f501dec4fb872f8bbcc52Andrei Popescuifeq ($(DEBUG_V8),true) 752007755a32dfa1ac843f501dec4fb872f8bbcc52Andrei Popescu LOCAL_CFLAGS += -DDEBUG -UNDEBUG 762007755a32dfa1ac843f501dec4fb872f8bbcc52Andrei Popescuendif 772007755a32dfa1ac843f501dec4fb872f8bbcc52Andrei Popescu 78a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_C_INCLUDES := $(LOCAL_PATH)/src 79a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 80a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block# This is on host. 81a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_LDLIBS := -lpthread 82a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 83a7e24c173cf37484693b9abb38e494fa7bd7baebSteve BlockLOCAL_STATIC_LIBRARIES := liblog 84a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Block 85a7e24c173cf37484693b9abb38e494fa7bd7baebSteve Blockinclude $(BUILD_HOST_EXECUTABLE) 86