• 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 := $(addprefix v8/, $(V8_LOCAL_SRC_FILES))
34
35LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/v8/, $(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)/v8/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
60ifeq ($(TARGET_ARCH),arm)
61  LOCAL_CFLAGS += -DV8_TARGET_ARCH_ARM
62endif
63
64ifeq ($(TARGET_ARCH),x86)
65  LOCAL_CFLAGS += -DV8_TARGET_ARCH_IA32
66endif
67
68LOCAL_CFLAGS += -DENABLE_LOGGING_AND_PROFILING
69
70LOCAL_C_INCLUDES := $(LOCAL_PATH)/v8/src
71
72# This is on host.
73LOCAL_LDLIBS := -lpthread
74
75LOCAL_STATIC_LIBRARIES := liblog
76
77include $(BUILD_HOST_EXECUTABLE)
78