2010-09-29 Joseph Pecoraro <joepeck@webkit.org>
[WebKit-https.git] / Android.mk
index a1f7db9..c0115c1 100644 (file)
@@ -33,6 +33,8 @@ LOCAL_PATH := $(call my-dir)
 #    To help setup buildbot, a new environment variable, USE_ALT_JS_ENGINE,
 #    can be set to true, so that two builds can be different but without
 #    specifying which JS engine to use.
+# To enable JIT in Android's JSC, please set ENABLE_JSC_JIT environment
+# variable to true.
 
 # Read JS_ENGINE environment variable
 JAVASCRIPT_ENGINE = $(JS_ENGINE)
@@ -62,76 +64,13 @@ WEBKIT_SRC_FILES :=
 # We have to use bison 2.3
 include $(BASE_PATH)/bison_check.mk
 
-ifeq ($(JAVASCRIPT_ENGINE),v8)
-d := V8Binding
-LOCAL_PATH := $(BASE_PATH)/$d
-WEBCORE_PATH := $(BASE_PATH)/WebCore
-intermediates := $(base_intermediates)/WebCore
-JAVASCRIPTCORE_PATH := $(BASE_PATH)/JavaScriptCore
-include $(LOCAL_PATH)/V8Binding.derived.mk
-WEBKIT_SRC_FILES += $(addprefix $d/, $(LOCAL_SRC_FILES))
-WEBKIT_SRC_FILES += $(addprefix WebCore/, $(WEBCORE_SRC_FILES))
-
-# Include WTF source file.
-d := JavaScriptCore
-LOCAL_PATH := $(BASE_PATH)/$d
-intermediates := $(base_intermediates)/$d
-include $(LOCAL_PATH)/Android.v8.wtf.mk
-WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
-endif  # JAVASCRIPT_ENGINE == v8
-
-# Include source files for WebCore
-d := WebCore
-LOCAL_PATH := $(BASE_PATH)/$d
-intermediates := $(base_intermediates)/$d
-include $(LOCAL_PATH)/Android.mk
-ifeq ($(JAVASCRIPT_ENGINE),jsc)
-include $(LOCAL_PATH)/Android.jscbindings.mk
-endif
-WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
-
-# Include the derived source files for WebCore. Uses the same path as
-# WebCore
-include $(LOCAL_PATH)/Android.derived.mk
-ifeq ($(JAVASCRIPT_ENGINE),jsc)
-include $(LOCAL_PATH)/Android.derived.jscbindings.mk
-endif
-WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
-
-# Redefine LOCAL_PATH here so the build system is not confused
-LOCAL_PATH := $(BASE_PATH)
-
-# Define our compiler flags
-LOCAL_CFLAGS += -Wno-endif-labels -Wno-import -Wno-format
-LOCAL_CFLAGS += -fno-strict-aliasing
-LOCAL_CFLAGS += -include "WebCorePrefix.h"
-LOCAL_CFLAGS += -fvisibility=hidden
-
-ifeq ($(TARGET_ARCH),arm)
-LOCAL_CFLAGS += -Darm
-endif
-
-ifeq ($(ENABLE_SVG),true)
-LOCAL_CFLAGS += -DENABLE_SVG=1
-endif
-
-# Temporary disable SVG_ANIMATION.
-ifeq ($(ENABLE_SVG_ANIMATION),true)
-LOCAL_CFLAGS += -DENABLE_SVG_ANIMATION=1
-endif
-
-ifeq ($(WEBCORE_INSTRUMENTATION),true)
-LOCAL_CFLAGS += -DANDROID_INSTRUMENT
-endif
-
-# LOCAL_LDLIBS is used in simulator builds only and simulator builds are only
-# valid on Linux
-LOCAL_LDLIBS += -lpthread -ldl
-
 # Build our list of include paths. We include WebKit/android/icu first so that
 # any files that include <unicode/ucnv.h> will include our ucnv.h first. We
 # also add external/ as an include directory so that we can specify the real
 # icu header directory as a more exact reference to avoid including our ucnv.h.
