3 ## Copyright 2007, The Android Open Source Project
5 ## Licensed under the Apache License, Version 2.0 (the "License");
6 ## you may not use this file except in compliance with the License.
7 ## You may obtain a copy of the License at
9 ## http://www.apache.org/licenses/LICENSE-2.0
11 ## Unless required by applicable law or agreed to in writing, software
12 ## distributed under the License is distributed on an "AS IS" BASIS,
13 ## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 ## See the License for the specific language governing permissions and
15 ## limitations under the License.
18 BASE_PATH := $(call my-dir)
21 # Define our module and find the intermediates directory
22 LOCAL_MODULE := libwebcore
23 LOCAL_MODULE_CLASS := STATIC_LIBRARIES
24 base_intermediates := $(call local-intermediates-dir)
26 # Using := here prevents recursive expansion
29 # We have to use bison 2.3
30 include $(BASE_PATH)/bison_check.mk
33 LOCAL_PATH := $(BASE_PATH)/$d
34 WEBCORE_PATH := $(BASE_PATH)/WebCore
35 intermediates := $(base_intermediates)/WebCore
36 JAVASCRIPTCORE_PATH := $(BASE_PATH)/JavaScriptCore
37 include $(LOCAL_PATH)/V8Binding.derived.mk
38 WEBKIT_SRC_FILES += $(addprefix $d/, $(LOCAL_SRC_FILES))
39 WEBKIT_SRC_FILES += $(addprefix WebCore/, $(WEBCORE_SRC_FILES))
41 # Include WTF source file.
43 LOCAL_PATH := $(BASE_PATH)/$d
44 intermediates := $(base_intermediates)/$d
45 include $(LOCAL_PATH)/Android.v8.wtf.mk
46 WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
48 # Include source files for WebCore
50 LOCAL_PATH := $(BASE_PATH)/$d
51 intermediates := $(base_intermediates)/$d
52 include $(LOCAL_PATH)/Android.v8.mk
53 WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
55 # Include the derived source files for WebCore. Uses the same path as
57 include $(LOCAL_PATH)/Android.v8.derived.mk
58 WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
60 # Include source files for android WebKit port
62 LOCAL_PATH := $(BASE_PATH)/$d
63 intermediates := $(base_intermediates)/$d
64 include $(LOCAL_PATH)/Android.mk
65 WEBKIT_SRC_FILES += $(addprefix $d/,$(LOCAL_SRC_FILES))
67 # Redefine LOCAL_PATH here so the build system is not confused
68 LOCAL_PATH := $(BASE_PATH)
70 # Define our compiler flags
71 LOCAL_CFLAGS += -Wno-endif-labels -Wno-import -Wno-format
72 LOCAL_CFLAGS += -fno-strict-aliasing
73 LOCAL_CFLAGS += -include "WebCorePrefixAndroid.h"
74 LOCAL_CFLAGS += -fvisibility=hidden
76 ifeq ($(TARGET_ARCH),arm)
80 ifeq ($(ENABLE_SVG),true)
81 LOCAL_CFLAGS += -DENABLE_SVG=1
84 # Temporary disable SVG_ANIMATION.
85 ifeq ($(ENABLE_SVG_ANIMATION),true)
86 LOCAL_CFLAGS += -DENABLE_SVG_ANIMATION=1
89 ifeq ($(WEBCORE_INSTRUMENTATION),true)
90 LOCAL_CFLAGS += -DANDROID_INSTRUMENT
93 # LOCAL_LDLIBS is used in simulator builds only and simulator builds are only
95 LOCAL_LDLIBS += -lpthread -ldl
97 # Build our list of include paths. We include WebKit/android/icu first so that
98 # any files that include <unicode/ucnv.h> will include our ucnv.h first. We
99 # also add external/ as an include directory so that we can specify the real
100 # icu header directory as a more exact reference to avoid including our ucnv.h.
101 LOCAL_C_INCLUDES := \
103 $(LOCAL_PATH)/WebKit/android/icu \
105 external/icu4c/common \
106 external/icu4c/i18n \
107 external/libxml2/include \
108 external/skia/emoji \
109 external/skia/include/core \
110 external/skia/include/effects \
111 external/skia/include/images \
112 external/skia/include/ports \
113 external/skia/include/utils \
114 external/skia/src/ports \
115 external/sqlite/dist \
116 frameworks/base/core/jni/android/graphics \
118 $(LOCAL_PATH)/WebCore \
119 $(LOCAL_PATH)/WebCore/accessibility \
120 $(LOCAL_PATH)/WebCore/css \
121 $(LOCAL_PATH)/WebCore/dom \
122 $(LOCAL_PATH)/WebCore/editing \
123 $(LOCAL_PATH)/WebCore/history \
124 $(LOCAL_PATH)/WebCore/html \
125 $(LOCAL_PATH)/WebCore/inspector \
126 $(LOCAL_PATH)/WebCore/loader \
127 $(LOCAL_PATH)/WebCore/loader/appcache \
128 $(LOCAL_PATH)/WebCore/loader/icon \
129 $(LOCAL_PATH)/WebCore/page \
130 $(LOCAL_PATH)/WebCore/page/android \
131 $(LOCAL_PATH)/WebCore/page/animation \
132 $(LOCAL_PATH)/WebCore/platform \
133 $(LOCAL_PATH)/WebCore/platform/android \
134 $(LOCAL_PATH)/WebCore/platform/animation \
135 $(LOCAL_PATH)/WebCore/platform/graphics \
136 $(LOCAL_PATH)/WebCore/platform/graphics/android \
137 $(LOCAL_PATH)/WebCore/platform/graphics/network \
138 $(LOCAL_PATH)/WebCore/platform/graphics/skia \
139 $(LOCAL_PATH)/WebCore/platform/graphics/transforms \
140 $(LOCAL_PATH)/WebCore/platform/image-decoders \
141 $(LOCAL_PATH)/WebCore/platform/network \
142 $(LOCAL_PATH)/WebCore/platform/network/android \
143 $(LOCAL_PATH)/WebCore/platform/sql \
144 $(LOCAL_PATH)/WebCore/platform/text \
145 $(LOCAL_PATH)/WebCore/plugins \
146 $(LOCAL_PATH)/WebCore/plugins/android \
147 $(LOCAL_PATH)/WebCore/rendering \
148 $(LOCAL_PATH)/WebCore/rendering/style \
149 $(LOCAL_PATH)/WebCore/storage \
150 $(LOCAL_PATH)/WebCore/workers \
151 $(LOCAL_PATH)/WebCore/xml \
152 $(LOCAL_PATH)/WebKit/android \
153 $(LOCAL_PATH)/WebKit/android/WebCoreSupport \
154 $(LOCAL_PATH)/WebKit/android/jni \
155 $(LOCAL_PATH)/WebKit/android/nav \
156 $(LOCAL_PATH)/WebKit/android/plugins \
157 $(LOCAL_PATH)/WebKit/android/stl \
158 $(LOCAL_PATH)/JavaScriptCore/wtf \
159 $(LOCAL_PATH)/JavaScriptCore/wtf/unicode \
160 $(LOCAL_PATH)/JavaScriptCore/wtf/unicode/icu \
161 $(BINDING_C_INCLUDES) \
162 $(base_intermediates)/WebCore/ \
163 $(base_intermediates)/WebCore/css \
164 $(base_intermediates)/WebCore/dom \
165 $(base_intermediates)/WebCore/html \
166 $(base_intermediates)/WebCore/inspector \
167 $(base_intermediates)/WebCore/loader/appcache \
168 $(base_intermediates)/WebCore/page \
169 $(base_intermediates)/WebCore/platform \
170 $(base_intermediates)/WebCore/plugins \
171 $(base_intermediates)/WebCore/storage \
172 $(base_intermediates)/WebCore/xml \
173 $(base_intermediates)/JavaScriptCore
175 ifeq ($(ENABLE_SVG), true)
176 LOCAL_C_INCLUDES := $(LOCAL_C_INCLUDES) \
177 $(LOCAL_PATH)/WebCore/platform/graphics/filters \
178 $(LOCAL_PATH)/WebCore/svg \
179 $(LOCAL_PATH)/WebCore/svg/animation \
180 $(LOCAL_PATH)/WebCore/svg/graphics \
181 $(LOCAL_PATH)/WebCore/svg/graphics/filters \
182 $(base_intermediates)/WebCore/svg
185 # Build the list of shared libraries
186 LOCAL_SHARED_LIBRARIES := \
200 # We have to use the android version of libdl when we are not on the simulator
201 ifneq ($(TARGET_SIMULATOR),true)
202 LOCAL_SHARED_LIBRARIES += libdl
205 # Build the list of static libraries
206 LOCAL_STATIC_LIBRARIES := libxml2 libv8
208 # Redefine LOCAL_SRC_FILES to be all the WebKit source files
209 LOCAL_SRC_FILES := $(WEBKIT_SRC_FILES)
211 # Define this for use in other makefiles.
212 WEBKIT_C_INCLUDES := $(LOCAL_C_INCLUDES)
213 WEBKIT_CFLAGS := $(LOCAL_CFLAGS)
214 WEBKIT_GENERATED_SOURCES := $(LOCAL_GENERATED_SOURCES)
215 WEBKIT_LDLIBS := $(LOCAL_LDLIBS)
216 WEBKIT_SHARED_LIBRARIES := $(LOCAL_SHARED_LIBRARIES)
217 WEBKIT_STATIC_LIBRARIES := $(LOCAL_STATIC_LIBRARIES)
219 # Build the library all at once
220 include $(BUILD_STATIC_LIBRARY)
222 # Now build the shared library using only the exported jni entry point. This
223 # will strip out any unused code from the entry point.
224 include $(CLEAR_VARS)
225 # if you need to make webcore huge (for debugging), enable this line
226 #LOCAL_PRELINK_MODULE := false
227 LOCAL_MODULE := libwebcore
228 LOCAL_LDLIBS := $(WEBKIT_LDLIBS)
229 LOCAL_SHARED_LIBRARIES := $(WEBKIT_SHARED_LIBRARIES)
230 LOCAL_STATIC_LIBRARIES := libwebcore $(WEBKIT_STATIC_LIBRARIES)
231 LOCAL_LDFLAGS := -fvisibility=hidden
232 LOCAL_CFLAGS := $(WEBKIT_CFLAGS)
233 LOCAL_C_INCLUDES := $(WEBKIT_C_INCLUDES)
234 LOCAL_PATH := $(BASE_PATH)
236 WebKit/android/jni/WebCoreJniOnLoad.cpp
237 include $(BUILD_SHARED_LIBRARY)
239 # Build the wds client
240 include $(BASE_PATH)/WebKit/android/wds/client/Android.mk
242 # Build the performance command line tool.
243 #include $(BASE_PATH)/perf/Android.mk
245 # Build the webkit merge tool.
246 include $(BASE_PATH)/WebKitTools/android/webkitmerge/Android.mk
248 # Build libv8 and v8shell
249 include $(BASE_PATH)/V8Binding/Android.libv8.mk
250 include $(BASE_PATH)/V8Binding/Android.v8shell.mk