[GTK] [gyp] Add support for building the platform directory
[WebKit-https.git] / Source / WebCore / WebCore.gyp / WebCoreGTK.gyp
1 #
2 # Copyright (C) 2009 Google Inc. All rights reserved.
3 # Copyright (C) 2013 Igalia S.L.
4 #
5 # Redistribution and use in source and binary forms, with or without
6 # modification, are permitted provided that the following conditions are
7 # met:
8 #
9 #     * Redistributions of source code must retain the above copyright
10 # notice, this list of conditions and the following disclaimer.
11 #     * Redistributions in binary form must reproduce the above
12 # copyright notice, this list of conditions and the following disclaimer
13 # in the documentation and/or other materials provided with the
14 # distribution.
15 #     * Neither the name of Google Inc. nor the names of its
16 # contributors may be used to endorse or promote products derived from
17 # this software without specific prior written permission.
18 #
19 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
20 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
21 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
22 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
23 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
24 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
25 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
26 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
27 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
28 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30 #
31 {
32   'includes': [
33     '../WebCore.gypi',
34   ],
35
36   'target_defaults' : {
37       'cflags' : [ '<@(global_cflags)', ],
38       'defines': [ '<@(global_defines)' ],
39   },
40
41   'variables': {
42     'WebCore': '..',
43     'Platform': '../../Platform',
44     'Source': '../..',
45     'Dependencies': '<(Source)/WebKit/gtk/gyp/Dependencies.gyp',
46     'webcoregtk_include_dirs': [
47       '<(WebCore)/accessibility/atk',
48       '<(WebCore)/bindings/js',
49       '<(WebCore)/bridge/jsc',
50       '<(WebCore)/bridge/c',
51       '<(WebCore)/loader/gtk',
52       '<(WebCore)/page/gtk',
53       '<(WebCore)/platform/animation',
54       '<(WebCore)/platform/audio/gstreamer',
55       '<(WebCore)/platform/cairo',
56       '<(WebCore)/platform/geoclue',
57       '<(WebCore)/platform/graphics/cairo',
58       '<(WebCore)/platform/graphics/egl',
59       '<(WebCore)/platform/graphics/freetype',
60       '<(WebCore)/platform/graphics/glx',
61       '<(WebCore)/platform/graphics/gstreamer',
62       '<(WebCore)/platform/graphics/gtk',
63       '<(WebCore)/platform/graphics/harfbuzz',
64       '<(WebCore)/platform/graphics/harfbuzz',
65       '<(WebCore)/platform/graphics/harfbuzz/ng',
66       '<(WebCore)/platform/graphics/harfbuzz/ng',
67       '<(WebCore)/platform/graphics/opengl',
68       '<(WebCore)/platform/gtk',
69       '<(WebCore)/platform/linux',
70       '<(WebCore)/platform/network/gtk',
71       '<(WebCore)/platform/network/soup',
72       '<(WebCore)/platform/text/enchant',
73       '<(WebCore)/plugins/win',
74       '<(Platform)/gtk',
75       '<@(webcore_include_dirs)',
76       '<(SHARED_INTERMEDIATE_DIR)/WebCore',
77       '<(SHARED_INTERMEDIATE_DIR)/WebCore/bindings',
78     ],
79
80     'bindings_idl_files': [
81       '<@(webcore_bindings_idl_files)',
82     ],
83
84     'webcoregtk_test_support_idl_files': [
85       '<(WebCore)/testing/Internals.idl',
86       '<(WebCore)/testing/InternalSettings.idl',
87       '<(WebCore)/testing/MallocStatistics.idl',
88       '<(WebCore)/testing/TypeConversions.idl',
89       '<(SHARED_INTERMEDIATE_DIR)/WebCore/InternalSettingsGenerated.idl',
90     ],
91
92     'excluded_directories_pattern': '(android|chromium|ca|cf|cg|curl|efl|linux|mac|openvg|opentype|posix|qt|skia|iphone|win|wince|wx)/',
93     'excluded_files_suffixes': '(Android|CF|CG|Curl|Linux|Mac|OpenType|POSIX|Posix|Qt|Safari|Skia|Win|WinCE|Wx|V8)\\.(cpp|mm?)$',
94     'excluded_files_patterns': '.*(Chromium|Android).*',
95   },
96
97
98   'targets': [
99     {
100       'target_name': 'WebCoreDependencies',
101       'type': 'none',
102       'dependencies': [
103         '<(Dependencies):cairo',
104         '<(Dependencies):freetype',
105         '<(Dependencies):gail',
106         '<(Dependencies):glib',
107         '<(Dependencies):gstreamer',
108         '<(Dependencies):gtk',
109         '<(Dependencies):icu',
110         '<(Dependencies):libsoup',
111         '<(Dependencies):libsecret',
112         '<(Source)/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCoreGTK.gyp:libjavascriptcoregtk',
113         '<(Source)/WTF/WTF.gyp/WTFGTK.gyp:wtf',
114         '<(Source)/ThirdParty/ANGLE/ANGLE.gyp/ANGLE.gyp:angle',
115         'WebCoreBindingsSources',
116       ],
117       'export_dependent_settings': [
118         '<(Dependencies):cairo',
119         '<(Dependencies):freetype',
120         '<(Dependencies):gail',
121         '<(Dependencies):glib',
122         '<(Dependencies):gstreamer',
123         '<(Dependencies):gtk',
124         '<(Dependencies):icu',
125         '<(Dependencies):libsoup',
126         '<(Dependencies):libsecret',
127         '<(Source)/JavaScriptCore/JavaScriptCore.gyp/JavaScriptCoreGTK.gyp:libjavascriptcoregtk',
128         '<(Source)/WTF/WTF.gyp/WTFGTK.gyp:wtf',
129         '<(Source)/ThirdParty/ANGLE/ANGLE.gyp/ANGLE.gyp:angle',
130       ],
131     },
132     {
133       'target_name': 'InspectorProtocolSources',
134       'type': 'none',
135       'dependencies': [
136         'InspectorProtocolVersion'
137       ],
138       'actions': [
139         {
140           'action_name': 'GenerateInspectorProtocolSources',
141           'inputs': [
142             # First input. It stands for python script in action below.
143             '<(WebCore)/inspector/CodeGeneratorInspector.py',
144             # Other inputs. They go as arguments to the python script.
145             '<(WebCore)/inspector/Inspector.json',
146           ],
147           'outputs': [
148             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorBackendDispatcher.cpp',
149             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorBackendDispatcher.h',
150             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorFrontend.cpp',
151             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorFrontend.h',
152             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorTypeBuilder.cpp',
153             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorTypeBuilder.h',
154             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorBackendCommands.js',
155           ],
156           'variables': {
157             'generator_include_dirs': [
158             ],
159           },
160           'action': [
161             '<(PYTHON)',
162             '<@(_inputs)',
163             '--output_h_dir', '<(SHARED_INTERMEDIATE_DIR)/WebCore',
164
165             # The relative path here is to work around a quirk of gyp that removes duplicate command-line arguments.
166             # See http://crbug.com/146682.
167             '--output_cpp_dir', '<(SHARED_INTERMEDIATE_DIR)/WebCore/../WebCore',
168           ],
169           'message': 'Generating Inspector protocol sources from Inspector.json',
170         },
171       ]
172     },
173     {
174       'target_name': 'InspectorProtocolVersion',
175       'type': 'none',
176       'actions': [
177          {
178           'action_name': 'GenerateInspectorProtocolVersion',
179           'inputs': [
180             '<(WebCore)/inspector/generate-inspector-protocol-version',
181             '<(WebCore)/inspector/Inspector.json',
182           ],
183           'outputs': [
184             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorProtocolVersion.h',
185           ],
186           'variables': {
187             'generator_include_dirs': [
188             ],
189           },
190           'action': [
191             '<(PYTHON)',
192             '<(WebCore)/inspector/generate-inspector-protocol-version',
193             '-o',
194             '<@(_outputs)',
195             '<(WebCore)/inspector/Inspector.json',
196           ],
197           'message': 'Validate inspector protocol for backwards compatibility and generate version file',
198         }
199       ]
200     },
201     {
202       'target_name': 'InjectedScriptSource',
203       'type': 'none',
204       'variables': {
205         'input_file_path': '<(WebCore)/inspector/InjectedScriptSource.js',
206         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/WebCore/InjectedScriptSource.h',
207         'character_array_name': 'InjectedScriptSource_js',
208       },
209       'includes': [ 'ConvertFileToHeaderWithCharacterArray.gypi' ],
210     },
211     {
212       'target_name': 'InjectedScriptCanvasModuleSource',
213       'type': 'none',
214       'variables': {
215         'input_file_path': '<(WebCore)/inspector/InjectedScriptCanvasModuleSource.js',
216         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/WebCore/InjectedScriptCanvasModuleSource.h',
217         'character_array_name': 'InjectedScriptCanvasModuleSource_js',
218       },
219       'includes': [ 'ConvertFileToHeaderWithCharacterArray.gypi' ],
220     },
221     {
222       'target_name': 'InspectorOverlayPage',
223       'type': 'none',
224       'variables': {
225         'input_file_path': '<(WebCore)/inspector/InspectorOverlayPage.html',
226         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/WebCore/InspectorOverlayPage.h',
227         'character_array_name': 'InspectorOverlayPage_html',
228       },
229       'includes': [ 'ConvertFileToHeaderWithCharacterArray.gypi' ],
230     },
231     {
232       'target_name': 'SupplementalDependencies',
233       'type': 'none',
234       'actions': [
235         {
236           'action_name': 'GenerateSupplementalDependency',
237           'variables': {
238             # Write sources into a file, so that the action command line won't
239             # exceed OS limits.
240             'idl_files_list': '<|(idl_files_list.tmp <@(bindings_idl_files))',
241             'conditions': [
242               ['enable_svg!=0', {
243                'idl_files_list': '<|(idl_files_list.tmp <@(bindings_idl_files) <@(webcore_svg_bindings_idl_files))',
244               }],
245             ],
246           },
247           'inputs': [
248             '<(WebCore)/bindings/scripts/preprocess-idls.pl',
249             '<(idl_files_list)',
250             '<!@(cat <(idl_files_list))',
251           ],
252           'outputs': [
253             '<(SHARED_INTERMEDIATE_DIR)/WebCore/supplemental_dependency.tmp',
254           ],
255           'action': [
256             '<(PERL)',
257             '-w',
258             '-I<(WebCore)/bindings/scripts',
259             '<(WebCore)/bindings/scripts/preprocess-idls.pl',
260             '--defines',
261             '<(feature_defines) LANGUAGE_JAVASCRIPT',
262             '--idlFilesList',
263             '<(idl_files_list)',
264             '--supplementalDependencyFile',
265             '<(SHARED_INTERMEDIATE_DIR)/WebCore/supplemental_dependency.tmp',
266           ],
267           'message': 'Resolving [Supplemental=XXX] dependencies in all IDL files',
268         }
269       ]
270     },
271     {
272       'target_name': 'Settings',
273       'type': 'none',
274       'actions': [
275         {
276           'action_name': 'GenerateSettings',
277           'inputs': [
278             '<(WebCore)/page/make_settings.pl',
279             '<(WebCore)/page/Settings.in',
280           ],
281           'outputs': [
282             '<(SHARED_INTERMEDIATE_DIR)/WebCore/SettingsMacros.h',
283             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InternalSettingsGenerated.idl',
284             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InternalSettingsGenerated.cpp',
285             '<(SHARED_INTERMEDIATE_DIR)/WebCore/InternalSettingsGenerated.h',
286           ],
287           'action': [
288             '<(PYTHON)',
289             'scripts/action_makenames.py',
290             '<@(_outputs)',
291             '--',
292             '<@(_inputs)',
293           ],
294         },
295       ]
296     },
297     {
298       'target_name': 'HTMLNames',
299       'type': 'none',
300       'variables': {
301         'make_names_inputs': [
302           '<(WebCore)/html/HTMLTagNames.in',
303           '<(WebCore)/html/HTMLAttributeNames.in',
304         ],
305         'make_names_outputs': [
306           '<(SHARED_INTERMEDIATE_DIR)/WebCore/HTMLNames.cpp',
307           '<(SHARED_INTERMEDIATE_DIR)/WebCore/HTMLNames.h',
308           '<(SHARED_INTERMEDIATE_DIR)/WebCore/HTMLElementFactory.cpp',
309           '<(SHARED_INTERMEDIATE_DIR)/WebCore/bindings/JSHTMLElementWrapperFactory.cpp',
310           '<(SHARED_INTERMEDIATE_DIR)/WebCore/bindings/JSHTMLElementWrapperFactory.h',
311         ],
312         'make_names_extra_arguments': [ '--factory', '--wrapperFactory' ],
313       },
314       'includes': [ 'MakeNames.gypi' ],
315     },
316     {
317       'target_name': 'WebKitFontFamilyNames',
318       'type': 'none',
319       'variables': {
320         'make_names_inputs': [ '<(WebCore)/css/WebKitFontFamilyNames.in', ],
321         'make_names_outputs': [
322           '<(SHARED_INTERMEDIATE_DIR)/WebCore/WebKitFontFamilyNames.cpp',
323           '<(SHARED_INTERMEDIATE_DIR)/WebCore/WebKitFontFamilyNames.h',
324         ],
325         'make_names_extra_arguments': [ '--fonts' ],
326       },
327       'includes': [ 'MakeNames.gypi' ],
328     },
329     {
330       'target_name': 'SVGNames',
331       'type': 'none',
332       'variables': {
333         'make_names_inputs': [
334           '<(WebCore)/svg/svgtags.in',
335           '<(WebCore)/svg/svgattrs.in',
336         ],
337         'make_names_outputs': [
338           '<(SHARED_INTERMEDIATE_DIR)/WebCore/SVGNames.cpp',
339           '<(SHARED_INTERMEDIATE_DIR)/WebCore/SVGNames.h',
340           '<(SHARED_INTERMEDIATE_DIR)/WebCore/SVGElementFactory.cpp',
341           '<(SHARED_INTERMEDIATE_DIR)/WebCore/SVGElementFactory.h',
342           '<(SHARED_INTERMEDIATE_DIR)/WebCore/JSSVGElementWrapperFactory.cpp',
343           '<(SHARED_INTERMEDIATE_DIR)/WebCore/JSSVGElementWrapperFactory.h',
344         ],
345         'make_names_extra_arguments': [ '--factory', '--wrapperFactory' ],
346       },
347       'includes': [ 'MakeNames.gypi' ],
348     },
349     {
350       'target_name': 'MathMLNames',
351       'type': 'none',
352       'variables': {
353         'make_names_inputs': [
354           '<(WebCore)/mathml/mathtags.in',
355           '<(WebCore)/mathml/mathattrs.in',
356         ],
357         'make_names_outputs': [
358           '<(SHARED_INTERMEDIATE_DIR)/WebCore/MathMLNames.cpp',
359           '<(SHARED_INTERMEDIATE_DIR)/WebCore/MathMLNames.h',
360           '<(SHARED_INTERMEDIATE_DIR)/WebCore/MathMLElementFactory.cpp',
361           '<(SHARED_INTERMEDIATE_DIR)/WebCore/MathMLElementFactory.h',
362         ],
363         'make_names_extra_arguments': [ '--factory', ],
364       },
365       'includes': [ 'MakeNames.gypi' ],
366     },
367     {
368       'target_name': 'XLinkNames',
369       'type': 'none',
370       'variables': {
371         'make_names_inputs': [ '<(WebCore)/svg/xlinkattrs.in', ],
372         'make_names_outputs': [
373           '<(SHARED_INTERMEDIATE_DIR)/WebCore/XLinkNames.cpp',
374           '<(SHARED_INTERMEDIATE_DIR)/WebCore/XLinkNames.h',
375         ],
376         'make_names_extra_arguments': [ '--factory', ],
377       },
378       'includes': [ 'MakeNames.gypi' ],
379     },
380     {
381       'target_name': 'XMLNSNames',
382       'type': 'none',
383       'variables': {
384         'make_names_inputs': [ '<(WebCore)/xml/xmlnsattrs.in', ],
385         'make_names_outputs': [
386           '<(SHARED_INTERMEDIATE_DIR)/WebCore/XMLNSNames.cpp',
387           '<(SHARED_INTERMEDIATE_DIR)/WebCore/XMLNSNames.h',
388         ],
389         'make_names_extra_arguments': [ ],
390       },
391       'includes': [ 'MakeNames.gypi' ],
392     },
393     {
394       'target_name': 'XMLNames',
395       'type': 'none',
396       'variables': {
397         'make_names_inputs': [ '<(WebCore)/xml/xmlattrs.in', ],
398         'make_names_outputs': [
399           '<(SHARED_INTERMEDIATE_DIR)/WebCore/XMLNames.cpp',
400           '<(SHARED_INTERMEDIATE_DIR)/WebCore/XMLNames.h',
401         ],
402         'make_names_extra_arguments': [ ],
403       },
404       'includes': [ 'MakeNames.gypi' ],
405     },
406     {
407       'target_name': 'XMLViewerCSS',
408       'type': 'none',
409       'variables': {
410         'input_file_path': '<(WebCore)/xml/XMLViewer.css',
411         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/WebCore/XMLViewerCSS.h',
412         'character_array_name': 'XMLViewer_css',
413       },
414       'includes': [ 'ConvertFileToHeaderWithCharacterArray.gypi' ],
415     },
416     {
417       'target_name': 'XMLViewerJS',
418       'type': 'none',
419       'variables': {
420         'input_file_path': '<(WebCore)/xml/XMLViewer.js',
421         'output_file_path': '<(SHARED_INTERMEDIATE_DIR)/WebCore/XMLViewerJS.h',
422         'character_array_name': 'XMLViewer_js',
423       },
424       'includes': [ 'ConvertFileToHeaderWithCharacterArray.gypi' ],
425     },
426     {
427       'target_name': 'WebCoreBindingsSources',
428       'type': 'none',
429       'hard_dependency': 1,
430       'dependencies': [
431         'HTMLNames',
432         'SVGNames',
433         'MathMLNames',
434         'XLinkNames',
435         'XMLNSNames',
436         'XMLNames',
437         'XMLViewerCSS',
438         'XMLViewerJS',
439         'WebKitFontFamilyNames',
440         'SupplementalDependencies',
441         'Settings',
442       ],
443       'sources': [
444         # bison rule
445         '<(SHARED_INTERMEDIATE_DIR)/WebCore/CSSGrammar.y',
446         '<(WebCore)/xml/XPathGrammar.y',
447
448         # gperf rule
449         '<(WebCore)/platform/ColorData.gperf',
450
451         # idl rules
452         '<@(bindings_idl_files)',
453         '<@(webcoregtk_test_support_idl_files)',
454       ],
455       'sources!': [
456         # Custom bindings in bindings/js exist for these.
457         '<(WebCore)/dom/EventListener.idl',
458
459         # Bindings with custom Objective-C implementations.
460         '<(WebCore)/page/AbstractView.idl',
461
462         # These bindings are excluded, as they're only used through inheritance
463         # and don't define constants that would need a constructor.
464         '<(WebCore)/svg/ElementTimeControl.idl',
465         '<(WebCore)/svg/SVGExternalResourcesRequired.idl',
466         '<(WebCore)/svg/SVGFilterPrimitiveStandardAttributes.idl',
467         '<(WebCore)/svg/SVGFitToViewBox.idl',
468         '<(WebCore)/svg/SVGLangSpace.idl',
469         '<(WebCore)/svg/SVGLocatable.idl',
470         '<(WebCore)/svg/SVGTests.idl',
471         '<(WebCore)/svg/SVGTransformable.idl',
472
473         '<(WebCore)/css/CSSUnknownRule.idl',
474       ],
475
476       'conditions': [
477         ['enable_svg!=0', {
478           'sources': [ '<@(webcore_svg_bindings_idl_files)', ],
479         }],
480       ],
481       'actions': [
482         {
483           'action_name': 'GenerateHTMLEntityTable',
484           'inputs': [
485             '<(WebCore)/html/parser/create-html-entity-table',
486             '<(WebCore)/html/parser/HTMLEntityNames.in',
487           ],
488           'outputs': [
489             '<(SHARED_INTERMEDIATE_DIR)/WebCore/HTMLEntityTable.cpp'
490           ],
491           'action': [
492             '<(PYTHON)',
493             '<(WebCore)/html/parser/create-html-entity-table',
494             '-o',
495             '<@(_outputs)',
496             '<(WebCore)/html/parser/HTMLEntityNames.in',
497           ],
498         },
499         {
500           'action_name': 'GenerateCSSPropertyNames',
501           'inputs': [
502             '<(WebCore)/css/makeprop.pl',
503             '<(WebCore)/css/CSSPropertyNames.in',
504           ],
505           'outputs': [
506             '<(SHARED_INTERMEDIATE_DIR)/WebCore/CSSPropertyNames.cpp',
507             '<(SHARED_INTERMEDIATE_DIR)/WebCore/CSSPropertyNames.h',
508           ],
509           'action': [
510             '<(PYTHON)',
511             'scripts/action_csspropertynames.py',
512             '<@(_outputs)',
513             '--',
514             '--defines', '<(feature_defines)',
515             '--',
516             '<@(_inputs)',
517           ],
518           'conditions': [
519             # TODO(maruel): Move it in its own project or generate it anyway?
520             ['enable_svg!=0', {
521               'inputs': [
522                 '<(WebCore)/css/SVGCSSPropertyNames.in',
523               ],
524             }],
525           ],
526         },
527         {
528           'action_name': 'GenerateCSSValueKeywords',
529           'inputs': [
530             '<(WebCore)/css/makevalues.pl',
531             '<(WebCore)/css/CSSValueKeywords.in',
532           ],
533           'outputs': [
534             '<(SHARED_INTERMEDIATE_DIR)/WebCore/CSSValueKeywords.cpp',
535             '<(SHARED_INTERMEDIATE_DIR)/WebCore/CSSValueKeywords.h',
536           ],
537           'action': [
538             '<(PYTHON)',
539             'scripts/action_cssvaluekeywords.py',
540             '<@(_outputs)',
541             '--',
542             '--defines', '<(feature_defines)',
543             '--',
544             '<@(_inputs)',
545           ],
546           'conditions': [
547             # TODO(maruel): Move it in its own project or generate it anyway?
548             ['enable_svg!=0', {
549               'inputs': [
550                 '<(WebCore)/css/SVGCSSValueKeywords.in',
551               ],
552             }],
553           ],
554         },
555         {
556           'action_name': 'GenerateEventFactory',
557           'inputs': [
558             '<(WebCore)/dom/make_event_factory.pl',
559             '<(WebCore)/dom/EventNames.in',
560           ],
561           'outputs': [
562             '<(SHARED_INTERMEDIATE_DIR)/WebCore/EventFactory.cpp',
563             '<(SHARED_INTERMEDIATE_DIR)/WebCore/EventHeaders.h',
564             '<(SHARED_INTERMEDIATE_DIR)/WebCore/EventInterfaces.h',
565           ],
566           'action': [
567             '<(PYTHON)',
568             'scripts/action_makenames.py',
569             '<@(_outputs)',
570             '--',
571             '<@(_inputs)',
572           ],
573         },
574         {
575           'action_name': 'GenreateEventTargetFactory',
576           'inputs': [
577             '<(WebCore)/dom/make_event_factory.pl',
578             '<(WebCore)/dom/EventTargetFactory.in',
579           ],
580           'outputs': [
581             '<(SHARED_INTERMEDIATE_DIR)/WebCore/EventTargetHeaders.h',
582             '<(SHARED_INTERMEDIATE_DIR)/WebCore/EventTargetInterfaces.h',
583           ],
584           'action': [
585             '<(PYTHON)',
586             'scripts/action_makenames.py',
587             '<@(_outputs)',
588             '--',
589             '<@(_inputs)',
590           ],
591         },
592         {
593           'action_name': 'GenerateExceptionCodeDescription',
594           'inputs': [
595             '<(WebCore)/dom/make_dom_exceptions.pl',
596             '<(WebCore)/dom/DOMExceptions.in',
597           ],
598           'outputs': [
599             '<(SHARED_INTERMEDIATE_DIR)/WebCore/ExceptionCodeDescription.cpp',
600             '<(SHARED_INTERMEDIATE_DIR)/WebCore/ExceptionCodeDescription.h',
601             '<(SHARED_INTERMEDIATE_DIR)/WebCore/ExceptionHeaders.h',
602             '<(SHARED_INTERMEDIATE_DIR)/WebCore/ExceptionInterfaces.h',
603           ],
604           'action': [
605             '<(PYTHON)',
606             'scripts/action_makenames.py',
607             '<@(_outputs)',
608             '--',
609             '<@(_inputs)',
610           ],
611         },
612         {
613           'action_name': 'GeneateUserAgentStyleSheets',
614           'variables': {
615             'scripts': [
616               '<(WebCore)/css/make-css-file-arrays.pl',
617               '<(WebCore)/bindings/scripts/preprocessor.pm',
618             ],
619             'stylesheets': [
620               '<(WebCore)/css/html.css',
621               '<(WebCore)/css/mathml.css',
622               '<(WebCore)/css/quirks.css',
623               '<(WebCore)/css/view-source.css',
624               '<(WebCore)/css/svg.css',
625               '<(WebCore)/css/mediaControls.css',
626               '<(WebCore)/css/mediaControlsGtk.css',
627               '<(WebCore)/css/fullscreen.css',
628               '<(WebCore)/css/plugIns.css',
629               # Skip fullscreenQuickTime.
630             ],
631           },
632           'inputs': [
633             '<@(scripts)',
634             '<@(stylesheets)'
635           ],
636           'outputs': [
637             '<(SHARED_INTERMEDIATE_DIR)/WebCore/UserAgentStyleSheets.h',
638             '<(SHARED_INTERMEDIATE_DIR)/WebCore/UserAgentStyleSheetsData.cpp',
639           ],
640           'action': [
641             '<(PYTHON)',
642             'scripts/action_useragentstylesheets.py',
643             '<@(_outputs)',
644             '<@(stylesheets)',
645             '--',
646             '<@(scripts)',
647             '--',
648             '--defines', '<(feature_defines)',
649           ],
650         },
651         {
652           'action_name': 'PreprocessGrammar',
653           'inputs': [
654             '<(WebCore)/css/CSSGrammar.y.in',
655             '<(WebCore)/css/CSSGrammar.y.includes',
656           ],
657           'outputs': [
658             '<(SHARED_INTERMEDIATE_DIR)/WebCore/CSSGrammar.y',
659           ],
660           'action': [
661             '<(PERL)',
662             '-I',
663             '<(WebCore)/bindings/scripts',
664             '<(WebCore)/css/makegrammar.pl',
665             '--outputDir',
666             '<(SHARED_INTERMEDIATE_DIR)/WebCore',
667             '--extraDefines',
668             '<(feature_defines)',
669             '--symbolsPrefix',
670             'cssyy',
671             '<@(_inputs)',
672           ],
673         },
674       ],
675       'rules': [
676         # Rules to build derived sources.
677         {
678           'rule_name': 'Bison',
679           'extension': 'y',
680           'outputs': [
681             '<(SHARED_INTERMEDIATE_DIR)/WebCore/<(RULE_INPUT_ROOT).cpp',
682             '<(SHARED_INTERMEDIATE_DIR)/WebCore/<(RULE_INPUT_ROOT).h'
683           ],
684           'action': [
685             '<(PYTHON)',
686             'scripts/rule_bison.py',
687             '<(RULE_INPUT_PATH)',
688             '<(SHARED_INTERMEDIATE_DIR)/WebCore',
689             '<(BISON)',
690           ],
691         },
692         {
693           'rule_name': 'GPerf',
694           'extension': 'gperf',
695           #
696           # gperf outputs are generated by WebCore/make-hash-tools.pl
697           #
698           'outputs': [
699             '<(SHARED_INTERMEDIATE_DIR)/WebCore/<(RULE_INPUT_ROOT).cpp',
700           ],
701           'inputs': [
702             '<(WebCore)/make-hash-tools.pl',
703           ],
704           'action': [
705             '<(PERL)',
706             '<(WebCore)/make-hash-tools.pl',
707             '<(SHARED_INTERMEDIATE_DIR)/WebCore',
708             '<(RULE_INPUT_PATH)',
709           ],
710         },
711         # Rule to build generated JavaScript (JSC) bindings from .idl source.
712         {
713           'rule_name': 'DOMBindings',
714           'extension': 'idl',
715           'inputs': [
716             '<(WebCore)/bindings/scripts/generate-bindings.pl',
717             '<(WebCore)/bindings/scripts/CodeGenerator.pm',
718             '<(WebCore)/bindings/scripts/CodeGeneratorJS.pm',
719             '<(WebCore)/bindings/scripts/IDLParser.pm',
720             '<(WebCore)/bindings/scripts/IDLAttributes.txt',
721             '<(WebCore)/bindings/scripts/preprocessor.pm',
722             '<!@pymod_do_main(supplemental_idl_files <@(bindings_idl_files))',
723           ],
724           'outputs': [
725             '<(SHARED_INTERMEDIATE_DIR)/WebCore/bindings/JS<(RULE_INPUT_ROOT).cpp',
726             '<(SHARED_INTERMEDIATE_DIR)/WebCore/bindings/JS<(RULE_INPUT_ROOT).h',
727           ],
728           'variables': {
729             'generator_include_dirs': [
730               '--include', '<(WebCore)/Modules/filesystem',
731               '--include', '<(WebCore)/Modules/indexeddb',
732               '--include', '<(WebCore)/Modules/mediasource',
733               '--include', '<(WebCore)/Modules/mediastream',
734               '--include', '<(WebCore)/Modules/navigatorcontentutils',
735               '--include', '<(WebCore)/Modules/notifications',
736               '--include', '<(WebCore)/Modules/webaudio',
737               '--include', '<(WebCore)/Modules/webdatabase',
738               '--include', '<(WebCore)/css',
739               '--include', '<(WebCore)/dom',
740               '--include', '<(WebCore)/fileapi',
741               '--include', '<(WebCore)/html',
742               '--include', '<(WebCore)/page',
743               '--include', '<(WebCore)/plugins',
744               '--include', '<(WebCore)/storage',
745               '--include', '<(WebCore)/svg',
746               '--include', '<(WebCore)/testing',
747               '--include', '<(WebCore)/workers',
748               '--include', '<(WebCore)/xml',
749               '--include', '<(SHARED_INTERMEDIATE_DIR)/WebCore',
750             ],
751           },
752           'action': [
753             '<(PERL)',
754             '-w',
755             '-I<(WebCore)/bindings/scripts',
756             '<(WebCore)/bindings/scripts/generate-bindings.pl',
757             '--outputDir',
758             '<(SHARED_INTERMEDIATE_DIR)/WebCore/bindings',
759             '--idlAttributesFile',
760             '<(WebCore)/bindings/scripts/IDLAttributes.txt',
761             '--defines',
762             '<(feature_defines) LANGUAGE_JAVASCRIPT',
763             '--generator',
764             'JS',
765             '<@(generator_include_dirs)',
766             '--supplementalDependencyFile',
767             '<(SHARED_INTERMEDIATE_DIR)/WebCore/supplemental_dependency.tmp',
768             '--additionalIdlFiles',
769             '<(webcoregtk_test_support_idl_files)',
770             '<(RULE_INPUT_PATH)',
771           ],
772           'message': 'Generating binding from <(RULE_INPUT_PATH)',
773         },
774       ],
775     },
776     {
777       'target_name': 'WebCoreBindings',
778       'type': 'static_library',
779       'hard_dependency': 1,
780       'dependencies': [
781         'WebCoreDependencies',
782         'InjectedScriptSource',
783         'InjectedScriptCanvasModuleSource',
784         'InspectorOverlayPage',
785         'InspectorProtocolSources',
786       ],
787       'include_dirs': [ '<@(webcoregtk_include_dirs)', ],
788       'sources': [
789         '<@(webcore_derived_source_files)',
790       ],
791       'conditions': [
792         # TODO(maruel): Move it in its own project or generate it anyway?
793         ['enable_svg!=0', {
794           'sources': [
795             '<(SHARED_INTERMEDIATE_DIR)/WebCore/SVGElementFactory.cpp',
796             '<(SHARED_INTERMEDIATE_DIR)/WebCore/JSSVGElementWrapperFactory.cpp',
797             '<@(webcore_svg_derived_source_files)',
798          ],
799         }],
800       ],
801     },
802     {
803       'target_name': 'WebCoreDOM',
804       'type': 'static_library',
805       'dependencies': [ 'WebCoreDependencies', ],
806       'include_dirs': [ '<@(webcoregtk_include_dirs)', ],
807       'sources': [ '<@(webcore_dom_files)', ],
808       'sources/': [
809         ['exclude', '<(excluded_directories_pattern)'],
810         ['exclude', '<(excluded_files_suffixes)'],
811         ['exclude', '<(excluded_files_patterns)'],
812         ['exclude', 'AllInOne\\.cpp$'],
813       ],
814     },
815     {
816       'target_name': 'WebCoreHTML',
817       'type': 'static_library',
818       'dependencies': [ 'WebCoreDependencies', ],
819       'include_dirs': [ '<@(webcoregtk_include_dirs)', ],
820       'sources': [ '<@(webcore_html_files)', ],
821       'sources/': [
822         ['exclude', 'AllInOne\\.cpp$'],
823         ['exclude', 'Android\\.cpp$'],
824       ],
825     },
826     {
827       'target_name': 'WebCorePlatform',
828       'type': 'static_library',
829       'dependencies': [ 'WebCoreDependencies', ],
830       'include_dirs': [ '<@(webcoregtk_include_dirs)', ],
831       'sources': [
832         '<@(webcore_platform_files)',
833         '../Platform/gtk/GtkVersioning.h',
834        ],
835       'sources/': [
836         ['exclude', '.*'],
837         ['include', 'platform/'],
838
839         ['exclude', '<(excluded_directories_pattern)'],
840         ['exclude', '<(excluded_files_suffixes)'],
841         ['exclude', '<(excluded_files_patterns)'],
842         ['exclude', 'platform/Theme\\.cpp$'],
843         ['exclude', 'platform/image-encoders/.*ImageEncoder\\.(cpp|h)$'],
844         ['exclude', 'platform/text/LocaleToScriptMappingICU\\.cpp$'],
845         ['exclude', 'platform/text/TextEncodingDetectorNone\\.cpp$'],
846         ['exclude', 'platform/graphics/FontPlatformData\\.cpp$'],
847         ['exclude', 'platform/graphics/harfbuzz/FontHarfBuzz\\.cpp$'],
848         ['exclude', 'platform/graphics/harfbuzz/HarfBuzzFaceCoreText\\.cpp$'],
849         ['exclude', 'platform/graphics/harfbuzz/FontPlatformDataHarfBuzz\\.cpp$'],
850         ['exclude', 'platform/network/NetworkStorageSessionStub\\.cpp$'],
851       ],
852     },
853     {
854       'target_name': 'WebCorePlatformGeometry',
855       'type': 'static_library',
856       'dependencies': [ 'WebCoreDependencies', ],
857       'include_dirs': [ '<@(webcoregtk_include_dirs)', ],
858       'sources': [ '<@(webcore_platform_geometry_files)', ],
859     },
860     {
861       'target_name': 'WebCore',
862       'type': 'none',
863       'dependencies': [
864         'WebCoreDOM',
865         'WebCoreHTML',
866         'WebCoreBindings',
867         'WebCorePlatform',
868         'WebCorePlatformGeometry',
869       ],
870     },
871   ],
872 }