+#
+# Note that JavasCriptCore/ must be included after WebCore/, so that we pick up
+# the right config.h.
 LOCAL_C_INCLUDES := \
        $(JNI_H_INCLUDE) \
        $(LOCAL_PATH)/WebKit/android/icu \
@@ -148,18 +87,16 @@ LOCAL_C_INCLUDES := \
        external/skia/src/ports \
        external/sqlite/dist \
        frameworks/base/core/jni/android/graphics
-ifeq ($(JAVASCRIPT_ENGINE),v8)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       external/v8/include
-endif
 
 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
        $(LOCAL_PATH)/WebCore \
        $(LOCAL_PATH)/WebCore/accessibility \
+       $(LOCAL_PATH)/WebCore/bindings/generic \
        $(LOCAL_PATH)/WebCore/css \
        $(LOCAL_PATH)/WebCore/dom \
        $(LOCAL_PATH)/WebCore/editing \
        $(LOCAL_PATH)/WebCore/history \
+       $(LOCAL_PATH)/WebCore/history/android \
        $(LOCAL_PATH)/WebCore/html \
        $(LOCAL_PATH)/WebCore/html/canvas \
        $(LOCAL_PATH)/WebCore/inspector \
@@ -191,13 +128,6 @@ LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
        $(LOCAL_PATH)/WebCore/storage \
        $(LOCAL_PATH)/WebCore/workers \
        $(LOCAL_PATH)/WebCore/xml
-ifeq ($(JAVASCRIPT_ENGINE),jsc)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(LOCAL_PATH)/WebCore/bindings/js \
-       $(LOCAL_PATH)/WebCore/bridge \
-       $(LOCAL_PATH)/WebCore/bridge/c \
-       $(LOCAL_PATH)/WebCore/bridge/jni
-endif
 
 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
        $(LOCAL_PATH)/WebKit/android \
@@ -208,55 +138,16 @@ LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
        $(LOCAL_PATH)/WebKit/android/stl
 
 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
+       $(LOCAL_PATH)/JavaScriptCore \
        $(LOCAL_PATH)/JavaScriptCore/wtf \
        $(LOCAL_PATH)/JavaScriptCore/wtf/unicode \
        $(LOCAL_PATH)/JavaScriptCore/wtf/unicode/icu
-ifeq ($(JAVASCRIPT_ENGINE),jsc)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(LOCAL_PATH)/JavaScriptCore \
-       $(LOCAL_PATH)/JavaScriptCore/API \
-       $(LOCAL_PATH)/JavaScriptCore/assembler \
-       $(LOCAL_PATH)/JavaScriptCore/bytecode \
-       $(LOCAL_PATH)/JavaScriptCore/bytecompiler \
-       $(LOCAL_PATH)/JavaScriptCore/debugger \
-       $(LOCAL_PATH)/JavaScriptCore/parser \
-       $(LOCAL_PATH)/JavaScriptCore/jit \
-       $(LOCAL_PATH)/JavaScriptCore/interpreter \
-       $(LOCAL_PATH)/JavaScriptCore/pcre \
-       $(LOCAL_PATH)/JavaScriptCore/profiler \
-       $(LOCAL_PATH)/JavaScriptCore/runtime \
-       $(LOCAL_PATH)/JavaScriptCore/wrec \
-       $(LOCAL_PATH)/JavaScriptCore/ForwardingHeaders
-endif
 
 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
        $(base_intermediates)/WebCore/ \
        $(base_intermediates)/WebCore/css \
        $(base_intermediates)/WebCore/html \
        $(base_intermediates)/WebCore/platform
