Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 1 | ## |
| 2 | LOCAL_PATH := $(call my-dir) |
| 3 | # libv8.so |
| 4 | # =================================================== |
| 5 | include $(CLEAR_VARS) |
| 6 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 7 | LOCAL_CXX_STL := libc++ |
Steve Block | e0d0d1a | 2012-01-20 16:06:48 +0000 | [diff] [blame] | 8 | |
Paul Lind | 6db049a | 2012-08-01 17:50:26 -0700 | [diff] [blame] | 9 | ifeq ($(TARGET_ARCH),mips) |
| 10 | LOCAL_MIPS_MODE=mips |
| 11 | endif |
| 12 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 13 | # Set up the target identity |
| 14 | LOCAL_MODULE := libv8 |
| 15 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
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 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 18 | LOCAL_MULTILIB := both |
| 19 | |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 20 | # Android.v8common.mk defines V8_LOCAL_JS_LIBRARY_FILES, LOCAL_SRC_FILES, |
| 21 | # LOCAL_CFLAGS, LOCAL_SRC_FILES_arch, and LOCAL_CFLAGS_arch |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 22 | V8_LOCAL_JS_LIBRARY_FILES := |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 23 | V8_LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES := |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 24 | include $(LOCAL_PATH)/Android.v8common.mk |
| 25 | |
| 26 | # Target can only be linux |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 27 | LOCAL_SRC_FILES += \ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 28 | src/base/platform/platform-linux.cc \ |
| 29 | src/base/platform/platform-posix.cc |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 30 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 31 | LOCAL_SRC_FILES_x86 += src/base/atomicops_internals_x86_gcc.cc |
| 32 | LOCAL_SRC_FILES_x86_64 += src/base/atomicops_internals_x86_gcc.cc |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 33 | |
| 34 | LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_LIBRARY_FILES)) |
Ben Murdoch | 589d697 | 2011-11-30 16:04:58 +0000 | [diff] [blame] | 35 | 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] | 36 | |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 37 | # Copy js2c.py to generated sources directory and invoke there to avoid |
| 38 | # generating jsmin.pyc in the source directory |
| 39 | JS2C_PY := $(generated_sources)/js2c.py $(generated_sources)/jsmin.py |
| 40 | $(JS2C_PY): $(generated_sources)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 41 | @echo "Copying $@" |
| 42 | $(copy-file-to-target) |
| 43 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 44 | # Generate libraries.cc |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 45 | GEN1 := $(generated_sources)/libraries.cc |
| 46 | $(GEN1): SCRIPT := $(generated_sources)/js2c.py |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 47 | $(GEN1): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY) |
| 48 | @echo "Generating libraries.cc" |
| 49 | @mkdir -p $(dir $@) |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 50 | python $(SCRIPT) $@ CORE $(LOCAL_JS_LIBRARY_FILES) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 51 | V8_GENERATED_LIBRARIES := $(generated_sources)/libraries.cc |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 52 | |
Ben Murdoch | 257744e | 2011-11-30 15:57:28 +0000 | [diff] [blame] | 53 | # Generate experimental-libraries.cc |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 54 | GEN2 := $(generated_sources)/experimental-libraries.cc |
| 55 | $(GEN2): SCRIPT := $(generated_sources)/js2c.py |
Ben Murdoch | 257744e | 2011-11-30 15:57:28 +0000 | [diff] [blame] | 56 | $(GEN2): $(LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES) $(JS2C_PY) |
| 57 | @echo "Generating experimental-libraries.cc" |
| 58 | @mkdir -p $(dir $@) |
Emily Bernier | d0a1eb7 | 2015-03-24 16:35:39 -0400 | [diff] [blame] | 59 | python $(SCRIPT) $@ EXPERIMENTAL $(LOCAL_JS_EXPERIMENTAL_LIBRARY_FILES) |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 60 | V8_GENERATED_LIBRARIES += $(generated_sources)/experimental-libraries.cc |
Ben Murdoch | 257744e | 2011-11-30 15:57:28 +0000 | [diff] [blame] | 61 | |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 62 | # Generate extra-libraries.cc |
| 63 | GEN3 := $(generated_sources)/extra-libraries.cc |
| 64 | $(GEN3): SCRIPT := $(generated_sources)/js2c.py |
| 65 | $(GEN3): $(JS2C_PY) |
| 66 | @echo "Generating extra-libraries.cc" |
| 67 | @mkdir -p $(dir $@) |
| 68 | python $(SCRIPT) $@ EXTRAS |
| 69 | V8_GENERATED_LIBRARIES += $(generated_sources)/extra-libraries.cc |
| 70 | |
| 71 | # Generate iexperimental-extra-libraries.cc |
| 72 | GEN3 := $(generated_sources)/experimental-extra-libraries.cc |
| 73 | $(GEN3): SCRIPT := $(generated_sources)/js2c.py |
| 74 | $(GEN3): $(JS2C_PY) |
| 75 | @echo "Generating experimental-extra-libraries.cc" |
| 76 | @mkdir -p $(dir $@) |
| 77 | python $(SCRIPT) $@ EXPERIMENTAL_EXTRAS |
| 78 | V8_GENERATED_LIBRARIES += $(generated_sources)/experimental-extra-libraries.cc |
| 79 | |
| 80 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 81 | LOCAL_GENERATED_SOURCES += $(V8_GENERATED_LIBRARIES) |
| 82 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 83 | LOCAL_SRC_FILES += \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 84 | src/snapshot/snapshot-empty.cc \ |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 85 | |
Doug Kwan | a94adf7 | 2010-06-29 00:01:07 -0700 | [diff] [blame] | 86 | # The -fvisibility=hidden option below prevents exporting of symbols from |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 87 | # libv8.a. |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 88 | LOCAL_CFLAGS += \ |
| 89 | -Wno-endif-labels \ |
| 90 | -Wno-import \ |
| 91 | -Wno-format \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 92 | -Wno-unused-parameter \ |
Ben Murdoch | c1074e1 | 2016-07-08 15:18:41 +0100 | [diff] [blame] | 93 | -Wno-sign-compare \ |
| 94 | -Wno-missing-field-initializers \ |
Andrei Popescu | 2007755 | 2010-02-26 12:50:21 +0000 | [diff] [blame] | 95 | -fno-exceptions \ |
Ben Murdoch | d85c144 | 2011-06-14 18:25:07 +0100 | [diff] [blame] | 96 | -fvisibility=hidden \ |
Ben Murdoch | 1c868ba | 2010-04-07 17:34:39 +0100 | [diff] [blame] | 97 | -DENABLE_DEBUGGER_SUPPORT \ |
Ben Murdoch | 0de1e43 | 2011-07-20 14:27:16 +0100 | [diff] [blame] | 98 | -DENABLE_LOGGING_AND_PROFILING \ |
| 99 | -DENABLE_VMSTATE_TRACKING \ |
Kristian Monsen | e4b6ba4 | 2013-12-06 16:25:56 -0800 | [diff] [blame] | 100 | -DV8_NATIVE_REGEXP \ |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 101 | -DV8_I18N_SUPPORT \ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 102 | -std=gnu++0x |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 103 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 104 | LOCAL_CFLAGS_arm += -DV8_TARGET_ARCH_ARM |
| 105 | LOCAL_CFLAGS_arm64 += -DV8_TARGET_ARCH_ARM64 |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 106 | |
Chih-Hung Hsieh | b9fcda9 | 2014-12-17 13:47:26 -0800 | [diff] [blame] | 107 | # atomicops_internals_arm64_gcc.h:77:49: error: |
| 108 | # expected compatible register, symbol or integer in range [0, 4095] |
| 109 | LOCAL_CLANG_CFLAGS_arm64 += -no-integrated-as |
| 110 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 111 | LOCAL_CFLAGS_mips += -DV8_TARGET_ARCH_MIPS \ |
| 112 | -Umips \ |
| 113 | -finline-limit=64 \ |
| 114 | -fno-strict-aliasing |
Duane Sand | 5a0fc92 | 2014-12-17 16:35:43 -0800 | [diff] [blame] | 115 | LOCAL_CFLAGS_mips64 += -DV8_TARGET_ARCH_MIPS64 \ |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 116 | -Umips \ |
| 117 | -finline-limit=64 \ |
| 118 | -fno-strict-aliasing |
Paul Lind | 6db049a | 2012-08-01 17:50:26 -0700 | [diff] [blame] | 119 | |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 120 | LOCAL_CFLAGS_x86 += -DV8_TARGET_ARCH_IA32 |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 121 | LOCAL_CFLAGS_x86_64 += -DV8_TARGET_ARCH_X64 |
Chih-Wei Huang | 351b9f7 | 2012-01-05 15:53:10 +0800 | [diff] [blame] | 122 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 123 | ifeq ($(DEBUG_V8),true) |
| 124 | LOCAL_CFLAGS += -DDEBUG -UNDEBUG |
| 125 | endif |
| 126 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 127 | ifdef TARGET_2ND_ARCH |
| 128 | LOCAL_SRC_FILES_$(TARGET_2ND_ARCH) += $(v8_local_src_files_$(TARGET_2ND_ARCH)) |
| 129 | endif |
| 130 | |
| 131 | LOCAL_SRC_FILES_$(TARGET_ARCH) += $(v8_local_src_files_$(TARGET_ARCH)) |
| 132 | |
Ben Murdoch | 4a90d5f | 2016-03-22 12:00:34 +0000 | [diff] [blame] | 133 | LOCAL_SHARED_LIBRARIES := libicuuc libicui18n |
Narayan Kamath | b2ef858 | 2014-12-30 11:30:33 +0000 | [diff] [blame] | 134 | |
| 135 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/src |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 136 | |
Colin Cross | 45d4c01 | 2014-02-12 16:56:28 -0800 | [diff] [blame] | 137 | LOCAL_MODULE_TARGET_ARCH_WARN := $(V8_SUPPORTED_ARCH) |
| 138 | |
Ben Murdoch | b8a8cc1 | 2014-11-26 15:28:44 +0000 | [diff] [blame] | 139 | LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include |
| 140 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 141 | include $(BUILD_STATIC_LIBRARY) |