cf3f1fb221239befaf11a90a998fdf33f5b35fe6
[WebKit-https.git] / Source / WebKit2 / DerivedSources.make
1 # Copyright (C) 2010, 2011, 2012, 2013 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)/DatabaseProcess \
26     $(WebKit2)/DatabaseProcess/IndexedDB \
27     $(WebKit2)/DatabaseProcess/mac \
28     $(WebKit2)/NetworkProcess \
29     $(WebKit2)/NetworkProcess/CustomProtocols \
30     $(WebKit2)/NetworkProcess/mac \
31     $(WebKit2)/PluginProcess \
32     $(WebKit2)/PluginProcess/mac \
33     $(WebKit2)/Shared/Plugins \
34     $(WebKit2)/Shared \
35     $(WebKit2)/Shared/API/Cocoa \
36     $(WebKit2)/Shared/Authentication \
37     $(WebKit2)/Shared/mac \
38     $(WebKit2)/WebProcess/ApplePay \
39     $(WebKit2)/WebProcess/ApplicationCache \
40     $(WebKit2)/WebProcess/Automation \
41     $(WebKit2)/WebProcess/Cookies \
42     $(WebKit2)/WebProcess/Databases/IndexedDB \
43     $(WebKit2)/WebProcess/FullScreen \
44     $(WebKit2)/WebProcess/Geolocation \
45     $(WebKit2)/WebProcess/IconDatabase \
46     $(WebKit2)/WebProcess/MediaCache \
47     $(WebKit2)/WebProcess/Network \
48     $(WebKit2)/WebProcess/Notifications \
49     $(WebKit2)/WebProcess/OriginData \
50     $(WebKit2)/WebProcess/Plugins \
51     $(WebKit2)/WebProcess/ResourceCache \
52     $(WebKit2)/WebProcess/Scrolling \
53     $(WebKit2)/WebProcess/Storage \
54     $(WebKit2)/WebProcess/UserContent \
55     $(WebKit2)/WebProcess/WebCoreSupport \
56     $(WebKit2)/WebProcess/WebPage \
57     $(WebKit2)/WebProcess/cocoa \
58     $(WebKit2)/WebProcess/ios \
59     $(WebKit2)/WebProcess \
60     $(WebKit2)/UIProcess \
61     $(WebKit2)/UIProcess/ApplePay \
62     $(WebKit2)/UIProcess/Automation \
63     $(WebKit2)/UIProcess/Cocoa \
64     $(WebKit2)/UIProcess/Databases \
65     $(WebKit2)/UIProcess/Downloads \
66     $(WebKit2)/UIProcess/Network \
67     $(WebKit2)/UIProcess/Network/CustomProtocols \
68     $(WebKit2)/UIProcess/Notifications \
69     $(WebKit2)/UIProcess/Plugins \
70     $(WebKit2)/UIProcess/Storage \
71     $(WebKit2)/UIProcess/UserContent \
72     $(WebKit2)/UIProcess/mac \
73     $(WebKit2)/UIProcess/ios \
74     $(WEBKITADDITIONS_HEADER_SEARCH_PATHS) \
75 #
76
77 PYTHON = python
78 PERL = perl
79
80 ifeq ($(OS),Windows_NT)
81     DELETE = cmd //C del
82 else
83     DELETE = rm -f
84 endif
85
86 MESSAGE_RECEIVERS = \
87     AuthenticationManager \
88     ChildProcess \
89     CustomProtocolManager \
90     CustomProtocolManagerProxy \
91     DatabaseProcess \
92     DatabaseProcessProxy \
93     DatabaseToWebProcessConnection \
94     DownloadProxy \
95     DrawingArea \
96     DrawingAreaProxy \
97     EventDispatcher \
98     NPObjectMessageReceiver \
99     NetworkConnectionToWebProcess \
100     NetworkProcess \
101     NetworkProcessConnection \
102     NetworkProcessProxy \
103     NetworkResourceLoader \
104     PluginControllerProxy \
105     PluginProcess \
106     PluginProcessConnection \
107     PluginProcessConnectionManager \
108     PluginProcessProxy \
109     PluginProxy \
110     RemoteLayerTreeDrawingAreaProxy \
111     RemoteObjectRegistry \
112     RemoteScrollingCoordinator \
113     RemoteWebInspectorProxy \
114     RemoteWebInspectorUI \
115     SecItemShimProxy \
116     SmartMagnificationController \
117     StorageAreaMap \
118     StorageManager \
119     ViewGestureController \
120     ViewGestureGeometryCollector \
121     ViewUpdateDispatcher \
122     VisitedLinkStore \
123     VisitedLinkTableController \
124     WebAutomationSession \
125     WebAutomationSessionProxy \
126     WebConnection \
127     WebCookieManager \
128     WebCookieManagerProxy \
129     WebFullScreenManager \
130     WebFullScreenManagerProxy \
131     WebGeolocationManager \
132     WebGeolocationManagerProxy \
133     WebIDBConnectionToClient \
134     WebIDBConnectionToServer \
135     WebIconDatabase \
136     WebIconDatabaseProxy \
137     WebInspector \
138     WebInspectorProxy \
139     WebInspectorUI \
140     WebNotificationManager \
141     WebPage \
142     WebPageProxy \
143     WebPasteboardProxy \
144     WebPaymentCoordinator \
145     WebPaymentCoordinatorProxy \
146     WebPlaybackSessionManager \
147     WebPlaybackSessionManagerProxy \
148     WebProcess \
149     WebProcessConnection \
150     WebProcessPool \
151     WebProcessProxy \
152     WebResourceLoader \
153     WebResourceLoadStatisticsStore \
154     WebUserContentController \
155     WebUserContentControllerProxy \
156     WebVideoFullscreenManager \
157     WebVideoFullscreenManagerProxy \
158 #
159
160 SCRIPTS = \
161     $(WebKit2)/Scripts/generate-message-receiver.py \
162     $(WebKit2)/Scripts/generate-messages-header.py \
163     $(WebKit2)/Scripts/webkit/__init__.py \
164     $(WebKit2)/Scripts/webkit/messages.py \
165     $(WebKit2)/Scripts/webkit/model.py \
166     $(WebKit2)/Scripts/webkit/parser.py \
167 #
168
169 FRAMEWORK_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(FRAMEWORK_SEARCH_PATHS) | perl -e 'print "-F " . join(" -F ", split(" ", <>));')
170 HEADER_FLAGS = $(shell echo $(BUILT_PRODUCTS_DIR) $(HEADER_SEARCH_PATHS) | perl -e 'print "-I" . join(" -I", split(" ", <>));')
171
172 -include WebKitDerivedSourcesAdditions.make
173
174 .PHONY : all
175
176 all : \
177     $(MESSAGE_RECEIVERS:%=%MessageReceiver.cpp) \
178     $(MESSAGE_RECEIVERS:%=%Messages.h) \
179 #
180
181 %MessageReceiver.cpp : %.messages.in $(SCRIPTS)
182         @echo Generating messages header for $*...
183         @python $(WebKit2)/Scripts/generate-message-receiver.py $< > $@
184
185 %Messages.h : %.messages.in $(SCRIPTS)
186         @echo Generating message receiver for $*...
187         @python $(WebKit2)/Scripts/generate-messages-header.py $< > $@
188
189
190 # Some versions of clang incorrectly strip out // comments in c89 code.
191 # Use -traditional as a workaround, but only when needed since that causes
192 # other problems with later versions of clang.
193 ifeq ($(shell echo '//x' | $(CC) -E -P -x c -std=c89 - | grep x),)
194 TEXT_PREPROCESSOR_FLAGS=-E -P -x c -traditional -w
195 else
196 TEXT_PREPROCESSOR_FLAGS=-E -P -x c -std=c89 -w
197 endif
198
199 ifneq ($(SDKROOT),)
200         SDK_FLAGS=-isysroot $(SDKROOT)
201 endif
202
203 SANDBOX_PROFILES = \
204         com.apple.WebProcess.sb \
205         com.apple.WebKit.Databases.sb \
206         com.apple.WebKit.NetworkProcess.sb
207
208 all: $(SANDBOX_PROFILES)
209
210 %.sb : %.sb.in
211         @echo Pre-processing $* sandbox profile...
212         $(CC) $(SDK_FLAGS) $(TEXT_PREPROCESSOR_FLAGS) $(FRAMEWORK_FLAGS) $(HEADER_FLAGS) -include "wtf/Platform.h" $< > $@
213
214 AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS = \
215         $(JavaScriptCore_SCRIPTS_DIR)/cpp_generator_templates.py \
216         $(JavaScriptCore_SCRIPTS_DIR)/cpp_generator.py \
217         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_backend_dispatcher_header.py \
218         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_backend_dispatcher_implementation.py \
219         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_protocol_types_header.py \
220         $(JavaScriptCore_SCRIPTS_DIR)/generate_cpp_protocol_types_implementation.py \
221         $(JavaScriptCore_SCRIPTS_DIR)/generator_templates.py \
222         $(JavaScriptCore_SCRIPTS_DIR)/generator.py \
223         $(JavaScriptCore_SCRIPTS_DIR)/models.py \
224         $(JavaScriptCore_SCRIPTS_DIR)/generate-inspector-protocol-bindings.py \
225 #
226
227 AUTOMATION_PROTOCOL_INPUT_FILES = \
228     $(WebKit2)/UIProcess/Automation/Automation.json \
229 #
230
231 AUTOMATION_PROTOCOL_OUTPUT_FILES = \
232     AutomationBackendDispatchers.h \
233     AutomationBackendDispatchers.cpp \
234 #
235
236 # JSON-RPC Backend Dispatchers, Type Builders
237 $(firstword $(AUTOMATION_PROTOCOL_OUTPUT_FILES)) : $(AUTOMATION_PROTOCOL_INPUT_FILES) $(AUTOMATION_PROTOCOL_GENERATOR_SCRIPTS)
238         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-inspector-protocol-bindings.py --framework WebKit --backend --outputDir . $(AUTOMATION_PROTOCOL_INPUT_FILES)
239
240 all : $(firstword $(AUTOMATION_PROTOCOL_OUTPUT_FILES))
241
242 %ScriptSource.h : %.js $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl
243         echo "//# sourceURL=__InjectedScript_$(notdir $<)" > $(basename $(notdir $<)).min.js
244         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py < $< >> $(basename $(notdir $<)).min.js
245         $(PERL) $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl $(basename $(notdir $<))ScriptSource $(basename $(notdir $<)).min.js $@
246         $(DELETE) $(basename $(notdir $<)).min.js
247
248 all : WebAutomationSessionProxyScriptSource.h