AX: Provide a way for VoiceOver to uniquely identify a web session
[WebKit-https.git] / Source / JavaScriptCore / DerivedSources.make
1 # Copyright (C) 2006, 2007, 2008, 2009, 2011, 2013, 2015 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 #
7 # 1.  Redistributions of source code must retain the above copyright
8 #     notice, this list of conditions and the following disclaimer.
9 # 2.  Redistributions in binary form must reproduce the above copyright
10 #     notice, this list of conditions and the following disclaimer in the
11 #     documentation and/or other materials provided with the distribution.
12 # 3.  Neither the name of Apple Inc. ("Apple") nor the names of
13 #     its contributors may be used to endorse or promote products derived
14 #     from this software without specific prior written permission.
15 #
16 # THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "AS IS" AND ANY
17 # EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19 # DISCLAIMED. IN NO EVENT SHALL APPLE OR ITS CONTRIBUTORS BE LIABLE FOR ANY
20 # DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22 # LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23 # ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26
27 VPATH = \
28     $(JavaScriptCore) \
29     $(JavaScriptCore)/parser \
30     $(JavaScriptCore)/runtime \
31     $(JavaScriptCore)/interpreter \
32     $(JavaScriptCore)/jit \
33     $(JavaScriptCore)/builtins \
34     $(JavaScriptCore)/wasm/js \
35 #
36
37 PYTHON = python
38 PERL = perl
39 RUBY = ruby
40
41 JavaScriptCore_SCRIPTS_DIR = $(JavaScriptCore)/Scripts
42
43 ifeq ($(OS),Windows_NT)
44     DELETE = cmd //C del
45 else
46     DELETE = rm -f
47 endif
48
49 # --------
50
51 .PHONY : all
52 all : \
53     udis86_itab.h \
54     Bytecodes.h \
55     BytecodeStructs.h \
56     CombinedDomains.json \
57     InitBytecodes.asm \
58     InjectedScriptSource.h \
59     inspector/InspectorFrontendDispatchers.h \
60     JSCBuiltins.h \
61     Lexer.lut.h \
62     KeywordLookup.h \
63     RegExpJitTables.h \
64     AirOpcode.h \
65     UnicodePatternTables.h \
66     yarr/YarrCanonicalizeUnicode.cpp \
67     WasmOps.h \
68     WasmValidateInlines.h \
69     WasmB3IRGeneratorInlines.h \
70 #
71
72 # JavaScript builtins.
73
74 BUILTINS_GENERATOR_SCRIPTS = \
75     $(JavaScriptCore_SCRIPTS_DIR)/builtins/__init__.py \
76     $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins.py \
77     $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generator.py \
78     $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_model.py \
79     $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_templates.py \
80     $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_combined_header.py \
81     $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_combined_implementation.py \
82     $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_separate_header.py \
83     $(JavaScriptCore_SCRIPTS_DIR)/builtins/builtins_generate_separate_implementation.py \
84     ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_wrapper_header.py \
85     ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_wrapper_implementation.py \
86     ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_internals_wrapper_header.py \
87     ${JavaScriptCore_SCRIPTS_DIR}/builtins/builtins_generate_internals_wrapper_implementation.py \
88     $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins.py \
89     $(JavaScriptCore_SCRIPTS_DIR)/lazywriter.py \
90 #
91
92 JavaScriptCore_BUILTINS_SOURCES = \
93     $(JavaScriptCore)/builtins/AsyncFromSyncIteratorPrototype.js \
94     $(JavaScriptCore)/builtins/ArrayConstructor.js \
95     $(JavaScriptCore)/builtins/ArrayIteratorPrototype.js \
96     $(JavaScriptCore)/builtins/ArrayPrototype.js \
97     $(JavaScriptCore)/builtins/AsyncIteratorPrototype.js \
98     $(JavaScriptCore)/builtins/AsyncFunctionPrototype.js \
99     $(JavaScriptCore)/builtins/AsyncGeneratorPrototype.js \
100     $(JavaScriptCore)/builtins/DatePrototype.js \
101     $(JavaScriptCore)/builtins/FunctionPrototype.js \
102     $(JavaScriptCore)/builtins/GeneratorPrototype.js \
103     $(JavaScriptCore)/builtins/GlobalObject.js \
104     $(JavaScriptCore)/builtins/GlobalOperations.js \
105     $(JavaScriptCore)/builtins/InspectorInstrumentationObject.js \
106     $(JavaScriptCore)/builtins/InternalPromiseConstructor.js \
107     $(JavaScriptCore)/builtins/IteratorHelpers.js \
108     $(JavaScriptCore)/builtins/IteratorPrototype.js \
109     $(JavaScriptCore)/builtins/MapIteratorPrototype.js \
110     $(JavaScriptCore)/builtins/MapPrototype.js \
111     $(JavaScriptCore)/builtins/ModuleLoaderPrototype.js \
112     $(JavaScriptCore)/builtins/NumberConstructor.js \
113     $(JavaScriptCore)/builtins/NumberPrototype.js \
114     $(JavaScriptCore)/builtins/ObjectConstructor.js \
115     $(JavaScriptCore)/builtins/PromiseConstructor.js \
116     $(JavaScriptCore)/builtins/PromiseOperations.js \
117     $(JavaScriptCore)/builtins/PromisePrototype.js \
118     $(JavaScriptCore)/builtins/ReflectObject.js \
119     $(JavaScriptCore)/builtins/RegExpPrototype.js \
120     $(JavaScriptCore)/builtins/SetIteratorPrototype.js \
121     $(JavaScriptCore)/builtins/SetPrototype.js \
122     $(JavaScriptCore)/builtins/StringConstructor.js \
123     $(JavaScriptCore)/builtins/StringIteratorPrototype.js \
124     $(JavaScriptCore)/builtins/StringPrototype.js \
125     $(JavaScriptCore)/builtins/TypedArrayConstructor.js \
126     $(JavaScriptCore)/builtins/TypedArrayPrototype.js \
127 #
128
129 # The combined output file depends on the contents of builtins and generator scripts, so
130 # adding, modifying, or removing builtins or scripts will trigger regeneration of files.
131
132 JavaScriptCore_BUILTINS_DEPENDENCIES_LIST : $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py DerivedSources.make
133         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py '$(JavaScriptCore_BUILTINS_SOURCES) $(BUILTINS_GENERATOR_SCRIPTS)' $@
134
135 JSCBuiltins.h: $(BUILTINS_GENERATOR_SCRIPTS) $(JavaScriptCore_BUILTINS_SOURCES) JavaScriptCore_BUILTINS_DEPENDENCIES_LIST
136         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-js-builtins.py --combined --output-directory . --framework JavaScriptCore $(JavaScriptCore_BUILTINS_SOURCES)
137
138 # Perfect hash lookup tables for JavaScript classes.
139
140 OBJECT_LUT_HEADERS = \
141     ArrayConstructor.lut.h \
142     ArrayIteratorPrototype.lut.h \
143     AsyncGeneratorPrototype.lut.h \
144     BigIntPrototype.lut.h \
145     BigIntConstructor.lut.h \
146     BooleanPrototype.lut.h \
147     DateConstructor.lut.h \
148     DatePrototype.lut.h \
149     ErrorPrototype.lut.h \
150     GeneratorPrototype.lut.h \
151     InspectorInstrumentationObject.lut.h \
152     IntlCollatorConstructor.lut.h \
153     IntlCollatorPrototype.lut.h \
154     IntlDateTimeFormatConstructor.lut.h \
155     IntlDateTimeFormatPrototype.lut.h \
156     IntlNumberFormatConstructor.lut.h \
157     IntlNumberFormatPrototype.lut.h \
158     JSDataViewPrototype.lut.h \
159     JSGlobalObject.lut.h \
160     JSInternalPromiseConstructor.lut.h \
161     JSONObject.lut.h \
162     JSPromisePrototype.lut.h \
163     JSPromiseConstructor.lut.h \
164     MapPrototype.lut.h \
165     ModuleLoaderPrototype.lut.h \
166     NumberConstructor.lut.h \
167     NumberPrototype.lut.h \
168     ObjectConstructor.lut.h \
169     ReflectObject.lut.h \
170     RegExpConstructor.lut.h \
171     SetPrototype.lut.h \
172     StringConstructor.lut.h \
173     StringIteratorPrototype.lut.h \
174     StringPrototype.lut.h \
175     SymbolConstructor.lut.h \
176     SymbolPrototype.lut.h \
177     WebAssemblyCompileErrorConstructor.lut.h \
178     WebAssemblyCompileErrorPrototype.lut.h \
179     WebAssemblyInstanceConstructor.lut.h \
180     WebAssemblyInstancePrototype.lut.h \
181     WebAssemblyLinkErrorConstructor.lut.h \
182     WebAssemblyLinkErrorPrototype.lut.h \
183     WebAssemblyMemoryConstructor.lut.h \
184     WebAssemblyMemoryPrototype.lut.h \
185     WebAssemblyModuleConstructor.lut.h \
186     WebAssemblyModulePrototype.lut.h \
187     WebAssemblyPrototype.lut.h \
188     WebAssemblyRuntimeErrorConstructor.lut.h \
189     WebAssemblyRuntimeErrorPrototype.lut.h \
190     WebAssemblyTableConstructor.lut.h \
191     WebAssemblyTablePrototype.lut.h \
192 #
193
194 $(OBJECT_LUT_HEADERS): %.lut.h : %.cpp $(JavaScriptCore)/create_hash_table
195         $(PERL) $(JavaScriptCore)/create_hash_table $< > $@
196
197 Lexer.lut.h: Keywords.table $(JavaScriptCore)/create_hash_table
198         $(PERL) $(JavaScriptCore)/create_hash_table $< > $@
199
200 # character tables for Yarr
201
202 RegExpJitTables.h: yarr/create_regex_tables
203         $(PYTHON) $^ > $@
204
205 KeywordLookup.h: KeywordLookupGenerator.py Keywords.table
206         $(PYTHON) $^ > $@
207
208 # udis86 instruction tables
209
210 udis86_itab.h: $(JavaScriptCore)/disassembler/udis86/ud_itab.py $(JavaScriptCore)/disassembler/udis86/optable.xml
211         $(PYTHON) $(JavaScriptCore)/disassembler/udis86/ud_itab.py $(JavaScriptCore)/disassembler/udis86/optable.xml .
212
213 # Bytecode files
214
215 Bytecodes.h: $(JavaScriptCore)/generate-bytecode-files $(JavaScriptCore)/bytecode/BytecodeList.json
216         $(PYTHON) $(JavaScriptCore)/generate-bytecode-files --bytecodes_h Bytecodes.h $(JavaScriptCore)/bytecode/BytecodeList.json
217
218 BytecodeStructs.h: $(JavaScriptCore)/generate-bytecode-files $(JavaScriptCore)/bytecode/BytecodeList.json
219         $(PYTHON) $(JavaScriptCore)/generate-bytecode-files --bytecode_structs_h BytecodeStructs.h $(JavaScriptCore)/bytecode/BytecodeList.json
220
221 InitBytecodes.asm: $(JavaScriptCore)/generate-bytecode-files $(JavaScriptCore)/bytecode/BytecodeList.json
222         $(PYTHON) $(JavaScriptCore)/generate-bytecode-files --init_bytecodes_asm InitBytecodes.asm $(JavaScriptCore)/bytecode/BytecodeList.json
223
224 # Inspector interfaces
225
226 INSPECTOR_DOMAINS = \
227     $(JavaScriptCore)/inspector/protocol/ApplicationCache.json \
228     $(JavaScriptCore)/inspector/protocol/CSS.json \
229     $(JavaScriptCore)/inspector/protocol/Canvas.json \
230     $(JavaScriptCore)/inspector/protocol/Console.json \
231     $(JavaScriptCore)/inspector/protocol/DOM.json \
232     $(JavaScriptCore)/inspector/protocol/DOMDebugger.json \
233     $(JavaScriptCore)/inspector/protocol/DOMStorage.json \
234     $(JavaScriptCore)/inspector/protocol/Database.json \
235     $(JavaScriptCore)/inspector/protocol/Debugger.json \
236     $(JavaScriptCore)/inspector/protocol/GenericTypes.json \
237     $(JavaScriptCore)/inspector/protocol/Heap.json \
238     $(JavaScriptCore)/inspector/protocol/Inspector.json \
239     $(JavaScriptCore)/inspector/protocol/LayerTree.json \
240     $(JavaScriptCore)/inspector/protocol/Network.json \
241     $(JavaScriptCore)/inspector/protocol/OverlayTypes.json \
242     $(JavaScriptCore)/inspector/protocol/Page.json \
243     $(JavaScriptCore)/inspector/protocol/Recording.json \
244     $(JavaScriptCore)/inspector/protocol/Runtime.json \
245     $(JavaScriptCore)/inspector/protocol/ScriptProfiler.json \
246     $(JavaScriptCore)/inspector/protocol/Timeline.json \
247     $(JavaScriptCore)/inspector/protocol/Worker.json \
248 #
249
250 ifeq ($(findstring ENABLE_INDEXED_DATABASE,$(FEATURE_DEFINES)), ENABLE_INDEXED_DATABASE)
251     INSPECTOR_DOMAINS := $(INSPECTOR_DOMAINS) $(JavaScriptCore)/inspector/protocol/IndexedDB.json
252 endif
253
254 ifeq ($(findstring ENABLE_RESOURCE_USAGE,$(FEATURE_DEFINES)), ENABLE_RESOURCE_USAGE)
255     INSPECTOR_DOMAINS := $(INSPECTOR_DOMAINS) $(JavaScriptCore)/inspector/protocol/Memory.json
256 endif
257
258 ifeq ($(findstring ENABLE_SERVICE_WORKER,$(FEATURE_DEFINES)), ENABLE_SERVICE_WORKER)
259     INSPECTOR_DOMAINS := $(INSPECTOR_DOMAINS) $(JavaScriptCore)/inspector/protocol/ServiceWorker.json
260 endif
261
262 INSPECTOR_GENERATOR_SCRIPTS = \
263         $(JavaScriptCore)/inspector/scripts/codegen/__init__.py \
264         $(JavaScriptCore)/inspector/scripts/codegen/cpp_generator_templates.py \
265         $(JavaScriptCore)/inspector/scripts/codegen/cpp_generator.py \
266         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py \
267         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py \
268         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py \
269         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py \
270         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_protocol_types_header.py \
271         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py \
272         $(JavaScriptCore)/inspector/scripts/codegen/generate_js_backend_commands.py \
273         $(JavaScriptCore)/inspector/scripts/codegen/generator_templates.py \
274         $(JavaScriptCore)/inspector/scripts/codegen/generator.py \
275         $(JavaScriptCore)/inspector/scripts/codegen/models.py \
276         $(JavaScriptCore)/inspector/scripts/generate-inspector-protocol-bindings.py \
277         $(JavaScriptCore_SCRIPTS_DIR)/generate-combined-inspector-json.py \
278 #
279
280 # The combined JSON file depends on the actual set of domains and their file contents, so that
281 # adding, modifying, or removing domains will trigger regeneration of inspector files.
282
283 .PHONY: force
284 EnabledInspectorDomains : $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py force
285         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/UpdateContents.py '$(INSPECTOR_DOMAINS)' $@
286
287 CombinedDomains.json : $(JavaScriptCore_SCRIPTS_DIR)/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) EnabledInspectorDomains
288         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) > ./CombinedDomains.json
289
290 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
291 inspector/InspectorFrontendDispatchers.h : CombinedDomains.json $(INSPECTOR_GENERATOR_SCRIPTS) inspector
292         $(PYTHON) $(JavaScriptCore)/inspector/scripts/generate-inspector-protocol-bindings.py --framework JavaScriptCore --outputDir inspector ./CombinedDomains.json
293
294 InjectedScriptSource.h : inspector/InjectedScriptSource.js $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl
295         echo "//# sourceURL=__InjectedScript_InjectedScriptSource.js" > ./InjectedScriptSource.min.js
296         $(PYTHON) $(JavaScriptCore_SCRIPTS_DIR)/jsmin.py < $(JavaScriptCore)/inspector/InjectedScriptSource.js >> ./InjectedScriptSource.min.js
297         $(PERL) $(JavaScriptCore_SCRIPTS_DIR)/xxd.pl InjectedScriptSource_js ./InjectedScriptSource.min.js InjectedScriptSource.h
298         $(DELETE) InjectedScriptSource.min.js
299
300 AirOpcode.h: $(JavaScriptCore)/b3/air/opcode_generator.rb $(JavaScriptCore)/b3/air/AirOpcode.opcodes
301         $(RUBY) $^
302
303 UnicodePatternTables.h: $(JavaScriptCore)/Scripts/generateYarrUnicodePropertyTables.py $(JavaScriptCore)/ucd/DerivedBinaryProperties.txt $(JavaScriptCore)/ucd/DerivedCoreProperties.txt $(JavaScriptCore)/ucd/DerivedNormalizationProps.txt $(JavaScriptCore)/ucd/PropList.txt $(JavaScriptCore)/ucd/PropertyAliases.txt $(JavaScriptCore)/ucd/PropertyValueAliases.txt $(JavaScriptCore)/ucd/ScriptExtensions.txt $(JavaScriptCore)/ucd/Scripts.txt $(JavaScriptCore)/ucd/UnicodeData.txt $(JavaScriptCore)/ucd/emoji-data.txt
304         $(PYTHON) $(JavaScriptCore)/Scripts/generateYarrUnicodePropertyTables.py $(JavaScriptCore)/ucd ./UnicodePatternTables.h
305
306 yarr/YarrCanonicalizeUnicode.cpp: $(JavaScriptCore)/yarr/generateYarrCanonicalizeUnicode $(JavaScriptCore)/ucd/CaseFolding.txt
307         $(PYTHON) $(JavaScriptCore)/yarr/generateYarrCanonicalizeUnicode $(JavaScriptCore)/ucd/CaseFolding.txt ./yarr/YarrCanonicalizeUnicode.cpp
308
309 WasmOps.h: $(JavaScriptCore)/wasm/generateWasmOpsHeader.py $(JavaScriptCore)/wasm/generateWasm.py $(JavaScriptCore)/wasm/wasm.json
310         $(PYTHON) $(JavaScriptCore)/wasm/generateWasmOpsHeader.py $(JavaScriptCore)/wasm/wasm.json ./WasmOps.h
311
312 WasmValidateInlines.h: $(JavaScriptCore)/wasm/generateWasmValidateInlinesHeader.py $(JavaScriptCore)/wasm/generateWasm.py $(JavaScriptCore)/wasm/wasm.json
313         $(PYTHON) $(JavaScriptCore)/wasm/generateWasmValidateInlinesHeader.py $(JavaScriptCore)/wasm/wasm.json ./WasmValidateInlines.h
314
315 WasmB3IRGeneratorInlines.h: $(JavaScriptCore)/wasm/generateWasmB3IRGeneratorInlinesHeader.py $(JavaScriptCore)/wasm/generateWasm.py $(JavaScriptCore)/wasm/wasm.json
316         $(PYTHON) $(JavaScriptCore)/wasm/generateWasmB3IRGeneratorInlinesHeader.py $(JavaScriptCore)/wasm/wasm.json ./WasmB3IRGeneratorInlines.h
317
318 # Dynamically-defined targets are listed below. Static targets belong up top.
319
320 all : \
321     $(OBJECT_LUT_HEADERS) \
322 #