-ifeq ($(JAVASCRIPT_ENGINE),jsc)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(base_intermediates)/WebCore/bindings/js \
-       $(base_intermediates)/WebCore/dom \
-       $(base_intermediates)/WebCore/html/canvas \
-       $(base_intermediates)/WebCore/inspector \
-       $(base_intermediates)/WebCore/loader/appcache \
-       $(base_intermediates)/WebCore/page \
-       $(base_intermediates)/WebCore/plugins \
-       $(base_intermediates)/WebCore/storage \
-       $(base_intermediates)/WebCore/workers \
-       $(base_intermediates)/WebCore/xml
-endif
-ifeq ($(JAVASCRIPT_ENGINE),v8)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(base_intermediates)/WebCore/bindings \
-       $(base_intermediates)/JavaScriptCore
-endif
-
-ifeq ($(JAVASCRIPT_ENGINE),v8)
-LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
-       $(BINDING_C_INCLUDES)
-endif
 
 ifeq ($(ENABLE_SVG), true)
 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
@@ -268,6 +159,78 @@ LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
        $(base_intermediates)/WebCore/svg
 endif
 
+ifeq ($(JAVASCRIPT_ENGINE),v8)
+# Include WTF source file.
+d := JavaScriptCore
+LOCAL_PATH := $(BASE_PATH)/$d
+intermediates := $(base_intermediates)/$d
+include $(LOCAL_PATH)/Android.v8.wtf.mk
+WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
+endif  # JAVASCRIPT_ENGINE == v8
+
+# Include source files for WebCore
+d := WebCore
+LOCAL_PATH := $(BASE_PATH)/$d
+JAVASCRIPTCORE_PATH := $(BASE_PATH)/JavaScriptCore
+intermediates := $(base_intermediates)/$d
+include $(LOCAL_PATH)/Android.mk
+ifeq ($(JAVASCRIPT_ENGINE),jsc)
+include $(LOCAL_PATH)/Android.jscbindings.mk
+endif
+ifeq ($(JAVASCRIPT_ENGINE),v8)
+include $(LOCAL_PATH)/Android.v8bindings.mk
+endif
+WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
+LOCAL_C_INCLUDES += $(BINDING_C_INCLUDES)
+
+# Include the derived source files for WebCore. Uses the same path as
+# WebCore
+include $(LOCAL_PATH)/Android.derived.mk
+ifeq ($(JAVASCRIPT_ENGINE),jsc)
+include $(LOCAL_PATH)/Android.derived.jscbindings.mk
+endif
+ifeq ($(JAVASCRIPT_ENGINE),v8)
+include $(LOCAL_PATH)/Android.derived.v8bindings.mk
+endif
+
+# Redefine LOCAL_PATH here so the build system is not confused
+LOCAL_PATH := $(BASE_PATH)
+
+# Define our compiler flags
+LOCAL_CFLAGS += -Wno-endif-labels -Wno-import -Wno-format
+LOCAL_CFLAGS += -fno-strict-aliasing
+LOCAL_CFLAGS += -include "WebCorePrefix.h"
+LOCAL_CFLAGS += -fvisibility=hidden
+
+# Enable JSC JIT if JSC is used and ENABLE_JSC_JIT environment
+# variable is set to true
+ifeq ($(JAVASCRIPT_ENGINE),jsc)
+ifeq ($(ENABLE_JSC_JIT),true)
+LOCAL_CFLAGS += -DENABLE_ANDROID_JSC_JIT=1
+endif
+endif
+
+ifeq ($(TARGET_ARCH),arm)
+LOCAL_CFLAGS += -Darm
+endif
+
+ifeq ($(ENABLE_SVG),true)
+LOCAL_CFLAGS += -DENABLE_SVG=1
+endif
+
+# Temporary disable SVG_ANIMATION.
+ifeq ($(ENABLE_SVG_ANIMATION),true)
+LOCAL_CFLAGS += -DENABLE_SVG_ANIMATION=1
+endif
+
+ifeq ($(WEBCORE_INSTRUMENTATION),true)
+LOCAL_CFLAGS += -DANDROID_INSTRUMENT
+endif
+
+# LOCAL_LDLIBS is used in simulator builds only and simulator builds are only
+# valid on Linux
+LOCAL_LDLIBS += -lpthread -ldl
+
 # Build the list of shared libraries
 LOCAL_SHARED_LIBRARIES := \
        libandroid_runtime \