Unreviewed, rolling out r190520, some tests assert / crash.
[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 #
35
36 .PHONY : all
37 all : \
38     ArrayConstructor.lut.h \
39     ArrayIteratorPrototype.lut.h \
40     BooleanPrototype.lut.h \
41     DateConstructor.lut.h \
42     DatePrototype.lut.h \
43     ErrorPrototype.lut.h \
44     InspectorInstrumentationObject.lut.h \
45     IntlCollatorConstructor.lut.h \
46     IntlCollatorPrototype.lut.h \
47     IntlDateTimeFormatConstructor.lut.h \
48     IntlDateTimeFormatPrototype.lut.h \
49     IntlNumberFormatConstructor.lut.h \
50     IntlNumberFormatPrototype.lut.h \
51     JSDataViewPrototype.lut.h \
52     JSONObject.lut.h \
53     JSGlobalObject.lut.h \
54     JSInternalPromiseConstructor.lut.h \
55     JSPromisePrototype.lut.h \
56     JSPromiseConstructor.lut.h \
57     KeywordLookup.h \
58     Lexer.lut.h \
59     ModuleLoaderObject.lut.h \
60     NumberConstructor.lut.h \
61     NumberPrototype.lut.h \
62     ObjectConstructor.lut.h \
63     ReflectObject.lut.h \
64     RegExpConstructor.lut.h \
65     RegExpPrototype.lut.h \
66     RegExpJitTables.h \
67     StringConstructor.lut.h \
68     StringIteratorPrototype.lut.h \
69     SymbolConstructor.lut.h \
70     SymbolPrototype.lut.h \
71     udis86_itab.h \
72     Bytecodes.h \
73     InitBytecodes.asm \
74     JSCBuiltins \
75 #
76
77 # builtin functions
78 PYTHON = python
79 PERL = perl
80
81 ifeq ($(OS),Windows_NT)
82     DELETE = cmd //C del
83 else
84     DELETE = rm -f
85 endif
86 # --------
87
88 .PHONY: JSCBuiltins
89 JSCBuiltins: $(JavaScriptCore)/generate-js-builtins JSCBuiltins.h JSCBuiltins.cpp
90 JSCBuiltins.h: $(JavaScriptCore)/generate-js-builtins $(JavaScriptCore)/builtins JSCBuiltinsSources
91         $(PYTHON) $(JavaScriptCore)/generate-js-builtins --input-directory $(JavaScriptCore)/builtins --output $@
92
93 JSCBuiltins.cpp: JSCBuiltins.h
94
95 .PHONY: JSCBuiltinsSources
96 JSCBuiltinsSources: \
97     $(JavaScriptCore)/builtins/ArrayConstructor.js \
98     $(JavaScriptCore)/builtins/ArrayIterator.prototype.js \
99     $(JavaScriptCore)/builtins/Array.prototype.js \
100     $(JavaScriptCore)/builtins/Function.prototype.js \
101     $(JavaScriptCore)/builtins/GlobalObject.js \
102     $(JavaScriptCore)/builtins/InspectorInstrumentationObject.js \
103     $(JavaScriptCore)/builtins/InternalPromiseConstructor.js \
104     $(JavaScriptCore)/builtins/Iterator.prototype.js \
105     $(JavaScriptCore)/builtins/ModuleLoaderObject.js \
106     $(JavaScriptCore)/builtins/ObjectConstructor.js \
107     $(JavaScriptCore)/builtins/Operations.Promise.js \
108     $(JavaScriptCore)/builtins/PromiseConstructor.js \
109     $(JavaScriptCore)/builtins/Promise.prototype.js \
110     $(JavaScriptCore)/builtins/ReflectObject.js \
111     $(JavaScriptCore)/builtins/StringConstructor.js \
112     $(JavaScriptCore)/builtins/StringIterator.prototype.js \
113 #
114
115 # lookup tables for classes
116
117 %.lut.h: create_hash_table %.cpp
118         $(PERL) $^ -i > $@
119 Lexer.lut.h: create_hash_table Keywords.table
120         $(PERL) $^ > $@
121
122 # character tables for Yarr
123
124 RegExpJitTables.h: create_regex_tables
125         $(PYTHON) $^ > $@
126
127 KeywordLookup.h: KeywordLookupGenerator.py Keywords.table
128         $(PYTHON) $^ > $@
129
130 # udis86 instruction tables
131
132 udis86_itab.h: $(JavaScriptCore)/disassembler/udis86/itab.py $(JavaScriptCore)/disassembler/udis86/optable.xml
133         $(PYTHON) $(JavaScriptCore)/disassembler/udis86/itab.py $(JavaScriptCore)/disassembler/udis86/optable.xml
134
135 # Bytecode files
136
137 Bytecodes.h: $(JavaScriptCore)/generate-bytecode-files $(JavaScriptCore)/bytecode/BytecodeList.json
138         $(PYTHON) $(JavaScriptCore)/generate-bytecode-files --bytecodes_h Bytecodes.h $(JavaScriptCore)/bytecode/BytecodeList.json
139
140 InitBytecodes.asm: $(JavaScriptCore)/generate-bytecode-files $(JavaScriptCore)/bytecode/BytecodeList.json
141         $(PYTHON) $(JavaScriptCore)/generate-bytecode-files --init_bytecodes_asm InitBytecodes.asm $(JavaScriptCore)/bytecode/BytecodeList.json
142
143 # Inspector interfaces
144
145 INSPECTOR_DOMAINS = \
146     $(JavaScriptCore)/inspector/protocol/ApplicationCache.json \
147     $(JavaScriptCore)/inspector/protocol/CSS.json \
148     $(JavaScriptCore)/inspector/protocol/Console.json \
149     $(JavaScriptCore)/inspector/protocol/DOM.json \
150     $(JavaScriptCore)/inspector/protocol/DOMDebugger.json \
151     $(JavaScriptCore)/inspector/protocol/DOMStorage.json \
152     $(JavaScriptCore)/inspector/protocol/Database.json \
153     $(JavaScriptCore)/inspector/protocol/Debugger.json \
154     $(JavaScriptCore)/inspector/protocol/GenericTypes.json \
155     $(JavaScriptCore)/inspector/protocol/Inspector.json \
156     $(JavaScriptCore)/inspector/protocol/LayerTree.json \
157     $(JavaScriptCore)/inspector/protocol/Network.json \
158     $(JavaScriptCore)/inspector/protocol/OverlayTypes.json \
159     $(JavaScriptCore)/inspector/protocol/Page.json \
160     $(JavaScriptCore)/inspector/protocol/Runtime.json \
161     $(JavaScriptCore)/inspector/protocol/Timeline.json \
162     $(JavaScriptCore)/inspector/protocol/Worker.json \
163 #
164
165 ifeq ($(findstring ENABLE_INDEXED_DATABASE,$(FEATURE_DEFINES)), ENABLE_INDEXED_DATABASE)
166     INSPECTOR_DOMAINS := $(INSPECTOR_DOMAINS) $(JavaScriptCore)/inspector/protocol/IndexedDB.json
167 endif
168
169 ifeq ($(findstring ENABLE_WEB_REPLAY,$(FEATURE_DEFINES)), ENABLE_WEB_REPLAY)
170     INSPECTOR_DOMAINS := $(INSPECTOR_DOMAINS) $(JavaScriptCore)/inspector/protocol/Replay.json
171 endif
172
173 INSPECTOR_GENERATOR_SCRIPTS = \
174         $(JavaScriptCore)/inspector/scripts/codegen/__init__.py \
175         $(JavaScriptCore)/inspector/scripts/codegen/cpp_generator_templates.py \
176         $(JavaScriptCore)/inspector/scripts/codegen/cpp_generator.py \
177         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_backend_dispatcher_header.py \
178         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_backend_dispatcher_implementation.py \
179         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_header.py \
180         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_frontend_dispatcher_implementation.py \
181         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_protocol_types_header.py \
182         $(JavaScriptCore)/inspector/scripts/codegen/generate_cpp_protocol_types_implementation.py \
183         $(JavaScriptCore)/inspector/scripts/codegen/generate_js_backend_commands.py \
184         $(JavaScriptCore)/inspector/scripts/codegen/generator_templates.py \
185         $(JavaScriptCore)/inspector/scripts/codegen/generator.py \
186         $(JavaScriptCore)/inspector/scripts/codegen/models.py \
187         $(JavaScriptCore)/inspector/scripts/generate-combined-inspector-json.py \
188         $(JavaScriptCore)/inspector/scripts/generate-inspector-protocol-bindings.py \
189 #
190
191 all : \
192     CombinedDomains.json \
193     InspectorFrontendDispatchers.h \
194     InjectedScriptSource.h \
195 #
196
197 # The combined JSON file depends on the actual set of domains and their file contents, so that
198 # adding, modifying, or removing domains will trigger regeneration of inspector files.
199
200 .PHONY: force
201 EnabledInspectorDomains : $(JavaScriptCore)/UpdateContents.py force
202         $(PYTHON) $(JavaScriptCore)/UpdateContents.py '$(INSPECTOR_DOMAINS)' $@
203
204 CombinedDomains.json : inspector/scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) EnabledInspectorDomains
205         $(PYTHON) $(JavaScriptCore)/inspector/scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) > ./CombinedDomains.json
206
207 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
208 InspectorFrontendDispatchers.h : CombinedDomains.json $(INSPECTOR_GENERATOR_SCRIPTS)
209         $(PYTHON) $(JavaScriptCore)/inspector/scripts/generate-inspector-protocol-bindings.py --framework JavaScriptCore --outputDir . ./CombinedDomains.json
210
211 InjectedScriptSource.h : inspector/InjectedScriptSource.js $(JavaScriptCore)/inspector/scripts/jsmin.py $(JavaScriptCore)/inspector/scripts/xxd.pl
212         echo "//# sourceURL=__WebInspectorInjectedScript__" > ./InjectedScriptSource.min.js
213         $(PYTHON) $(JavaScriptCore)/inspector/scripts/jsmin.py < $(JavaScriptCore)/inspector/InjectedScriptSource.js >> ./InjectedScriptSource.min.js
214         $(PERL) $(JavaScriptCore)/inspector/scripts/xxd.pl InjectedScriptSource_js ./InjectedScriptSource.min.js InjectedScriptSource.h
215         $(DELETE) InjectedScriptSource.min.js
216
217 # Web Replay inputs generator
218
219 INPUT_GENERATOR_SCRIPTS = \
220     $(JavaScriptCore)/replay/scripts/CodeGeneratorReplayInputs.py \
221     $(JavaScriptCore)/replay/scripts/CodeGeneratorReplayInputsTemplates.py \
222 #
223
224 INPUT_GENERATOR_SPECIFICATIONS = \
225     $(JavaScriptCore)/replay/JSInputs.json \
226 #
227
228 all : JSReplayInputs.h
229
230 JSReplayInputs.h : $(INPUT_GENERATOR_SPECIFICATIONS) $(INPUT_GENERATOR_SCRIPTS)
231         $(PYTHON) $(JavaScriptCore)/replay/scripts/CodeGeneratorReplayInputs.py --outputDir . --framework JavaScriptCore $(INPUT_GENERATOR_SPECIFICATIONS)