Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 1 | ## |
| 2 | # mksnapshot |
| 3 | # =================================================== |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 4 | |
| 5 | ifneq (,$(filter $(mksnapshot_arch),$(V8_SUPPORTED_ARCH))) |
| 6 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 7 | LOCAL_PATH := $(call my-dir) |
| 8 | include $(CLEAR_VARS) |
| 9 | |
| 10 | # Set up the target identity |
| 11 | LOCAL_IS_HOST_MODULE := true |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 12 | LOCAL_MODULE := v8_mksnapshot.$(mksnapshot_arch) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 13 | LOCAL_MODULE_CLASS := EXECUTABLES |
Jean-Baptiste Queru | 68a1376 | 2012-04-28 10:43:39 -0700 | [diff] [blame] | 14 | LOCAL_MODULE_TAGS = optional |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 15 | LOCAL_MULTILIB := $(mksnapshot_multilib) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 16 | generated_sources := $(call local-generated-sources-dir) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 17 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 18 | V8_LOCAL_JS_LIBRARY_FILES := |
Ben Murdoch | 69a99ed | 2011-11-30 16:03:39 +0000 | [diff] [blame] | 19 | V8_LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES := |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 20 | include $(LOCAL_PATH)/Android.v8common.mk |
| 21 | |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 22 | LOCAL_SRC_FILES += \ |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 23 | src/mksnapshot.cc \ |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 24 | src/snapshot-empty.cc |
| 25 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 26 | ifneq (,$(filter $(HOST_ARCH),x86 x86_64)) |
| 27 | LOCAL_SRC_FILES += src/base/atomicops_internals_x86_gcc.cc |
Ben Murdoch | 3ef787d | 2012-04-12 10:51:47 +0100 | [diff] [blame] | 28 | endif |
| 29 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 30 | ifeq ($(HOST_OS),linux) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 31 | LOCAL_SRC_FILES += \ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 32 | src/base/platform/platform-linux.cc \ |
| 33 | src/base/platform/platform-posix.cc |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 34 | endif |
| 35 | ifeq ($(HOST_OS),darwin) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 36 | LOCAL_SRC_FILES += \ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 37 | src/base/platform/platform-macos.cc \ |
| 38 | src/base/platform/platform-posix.cc |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 39 | endif |
| 40 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 41 | LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_LIBRARY_FILES)) |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 42 | LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES)) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 43 | |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 44 | # Copy js2c.py to generated sources directory and invoke there to avoid |
| 45 | # generating jsmin.pyc in the source directory |
| 46 | JS2C_PY := $(generated_sources)/js2c.py $(generated_sources)/jsmin.py |
| 47 | $(JS2C_PY): $(generated_sources)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 48 | @echo "Copying $@" |
| 49 | $(copy-file-to-target) |
| 50 | |
| 51 | # Generate libraries.cc |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 52 | GEN3 := $(generated_sources)/libraries.cc |
| 53 | $(GEN3): SCRIPT := $(generated_sources)/js2c.py |
Ben Murdoch | 257744e | 2011-11-30 15:57:28 +0000 | [diff] [blame] | 54 | $(GEN3): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 55 | @echo "Generating libraries.cc" |
| 56 | @mkdir -p $(dir $@) |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 57 | python $(SCRIPT) $@ CORE off $(LOCAL_JS_LIBRARY_FILES) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 58 | LOCAL_GENERATED_SOURCES := $(generated_sources)/libraries.cc |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 59 | |
Ben Murdoch | 257744e | 2011-11-30 15:57:28 +0000 | [diff] [blame] | 60 | # Generate experimental-libraries.cc |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 61 | GEN4 := $(generated_sources)/experimental-libraries.cc |
| 62 | $(GEN4): SCRIPT := $(generated_sources)/js2c.py |
Ben Murdoch | 257744e | 2011-11-30 15:57:28 +0000 | [diff] [blame] | 63 | $(GEN4): $(LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES) $(JS2C_PY) |
| 64 | @echo "Generating experimental-libraries.cc" |
| 65 | @mkdir -p $(dir $@) |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 66 | python $(SCRIPT) $@ EXPERIMENTAL off $(LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 67 | LOCAL_GENERATED_SOURCES += $(generated_sources)/experimental-libraries.cc |
Ben Murdoch | 257744e | 2011-11-30 15:57:28 +0000 | [diff] [blame] | 68 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 69 | LOCAL_CFLAGS := \ |
| 70 | -Wno-endif-labels \ |
| 71 | -Wno-import \ |
| 72 | -Wno-format \ |
| 73 | -ansi \ |
Andrei Popescu | 2007755 | 2010-02-26 12:50:21 +0000 | [diff] [blame] | 74 | -fno-rtti \ |
Andrei Popescu | 6a927b2 | 2010-04-21 13:05:17 +0100 | [diff] [blame] | 75 | -DENABLE_DEBUGGER_SUPPORT \ |
Ben Murdoch | 0de1e43 | 2011-07-20 14:27:16 +0100 | [diff] [blame] | 76 | -DENABLE_LOGGING_AND_PROFILING \ |
| 77 | -DENABLE_VMSTATE_TRACKING \ |
Kristian Monsen | e4b6ba4 | 2013-12-06 16:25:56 -0800 | [diff] [blame] | 78 | -DV8_NATIVE_REGEXP \ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 79 | -DV8_LIBRT_NOT_AVAILABLE \ |
| 80 | -Wno-unused-parameter \ |
| 81 | -std=gnu++0x |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 82 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 83 | LOCAL_CFLAGS_v8_target_arm += -DV8_TARGET_ARCH_ARM |
| 84 | LOCAL_CFLAGS_v8_target_arm64 += -DV8_TARGET_ARCH_ARM64 |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 85 | |
| 86 | ifeq ($(ARCH_ARM_HAVE_VFP),true) |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 87 | LOCAL_CFLAGS_v8_target_arm += -DCAN_USE_VFP_INSTRUCTIONS -DCAN_USE_ARMV7_INSTRUCTIONS |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 88 | endif |
| 89 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 90 | LOCAL_CFLAGS_v8_target_mips += -DV8_TARGET_ARCH_MIPS \ |
| 91 | -DCAN_USE_FPU_INSTRUCTIONS \ |
| 92 | -Umips \ |
| 93 | -finline-limit=64 \ |
| 94 | -fno-strict-aliasing |
Andrei Popescu | 2f6dc26 | 2010-02-26 15:19:53 +0000 | [diff] [blame] | 95 | |
Duane Sand | 5a0fc92 | 2014-12-17 16:35:43 -0800 | [diff] [blame^] | 96 | LOCAL_CFLAGS_v8_target_mips64 += -DV8_TARGET_ARCH_MIPS64 \ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 97 | -Umips \ |
| 98 | -finline-limit=64 \ |
| 99 | -fno-strict-aliasing |
| 100 | |
| 101 | LOCAL_CFLAGS_v8_target_x86 += -DV8_TARGET_ARCH_IA32 |
| 102 | LOCAL_CFLAGS_v8_target_x86_64 += -DV8_TARGET_ARCH_X64 |
Chih-Wei Huang | 351b9f7 | 2012-01-05 15:53:10 +0800 | [diff] [blame] | 103 | |
Andrei Popescu | 2007755 | 2010-02-26 12:50:21 +0000 | [diff] [blame] | 104 | ifeq ($(DEBUG_V8),true) |
| 105 | LOCAL_CFLAGS += -DDEBUG -UNDEBUG |
| 106 | endif |
| 107 | |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 108 | # LOCAL_SRC_FILES_arch only applies to target modules, but we want them |
| 109 | # for a host module, so append them manually |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 110 | LOCAL_SRC_FILES += $(v8_local_src_files_$(mksnapshot_arch)) |
| 111 | LOCAL_CFLAGS += $(LOCAL_CFLAGS_v8_target_$(mksnapshot_arch)) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 112 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 113 | LOCAL_C_INCLUDES := \ |
| 114 | $(LOCAL_PATH)/src \ |
| 115 | external/icu/icu4c/source/common \ |
| 116 | external/icu/icu4c/source/i18n |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 117 | |
| 118 | # This is on host. |
| 119 | LOCAL_LDLIBS := -lpthread |
| 120 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 121 | LOCAL_SHARED_LIBRARIES := libicuuc-host libicui18n-host |
| 122 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 123 | LOCAL_STATIC_LIBRARIES := liblog |
| 124 | |
| 125 | include $(BUILD_HOST_EXECUTABLE) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 126 | else |
| 127 | $(warning mksnapshot.$(mksnapshot_arch): architecture $(mksnapshot_arch) not supported) |
| 128 | endif |