[Simple line layout] Turn off inline boxtree generation for multiline content
[WebKit-https.git] / Source / WebKit / DerivedSources.make
1 # Copyright (C) 2010-2018 Apple Inc. All rights reserved.
2 #
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions
5 # are met:
6 # 1.  Redistributions of source code must retain the above copyright
7 #     notice, this list of conditions and the following disclaimer.
8 # 2.  Redistributions in binary form must reproduce the above copyright
9 #     notice, this list of conditions and the following disclaimer in the
10 #     documentation and/or other materials provided with the distribution.
11 #
12 # THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
13 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
14 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
15 # DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
16 # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
17 # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
18 # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
19 # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
20 # OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
21 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22
23 VPATH = \
24     $(WebKit2) \
25     $(WebKit2)/NetworkProcess \
26     $(WebKit2)/NetworkProcess/Cookies \
27     $(WebKit2)/NetworkProcess/cache \
28     $(WebKit2)/NetworkProcess/CustomProtocols \
29     $(WebKit2)/NetworkProcess/mac \
30     $(WebKit2)/NetworkProcess/webrtc \
31     $(WebKit2)/NetworkProcess/IndexedDB \
32     $(WebKit2)/NetworkProcess/ServiceWorker \
33     $(WebKit2)/PluginProcess \
34     $(WebKit2)/PluginProcess/mac \
35     $(WebKit2)/Shared/Plugins \
36     $(WebKit2)/Shared \
37     $(WebKit2)/Shared/API/Cocoa \
38     $(WebKit2)/Shared/ApplePay \
39     $(WebKit2)/Shared/Authentication \
40     $(WebKit2)/Shared/mac \
41     $(WebKit2)/WebProcess/ApplePay \
42     $(WebKit2)/WebProcess/ApplicationCache \
43     $(WebKit2)/WebProcess/Automation \
44     $(WebKit2)/WebProcess/Cache \
45     $(WebKit2)/WebProcess/Databases/IndexedDB \
46     $(WebKit2)/WebProcess/FullScreen \
47     $(WebKit2)/WebProcess/Geolocation \
48     $(WebKit2)/WebProcess/IconDatabase \
49     $(WebKit2)/WebProcess/MediaCache \
50     $(WebKit2)/WebProcess/MediaStream \
51     $(WebKit2)/WebProcess/Network \
52     $(WebKit2)/WebProcess/Network/webrtc \
53     $(WebKit2)/WebProcess/Notifications \
54     $(WebKit2)/WebProcess/OriginData \
55     $(WebKit2)/WebProcess/Plugins \
56     $(WebKit2)/WebProcess/ResourceCache \
57     $(WebKit2)/WebProcess/Storage \
58     $(WebKit2)/WebProcess/UserContent \
59     $(WebKit2)/WebProcess/WebAuthentication \
60     $(WebKit2)/WebProcess/WebCoreSupport \
61     $(WebKit2)/WebProcess/WebPage \
62     $(WebKit2)/WebProcess/WebPage/Cocoa \
63     $(WebKit2)/WebProcess/WebPage/RemoteLayerTree \
64     $(WebKit2)/WebProcess/WebStorage \
65     $(WebKit2)/WebProcess/cocoa \
66     $(WebKit2)/WebProcess/ios \
67     $(WebKit2)/WebProcess \
68     $(WebKit2)/UIProcess \
69     $(WebKit2)/UIProcess/Automation \
70     $(WebKit2)/UIProcess/Cocoa \
71     $(WebKit2)/UIProcess/Databases \
72     $(WebKit2)/UIProcess/Downloads \
73     $(WebKit2)/UIProcess/MediaStream \
74     $(WebKit2)/UIProcess/Network \
75     $(WebKit2)/UIProcess/Network/CustomProtocols \
76     $(WebKit2)/UIProcess/Notifications \
77     $(WebKit2)/UIProcess/Plugins \
78     $(WebKit2)/UIProcess/RemoteLayerTree \
79     $(WebKit2)/UIProcess/Storage \
80     $(WebKit2)/UIProcess/UserContent \
81     $(WebKit2)/UIProcess/WebAuthentication \
82     $(WebKit2)/UIProcess/WebStorage \
83     $(WebKit2)/UIProcess/mac \
84     $(WebKit2)/UIProcess/ios \
85     $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) \
86 #
87
88 PYTHON = python
89 PERL = perl
90
91 ifeq ($(OS),Windows_NT)
92     DELETE = cmd //C del
93 else
94     DELETE = rm -f
95 endif
96
97 MESSAGE_RECEIVERS = \
98     AuthenticationManager \
99     AuxiliaryProcess \
100     CacheStorageEngineConnection \
101     DownloadProxy \
102     DrawingArea \
103     DrawingAreaProxy \
104     EditableImageController \
105     EventDispatcher \
106     LegacyCustomProtocolManager \
107     LegacyCustomProtocolManagerProxy \
108     NPObjectMessageReceiver \
109     NetworkConnectionToWebProcess \
110     NetworkContentRuleListManager \
111     NetworkMDNSRegister\
112     NetworkProcess \
113     NetworkProcessConnection \
114     NetworkProcessProxy \
115     NetworkRTCMonitor \
116     NetworkRTCProvider \
117     NetworkRTCSocket \
118     NetworkResourceLoader \
119     NetworkSocketStream \
120     PlaybackSessionManager \
121     PlaybackSessionManagerProxy \
122     PluginControllerProxy \
123     PluginProcess \
124     PluginProcessConnection \
125     PluginProcessConnectionManager \
126     PluginProcessProxy \
127     PluginProxy \
128     RemoteLayerTreeDrawingAreaProxy \
129     RemoteObjectRegistry \
130     RemoteScrollingCoordinator \
131     RemoteWebInspectorProxy \
132     RemoteWebInspectorUI \
133     SecItemShimProxy \
134     ServiceWorkerClientFetch \
135     ServiceWorkerFetchTask \
136     SmartMagnificationController \
137     StorageAreaMap \
138     StorageManager \
139     TextCheckingControllerProxy \
140     UserMediaCaptureManager \
141     UserMediaCaptureManagerProxy \
142     VideoFullscreenManager \
143     VideoFullscreenManagerProxy \
144     ViewGestureController \
145     ViewGestureGeometryCollector \
146     ViewUpdateDispatcher \
147     VisitedLinkStore \
148     VisitedLinkTableController \
149     WebAuthenticatorCoordinator \
150     WebAuthenticatorCoordinatorProxy \
151     WebAutomationSession \
152     WebAutomationSessionProxy \
153     WebCacheStorageConnection \
154     WebConnection \
155     WebCookieManager \
156     WebCookieManagerProxy \
157     WebFullScreenManager \
158     WebFullScreenManagerProxy \
159     WebGeolocationManager \
160     WebGeolocationManagerProxy \
161     WebIDBConnectionToClient \
162     WebIDBConnectionToServer \
163     WebInspector \
164     WebInspectorInterruptDispatcher \
165     WebInspectorProxy \
166     WebInspectorUI \
167     WebMDNSRegister\
168     WebNotificationManager \
169     WebPage \
170     WebPageProxy \
171     WebPasteboardProxy \
172     WebPaymentCoordinator \
173     WebPaymentCoordinatorProxy \
174     WebProcess \
175     WebProcessConnection \
176     WebProcessPool \
177     WebProcessProxy \
178     WebRTCMonitor \
179     WebRTCResolver \
180     WebRTCSocket \
181     WebResourceLoadStatisticsStore \
182     WebResourceLoader \
183     WebSWClientConnection \
184     WebSWContextManagerConnection \
185     WebSWServerConnection \
186     WebSWServerToContextConnection \
187     WebSocketStream \
188     WebUserContentController \
189     WebUserContentControllerProxy \
190 #
191
192 SCRIPTS = \
193     $(WebKit2)/Scripts/generate-message-receiver.py \
194     $(WebKit2)/Scripts/generate-messages-header.py \
195     $(WebKit2)/Scripts/webkit/__init__.py \
196     $(WebKit2)/Scripts/webkit/messages.py \
197     $(WebKit2)/Scripts/webkit/model.py \
198     $(WebKit2)/Scripts/webkit/parser.py \
199 #
200
201 FRAMEWORK_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(FRAMEWORK_SEARCH_PATHS) $(SYSTEM_FRAMEWORK_SEARCH_PATHS) | perl -e 'print "-F " . join(" -F ", split(" ", <>));')
202 HEADER_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(HEADER_SEARCH_PATHS) $(SYSTEM_HEADER_SEARCH_PATHS) | perl -e 'print "-I" . join(" -I", split(" ", <>));')
203
204 -include WebKitDerivedSourcesAdditions.make
205
206 .PHONY : all
207
208 all : \
209     $(MESSAGE_RECEIVERS:%=%MessageReceiver.cpp) \
210     $(MESSAGE_RECEIVERS:%=%Messages.h) \
211 #
212
213 %MessageReceiver.cpp : %.messages.in $(SCRIPTS)
214         @echo Generating message receiver for $*...
215         @python $(WebKit2)/Scripts/generate-message-receiver.py $< > $@
216
217 %Messages.h : %.messages.in $(SCRIPTS)
218         @echo Generating messages header for $*...
219         @python $(WebKit2)/Scripts/generate-messages-header.py $< > $@
220
221 TEXT_PREPROCESSOR_FLAGS=-E -P -w
222
223 ifneq ($(SDKROOT),)
224         SDK_FLAGS=-isysroot $(SDKROOT)
225 endif
226
227 ifeq ($(USE_LLVM_TARGET_TRIPLES_FOR_CLANG),YES)
228         WK_CURRENT_ARCH=$(word 1, $(ARCHS))
229         TARGET_TRIPLE_FLAGS=-target $(WK_CURRENT_ARCH)-$(LLVM_TARGET_TRIPLE_VENDOR)-$(LLVM_TARGET_TRIPLE_OS_VERSION)$(LLVM_TARGET_TRIPLE_SUFFIX)
230 endif
231
232 SANDBOX_PROFILES = \
233         com.apple.WebProcess.sb \
234         com.apple.WebKit.plugin-common.sb \
235         com.apple.WebKit.NetworkProcess.sb
236
237 all : $(SANDBOX_PROFILES)
238
239 %.sb : %.sb.in
240         @echo Pre-processing $* sandbox profile...
241         grep -o '^[^;]*' $< | $(CC) $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(TEXT_PREPROCESSOR_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" - > $@
242
243 AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS = \
244         $(JavaScriptCore_SCRIPTS_DIR)/cpp_generator_templates.py \
245         $(JavaScriptCore_SCRIPTS_DIR)/cpp_generator.py \
246         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_backend_dispatcher_header.py \
247         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_backend_dispatcher_implementation.py \
248         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_frontend_dispatcher_header.py \
249         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_frontend_dispatcher_implementation.py \
250         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_protocol_types_header.py \
251         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_protocol_types_implementation.py \
252         $(JavaScriptCore_SCRIPTS_DIR)/generator_templates.py \
253         $(JavaScriptCore_SCRIPTS_DIR)/generator.py \
254         $(JavaScriptCore_SCRIPTS_DIR)/models.py \
255         $(JavaScriptCore_SCRIPTS_DIR)/generate-inspector-protocol-bindings.py \
256 #
257
258 AUTOMATION_PROTOCOL_INPUT_FILES = \
259     $(WebKit2)/UIProcess/Automation/Automation.json \
260 #
261
262 AUTOMATION_PROTOCOL_OUTPUT_FILES = \
263     AutomationBackendDispatchers.h \
264     AutomationBackendDispatchers.cpp \
265     AutomationFrontendDispatchers.h \
266     AutomationFrontendDispatchers.cpp \
267     AutomationProtocolObjects.h \
268     AutomationProtocolObjects.cpp \
269 #
270 AUTOMATION_PROTOCOL_OUTPUT_PATTERNS = $(subst .,%,$(AUTOMATION_PROTOCOL_OUTPUT_FILES))
271
272 ifeq ($(OS),MACOS)
273 ifeq ($(shell $(CC) -std=gnu++14 -x c++ -E -P -dM $(SDK_FLAGS) $(TARGET_TRIPLE_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ' WTF_PLATFORM_IOS_FAMILY ' | cut -d' ' -f3), 1)
274         AUTOMATION_BACKEND_PLATFORM_ARGUMENTS = --platform iOS
275 else
276         AUTOMATION_BACKEND_PLATFORM_ARGUMENTS = --platform macOS
277 endif
278 endif # MACOS
279
280 # JSON-RPC Frontend Dispatchers, Backend Dispatchers, Type Builders
281 $(AUTOMATION_PROTOCOL_OUTPUT_PATTERNS) : $(AUTOMATION_PROTOCOL_INPUT_FILES) $(AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS)
282         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-inspector-protocol-bindings.py --framework WebKit $(AUTOMATION_BACKEND_PLATFORM_ARGUMENTS) --backend --outputDir . $(AUTOMATION_PROTOCOL_INPUT_FILES)
283
284 all : $(AUTOMATION_PROTOCOL_OUTPUT_FILES)
285
286 %ScriptSource.h : %.js $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl
287         echo "//# sourceURL=__InjectedScript_$(notdir $<)" > $(basename $(notdir $<)).min.js
288         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py < $< >> $(basename $(notdir $<)).min.js
289         $(PERL) $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl $(basename $(notdir $<))ScriptSource $(basename $(notdir $<)).min.js $@
290         $(DELETE) $(basename $(notdir $<)).min.js
291
292 all : WebAutomationSessionProxyScriptSource.h
293
294 # WebPreferences generation
295
296 WEB_PREFERENCES_INPUT_FILES = \
297     $(WebKit2)/Shared/WebPreferences.yaml \
298     $(ADDITIONAL_WEB_PREFERENCES_INPUT_FILES) \
299 #
300 WEB_PREFERENCES_COMBINED_INPUT_FILE = WebPreferencesCombined.yaml
301
302 WEB_PREFERENCES_TEMPLATES = \
303     $(WebKit2)/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb \
304     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb \
305     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb \
306     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesInternalDebugFeatures.cpp.erb \
307     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb \
308     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb \
309     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb \
310 #
311 WEB_PREFERENCES_FILES = $(basename $(notdir $(WEB_PREFERENCES_TEMPLATES)))
312 WEB_PREFERENCES_PATTERNS = $(subst .,%,$(WEB_PREFERENCES_FILES))
313
314 all : $(WEB_PREFERENCES_FILES) $(WEB_PREFERENCES_COMBINED_INPUT_FILE)
315
316 $(WEB_PREFERENCES_COMBINED_INPUT_FILE) : $(WEB_PREFERENCES_INPUT_FILES)
317         cat $^ > $(WEB_PREFERENCES_COMBINED_INPUT_FILE)
318
319 $(WEB_PREFERENCES_PATTERNS) : $(WebKit2)/Scripts/GeneratePreferences.rb $(WEB_PREFERENCES_TEMPLATES) $(WEB_PREFERENCES_COMBINED_INPUT_FILE)
320         $(RUBY) $< --input $(WEB_PREFERENCES_COMBINED_INPUT_FILE)
321
322 # FIXME: We should switch to the internal HTTPSUpgradeList.txt once the feature is ready.
323 # VPATH += $(WebKit2)/Shared/HTTPSUpgrade/
324 VPATH := $(WebKit2)/Shared/HTTPSUpgrade/ $(VPATH)
325
326 all : HTTPSUpgradeList.db
327 HTTPSUpgradeList.db : HTTPSUpgradeList.txt $(WebKit2)/Scripts/generate-https-upgrade-database.sh
328         sh $(WebKit2)/Scripts/generate-https-upgrade-database.sh $< $@