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 | |
Steve Block | e0d0d1a | 2012-01-20 16:06:48 +0000 | [diff] [blame^] | 7 | include external/stlport/libstlport.mk |
| 8 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 9 | # Set up the target identity |
| 10 | LOCAL_MODULE := libv8 |
| 11 | LOCAL_MODULE_CLASS := STATIC_LIBRARIES |
| 12 | intermediates := $(call local-intermediates-dir) |
| 13 | |
Andrei Popescu | a948b5e | 2010-05-13 12:39:19 +0100 | [diff] [blame] | 14 | PRIVATE_CLEAN_FILES := $(HOST_OUT)/bin/mksnapshot \ |
| 15 | $(HOST_OUT)/obj/EXECUTABLES/mksnapshot_intermediates |
| 16 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 17 | # Android.v8common.mk defines common V8_LOCAL_SRC_FILES |
| 18 | # and V8_LOCAL_JS_LIBRARY_FILES |
| 19 | V8_LOCAL_SRC_FILES := |
| 20 | V8_LOCAL_JS_LIBRARY_FILES := |
| 21 | include $(LOCAL_PATH)/Android.v8common.mk |
| 22 | |
| 23 | # Target can only be linux |
| 24 | V8_LOCAL_SRC_FILES += \ |
| 25 | src/platform-linux.cc \ |
| 26 | src/platform-posix.cc |
| 27 | |
| 28 | LOCAL_SRC_FILES := $(V8_LOCAL_SRC_FILES) |
| 29 | |
| 30 | LOCAL_JS_LIBRARY_FILES := $(addprefix $(LOCAL_PATH)/, $(V8_LOCAL_JS_LIBRARY_FILES)) |
| 31 | |
| 32 | # Copy js2c.py to intermediates directory and invoke there to avoid generating |
| 33 | # jsmin.pyc in the source directory |
| 34 | JS2C_PY := $(intermediates)/js2c.py $(intermediates)/jsmin.py |
| 35 | $(JS2C_PY): $(intermediates)/%.py : $(LOCAL_PATH)/tools/%.py | $(ACP) |
| 36 | @echo "Copying $@" |
| 37 | $(copy-file-to-target) |
| 38 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 39 | # Generate libraries.cc |
Steve Block | 96c8582 | 2011-06-13 19:35:19 +0100 | [diff] [blame] | 40 | GEN1 := $(intermediates)/libraries.cc $(intermediates)/libraries-empty.cc |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 41 | $(GEN1): SCRIPT := $(intermediates)/js2c.py |
| 42 | $(GEN1): $(LOCAL_JS_LIBRARY_FILES) $(JS2C_PY) |
| 43 | @echo "Generating libraries.cc" |
| 44 | @mkdir -p $(dir $@) |
| 45 | python $(SCRIPT) $(GEN1) CORE $(LOCAL_JS_LIBRARY_FILES) |
| 46 | V8_GENERATED_LIBRARIES := $(intermediates)/libraries.cc |
| 47 | |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 48 | LOCAL_GENERATED_SOURCES += $(V8_GENERATED_LIBRARIES) |
| 49 | |
| 50 | # Generate snapshot.cc |
| 51 | ifeq ($(ENABLE_V8_SNAPSHOT),true) |
Leon Clarke | a946cb1 | 2010-02-04 16:19:54 +0000 | [diff] [blame] | 52 | SNAP_GEN := $(intermediates)/snapshot.cc |
Patrick Scott | cf0afc1 | 2010-03-10 17:35:25 -0500 | [diff] [blame] | 53 | MKSNAPSHOT := $(HOST_OUT_EXECUTABLES)/mksnapshot |
Stefan Becker | 96aa864 | 2011-12-21 08:56:36 -0800 | [diff] [blame] | 54 | $(SNAP_GEN): PRIVATE_CUSTOM_TOOL = $(MKSNAPSHOT) --logfile $(intermediates)/v8.log $(SNAP_GEN) |
Patrick Scott | cf0afc1 | 2010-03-10 17:35:25 -0500 | [diff] [blame] | 55 | $(SNAP_GEN): $(MKSNAPSHOT) |
| 56 | $(transform-generated-source) |
| 57 | LOCAL_GENERATED_SOURCES += $(SNAP_GEN) |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 58 | else |
| 59 | LOCAL_SRC_FILES += \ |
| 60 | src/snapshot-empty.cc |
| 61 | endif |
| 62 | |
Doug Kwan | a94adf7 | 2010-06-29 00:01:07 -0700 | [diff] [blame] | 63 | # The -fvisibility=hidden option below prevents exporting of symbols from |
| 64 | # libv8.a in libwebcore.so. That reduces size of libwebcore.so by 500k. |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 65 | LOCAL_CFLAGS += \ |
| 66 | -Wno-endif-labels \ |
| 67 | -Wno-import \ |
| 68 | -Wno-format \ |
Andrei Popescu | 2007755 | 2010-02-26 12:50:21 +0000 | [diff] [blame] | 69 | -fno-exceptions \ |
Ben Murdoch | d85c144 | 2011-06-14 18:25:07 +0100 | [diff] [blame] | 70 | -fvisibility=hidden \ |
Ben Murdoch | 1c868ba | 2010-04-07 17:34:39 +0100 | [diff] [blame] | 71 | -DENABLE_DEBUGGER_SUPPORT \ |
Ben Murdoch | 0de1e43 | 2011-07-20 14:27:16 +0100 | [diff] [blame] | 72 | -DENABLE_LOGGING_AND_PROFILING \ |
| 73 | -DENABLE_VMSTATE_TRACKING \ |
Ben Murdoch | d85c144 | 2011-06-14 18:25:07 +0100 | [diff] [blame] | 74 | -DV8_NATIVE_REGEXP |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 75 | |
Ben Murdoch | 442c3c4 | 2011-06-02 17:41:21 +0100 | [diff] [blame] | 76 | ifeq ($(TARGET_ARCH),arm) |
| 77 | LOCAL_CFLAGS += -DARM -DV8_TARGET_ARCH_ARM |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 78 | endif |
| 79 | |
| 80 | ifeq ($(DEBUG_V8),true) |
| 81 | LOCAL_CFLAGS += -DDEBUG -UNDEBUG |
| 82 | endif |
| 83 | |
Steve Block | e0d0d1a | 2012-01-20 16:06:48 +0000 | [diff] [blame^] | 84 | LOCAL_C_INCLUDES += $(LOCAL_PATH)/src |
Steve Block | a7e24c1 | 2009-10-30 11:49:00 +0000 | [diff] [blame] | 85 | |
| 86 | include $(BUILD_STATIC_LIBRARY) |