Replace WebRTCLegacyAPIDisabled by WebRTCLegacyAPIEnabled and switch off WebRTC legac...
[WebKit-https.git] / Source / WebKit / DerivedSources.make
1 # Copyright (C) 2010-2017 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/cache \
27     $(WebKit2)/NetworkProcess/CustomProtocols \
28     $(WebKit2)/NetworkProcess/mac \
29     $(WebKit2)/NetworkProcess/webrtc \
30     $(WebKit2)/PluginProcess \
31     $(WebKit2)/PluginProcess/mac \
32     $(WebKit2)/Shared/Plugins \
33     $(WebKit2)/Shared \
34     $(WebKit2)/Shared/API/Cocoa \
35     $(WebKit2)/Shared/Authentication \
36     $(WebKit2)/Shared/mac \
37     $(WebKit2)/StorageProcess \
38     $(WebKit2)/StorageProcess/IndexedDB \
39     $(WebKit2)/StorageProcess/ServiceWorker \
40     $(WebKit2)/StorageProcess/mac \
41     $(WebKit2)/WebProcess/ApplePay \
42     $(WebKit2)/WebProcess/ApplicationCache \
43     $(WebKit2)/WebProcess/Automation \
44     $(WebKit2)/WebProcess/Cache \
45     $(WebKit2)/WebProcess/Cookies \
46     $(WebKit2)/WebProcess/Databases/IndexedDB \
47     $(WebKit2)/WebProcess/FullScreen \
48     $(WebKit2)/WebProcess/Geolocation \
49     $(WebKit2)/WebProcess/IconDatabase \
50     $(WebKit2)/WebProcess/MediaCache \
51     $(WebKit2)/WebProcess/MediaStream \
52     $(WebKit2)/WebProcess/Network \
53     $(WebKit2)/WebProcess/Network/webrtc \
54     $(WebKit2)/WebProcess/Notifications \
55     $(WebKit2)/WebProcess/OriginData \
56     $(WebKit2)/WebProcess/Plugins \
57     $(WebKit2)/WebProcess/ResourceCache \
58     $(WebKit2)/WebProcess/Storage \
59     $(WebKit2)/WebProcess/UserContent \
60     $(WebKit2)/WebProcess/WebCoreSupport \
61     $(WebKit2)/WebProcess/WebPage \
62     $(WebKit2)/WebProcess/WebPage/RemoteLayerTree \
63     $(WebKit2)/WebProcess/WebStorage \
64     $(WebKit2)/WebProcess/cocoa \
65     $(WebKit2)/WebProcess/ios \
66     $(WebKit2)/WebProcess \
67     $(WebKit2)/UIProcess \
68     $(WebKit2)/UIProcess/ApplePay \
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/WebStorage \
82     $(WebKit2)/UIProcess/mac \
83     $(WebKit2)/UIProcess/ios \
84     $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) \
85 #
86
87 PYTHON = python
88 PERL = perl
89
90 ifeq ($(OS),Windows_NT)
91     DELETE = cmd //C del
92 else
93     DELETE = rm -f
94 endif
95
96 MESSAGE_RECEIVERS = \
97     AuthenticationManager \
98     CacheStorageEngineConnection \
99     ChildProcess \
100     DownloadProxy \
101     DrawingArea \
102     DrawingAreaProxy \
103     EventDispatcher \
104     LegacyCustomProtocolManager \
105     LegacyCustomProtocolManagerProxy \
106     NPObjectMessageReceiver \
107     NetworkConnectionToWebProcess \
108     NetworkProcess \
109     NetworkProcessConnection \
110     NetworkProcessProxy \
111     NetworkRTCMonitor \
112     NetworkRTCProvider \
113     NetworkRTCSocket \
114     NetworkResourceLoader \
115     NetworkSocketStream \
116     PluginControllerProxy \
117     PluginProcess \
118     PluginProcessConnection \
119     PluginProcessConnectionManager \
120     PluginProcessProxy \
121     PluginProxy \
122     RemoteLayerTreeDrawingAreaProxy \
123     RemoteObjectRegistry \
124     RemoteScrollingCoordinator \
125     RemoteWebInspectorProxy \
126     RemoteWebInspectorUI \
127     SecItemShimProxy \
128     ServiceWorkerClientFetch \
129     SmartMagnificationController \
130     StorageAreaMap \
131     StorageManager \
132     StorageProcess \
133     StorageProcessProxy \
134     StorageToWebProcessConnection \
135     UserMediaCaptureManager \
136     UserMediaCaptureManagerProxy \
137     ViewGestureController \
138     ViewGestureGeometryCollector \
139     ViewUpdateDispatcher \
140     VisitedLinkStore \
141     VisitedLinkTableController \
142     WebAutomationSession \
143     WebAutomationSessionProxy \
144     WebCacheStorageConnection \
145     WebConnection \
146     WebCookieManager \
147     WebCookieManagerProxy \
148     WebFullScreenManager \
149     WebFullScreenManagerProxy \
150     WebGeolocationManager \
151     WebGeolocationManagerProxy \
152     WebIDBConnectionToClient \
153     WebIDBConnectionToServer \
154     WebInspector \
155     WebInspectorInterruptDispatcher \
156     WebInspectorProxy \
157     WebInspectorUI \
158     WebNotificationManager \
159     WebPage \
160     WebPageProxy \
161     WebPasteboardProxy \
162     WebPaymentCoordinator \
163     WebPaymentCoordinatorProxy \
164     WebSWClientConnection \
165     WebSWContextManagerConnection \
166     WebSWServerConnection \
167     WebSWServerToContextConnection \
168     PlaybackSessionManager \
169     PlaybackSessionManagerProxy \
170     WebProcess \
171     WebProcessConnection \
172     WebProcessPool \
173     WebProcessProxy \
174     WebRTCMonitor \
175     WebRTCResolver \
176     WebRTCSocket \
177     WebResourceLoader \
178     WebResourceLoadStatisticsStore \
179     WebSocketStream \
180     WebUserContentController \
181     WebUserContentControllerProxy \
182     VideoFullscreenManager \
183     VideoFullscreenManagerProxy \
184 #
185
186 SCRIPTS = \
187     $(WebKit2)/Scripts/generate-message-receiver.py \
188     $(WebKit2)/Scripts/generate-messages-header.py \
189     $(WebKit2)/Scripts/webkit/__init__.py \
190     $(WebKit2)/Scripts/webkit/messages.py \
191     $(WebKit2)/Scripts/webkit/model.py \
192     $(WebKit2)/Scripts/webkit/parser.py \
193 #
194
195 FRAMEWORK_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(FRAMEWORK_SEARCH_PATHS) | perl -e 'print "-F " . join(" -F ", split(" ", <>));')
196 HEADER_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(HEADER_SEARCH_PATHS) | perl -e 'print "-I" . join(" -I", split(" ", <>));')
197
198 -include WebKitDerivedSourcesAdditions.make
199
200 .PHONY : all
201
202 all : \
203     $(MESSAGE_RECEIVERS:%=%MessageReceiver.cpp) \
204     $(MESSAGE_RECEIVERS:%=%Messages.h) \
205 #
206
207 %MessageReceiver.cpp : %.messages.in $(SCRIPTS)
208         @echo Generating messages header for $*...
209         @python $(WebKit2)/Scripts/generate-message-receiver.py $< > $@
210
211 %Messages.h : %.messages.in $(SCRIPTS)
212         @echo Generating message receiver for $*...
213         @python $(WebKit2)/Scripts/generate-messages-header.py $< > $@
214
215
216 # Some versions of clang incorrectly strip out // comments in c89 code.
217 # Use -traditional as a workaround, but only when needed since that causes
218 # other problems with later versions of clang.
219 ifeq ($(shell echo '//x' | $(CC) -E -P -x c -std=c89 - | grep x),)
220 TEXT_PREPROCESSOR_FLAGS=-E -P -x c -traditional -w
221 else
222 TEXT_PREPROCESSOR_FLAGS=-E -P -x c -std=c89 -w
223 endif
224
225 ifneq ($(SDKROOT),)
226         SDK_FLAGS=-isysroot $(SDKROOT)
227 endif
228
229 SANDBOX_PROFILES = \
230         com.apple.WebProcess.sb \
231         com.apple.WebKit.Databases.sb \
232         com.apple.WebKit.plugin-common.sb \
233         com.apple.WebKit.NetworkProcess.sb
234
235 all: $(SANDBOX_PROFILES)
236
237 %.sb : %.sb.in
238         @echo Pre-processing $* sandbox profile...
239         $(CC) $(SDK_FLAGS) $(TEXT_PREPROCESSOR_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" $< > $@
240
241 AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS = \
242         $(JavaScriptCore_SCRIPTS_DIR)/cpp_generator_templates.py \
243         $(JavaScriptCore_SCRIPTS_DIR)/cpp_generator.py \
244         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_backend_dispatcher_header.py \
245         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_backend_dispatcher_implementation.py \
246         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_frontend_dispatcher_header.py \
247         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_frontend_dispatcher_implementation.py \
248         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_protocol_types_header.py \
249         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_protocol_types_implementation.py \
250         $(JavaScriptCore_SCRIPTS_DIR)/generator_templates.py \
251         $(JavaScriptCore_SCRIPTS_DIR)/generator.py \
252         $(JavaScriptCore_SCRIPTS_DIR)/models.py \
253         $(JavaScriptCore_SCRIPTS_DIR)/generate-inspector-protocol-bindings.py \
254 #
255
256 AUTOMATION_PROTOCOL_INPUT_FILES = \
257     $(WebKit2)/UIProcess/Automation/Automation.json \
258 #
259
260 AUTOMATION_PROTOCOL_OUTPUT_FILES = \
261     AutomationBackendDispatchers.h \
262     AutomationBackendDispatchers.cpp \
263     AutomationFrontendDispatchers.h \
264     AutomationFrontendDispatchers.cpp \
265 #
266
267 ifeq ($(OS),MACOS)
268 ifeq ($(shell $(CC) -std=gnu++14 -x c++ -E -P -dM $(SDK_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" /dev/null | grep ' WTF_PLATFORM_IOS ' | cut -d' ' -f3), 1)
269         AUTOMATION_BACKEND_PLATFORM_ARGUMENTS = --platform iOS
270 else
271         AUTOMATION_BACKEND_PLATFORM_ARGUMENTS = --platform macOS
272 endif
273 endif # MACOS
274
275 # JSON-RPC Frontend Dispatchers, Backend Dispatchers, Type Builders
276 $(firstword $(AUTOMATION_PROTOCOL_OUTPUT_FILES)) : $(AUTOMATION_PROTOCOL_INPUT_FILES) $(AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS)
277         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-inspector-protocol-bindings.py --framework WebKit $(AUTOMATION_BACKEND_PLATFORM_ARGUMENTS) --backend --outputDir . $(AUTOMATION_PROTOCOL_INPUT_FILES)
278
279 all : $(firstword $(AUTOMATION_PROTOCOL_OUTPUT_FILES))
280
281 %ScriptSource.h : %.js $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl
282         echo "//# sourceURL=__InjectedScript_$(notdir $<)" > $(basename $(notdir $<)).min.js
283         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py < $< >> $(basename $(notdir $<)).min.js
284         $(PERL) $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl $(basename $(notdir $<))ScriptSource $(basename $(notdir $<)).min.js $@
285         $(DELETE) $(basename $(notdir $<)).min.js
286
287 all : WebAutomationSessionProxyScriptSource.h
288
289 # WebPreferences generation
290
291 WEB_PREFERENCES_TEMPLATES = \
292     $(WebKit2)/Scripts/PreferencesTemplates/WebPageUpdatePreferences.cpp.erb \
293     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesDefinitions.h.erb \
294     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesExperimentalFeatures.cpp.erb \
295     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesKeys.h.erb \
296     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesKeys.cpp.erb \
297     $(WebKit2)/Scripts/PreferencesTemplates/WebPreferencesStoreDefaultsMap.cpp.erb \
298
299 #
300
301 all : WebPageUpdatePreferences.cpp WebPreferencesDefinitions.h WebPreferencesExperimentalFeatures.cpp WebPreferencesKeys.h WebPreferencesKeys.cpp WebPreferencesStoreDefaultsMap.cpp
302
303 WebPageUpdatePreferences%cpp WebPreferencesDefinitions%h WebPreferencesExperimentalFeatures%cpp WebPreferencesKeys%h WebPreferencesKeys%cpp WebPreferencesStoreDefaultsMap%cpp : $(WebKit2)/Scripts/GeneratePreferences.rb $(WEB_PREFERENCES_TEMPLATES) $(WebKit2)/Shared/WebPreferences.yaml
304         $(RUBY) $< --input $(WebKit2)/Shared/WebPreferences.yaml
305