• 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.$(TARGET_ARCH)
10LOCAL_MODULE_CLASS := EXECUTABLES
11LOCAL_MODULE_TAGS = optional
12intermediates := $(call local-intermediates-dir)
13
14V8_LOCAL_SRC_FILES :=
15V8_LOCAL_JS_LIBRARY_FILES :=
16V8_LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES :=
17include $(LOCAL_PATH)/Android.v8common.mk
18
19V8_LOCAL_SRC_FILES += \
20  src/mksnapshot.cc \
21  src/snapshot-empty.cc
22
23ifeq ($(TARGET_ARCH),arm)
24V8_LOCAL_SRC_FILES += src/arm/simulator-arm.cc
25endif
26
27ifeq ($(TARGET_ARCH),mips)
28V8_LOCAL_SRC_FILES += src/mips/simulator-mips.cc
29
30endif
31
32ifeq ($(HOST_ARCH),x86)
33V8_LOCAL_SRC_FILES += src/atomicops_internals_x86_gcc.cc
34endif
35
36ifeq ($(HOST_OS),linux)
37V8_LOCAL_SRC_FILES += \
38  src/platform-linux.cc \
39  src/platform-posix.cc
40endif
41ifeq ($(HOST_OS),darwin)
42V8_LOCAL_SRC_FILES += \
43  src/platform-macos.cc \
44  src/platform-posix.cc
45endif
46
47LOCAL_SRC_FILES := $(V8_LOCAL_SRC_FILES)
48
49LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_LIBRARY_FILES))
50LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES))
51
52# Copy js2c.py to intermediates directory and invoke there to avoid generating
53# jsmin.pyc in the source directory
54JS2C_PY := $(intermediates)/js2c.py $(intermediates)/jsmin.py
55$(JS2C_PY): $(intermediates)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP)
56	@echo "Copying $@"
57	$(copy-file-to-target)
58
59# Generate libraries.cc
60GEN3 := $(intermediates)/libraries.cc
61$(GEN3): SCRIPT := $(intermediates)/js2c.py
62$(GEN3): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY)
63	@echo "Generating libraries.cc"
64	@mkdir -p $(dir $@)
65	python $(SCRIPT) $(GEN3) CORE off $(LOCAL_JS_LIBRARY_FILES)
66LOCAL_GENERATED_SOURCES := $(intermediates)/libraries.cc
67
68# Generate experimental-libraries.cc
69GEN4 := $(intermediates)/experimental-libraries.cc
70$(GEN4): SCRIPT := $(intermediates)/js2c.py
71$(GEN4): $(LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES) $(JS2C_PY)
72	@echo "Generating experimental-libraries.cc"
73	@mkdir -p $(dir $@)
74	python $(SCRIPT) $(GEN4) EXPERIMENTAL off $(LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES)
75LOCAL_GENERATED_SOURCES += $(intermediates)/experimental-libraries.cc
76
77LOCAL_CFLAGS := \
78	-Wno-endif-labels \
79	-Wno-import \
80	-Wno-format \
81	-ansi \
82	-fno-rtti \
83	-DENABLE_DEBUGGER_SUPPORT \
84	-DENABLE_LOGGING_AND_PROFILING \
85	-DENABLE_VMSTATE_TRACKING \
86	-DV8_NATIVE_REGEXP
87
88ifeq ($(TARGET_ARCH),arm)
89  LOCAL_CFLAGS += -DV8_TARGET_ARCH_ARM
90endif
91
92ifeq ($(TARGET_CPU_ABI),armeabi-v7a)
93    ifeq ($(ARCH_ARM_HAVE_VFP),true)
94        LOCAL_CFLAGS += -DCAN_USE_VFP_INSTRUCTIONS -DCAN_USE_ARMV7_INSTRUCTIONS
95    endif
96endif
97
98ifeq ($(TARGET_ARCH),mips)
99  LOCAL_CFLAGS += -DV8_TARGET_ARCH_MIPS
100  LOCAL_CFLAGS += -DCAN_USE_FPU_INSTRUCTIONS
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
108endif
109
110ifeq ($(DEBUG_V8),true)
111	LOCAL_CFLAGS += -DDEBUG -UNDEBUG
112endif
113
114LOCAL_C_INCLUDES := $(LOCAL_PATH)/src
115
116# This is on host.
117LOCAL_LDLIBS := -lpthread
118
119LOCAL_STATIC_LIBRARIES := liblog
120
121include $(BUILD_HOST_EXECUTABLE)
122