• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1##
2# mksnapshot
3# ===================================================
4LOCAL_PATH := $(call my-dir)
5include $(CLEAR_VARS)
6
7# Set up the target identity
8LOCAL_IS_HOST_MODULE := true
9LOCAL_MODULE := mksnapshot
10LOCAL_MODULE_CLASS := EXECUTABLES
11intermediates := $(call local-intermediates-dir)
12
13V8_LOCAL_SRC_FILES :=
14V8_LOCAL_JS_LIBRARY_FILES :=
15include $(LOCAL_PATH)/Android.v8common.mk
16
17V8_LOCAL_SRC_FILES += \
18  src/mksnapshot.cc \
19  src/arm/simulator-arm.cc \
20  src/snapshot-empty.cc
21
22ifeq ($(HOST_OS),linux)
23V8_LOCAL_SRC_FILES += \
24  src/platform-linux.cc \
25  src/platform-posix.cc
26endif
27ifeq ($(HOST_OS),darwin)
28V8_LOCAL_SRC_FILES += \
29  src/platform-macos.cc \
30  src/platform-posix.cc
31endif
32
33LOCAL_SRC_FILES := $(V8_LOCAL_SRC_FILES)
34
35LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_LIBRARY_FILES))
36
37# Copy js2c.py to intermediates directory and invoke there to avoid generating
38# jsmin.pyc in the source directory
39JS2C_PY := $(intermediates)/js2c.py $(intermediates)/jsmin.py
40$(JS2C_PY): $(intermediates)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP)
41	@echo "Copying $@"
42	$(copy-file-to-target)
43
44# Generate libraries.cc
45GEN2 := $(intermediates)/libraries.cc $(intermediates)/libraries-empty.cc
46$(GEN2): SCRIPT := $(intermediates)/js2c.py
47$(GEN2): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY)
48	@echo "Generating libraries.cc"
49	@mkdir -p $(dir $@)
50	python $(SCRIPT) $(GEN2) CORE $(LOCAL_JS_LIBRARY_FILES)
51LOCAL_GENERATED_SOURCES := $(intermediates)/libraries.cc
52
53LOCAL_CFLAGS := \
54	-Wno-endif-labels \
55	-Wno-import \
56	-Wno-format \
57	-ansi \
58	-fno-rtti \
59	-DENABLE_DEBUGGER_SUPPORT \
60	-DENABLE_LOGGING_AND_PROFILING \
61	-DENABLE_VMSTATE_TRACKING \
62	-DV8_NATIVE_REGEXP
63
64ifeq ($(TARGET_ARCH),arm)
65  LOCAL_CFLAGS += -DV8_TARGET_ARCH_ARM
66endif
67
68ifeq ($(TARGET_CPU_ABI),armeabi-v7a)
69    ifeq ($(ARCH_ARM_HAVE_VFP),true)
70        LOCAL_CFLAGS += -DCAN_USE_VFP_INSTRUCTIONS -DCAN_USE_ARMV7_INSTRUCTIONS
71    endif
72endif
73
74ifeq ($(DEBUG_V8),true)
75	LOCAL_CFLAGS += -DDEBUG -UNDEBUG
76endif
77
78LOCAL_C_INCLUDES := $(LOCAL_PATH)/src
79
80# This is on host.
81LOCAL_LDLIBS := -lpthread
82
83LOCAL_STATIC_LIBRARIES := liblog
84
85include $(BUILD_HOST_EXECUTABLE)
86