1 # Copyright (C) 2006, 2007, 2008, 2009, 2011, 2013 Apple Inc. All rights reserved.
3 # Redistribution and use in source and binary forms, with or without
4 # modification, are permitted provided that the following conditions
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.
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.
29 $(JavaScriptCore)/parser \
30 $(JavaScriptCore)/runtime \
31 $(JavaScriptCore)/interpreter \
32 $(JavaScriptCore)/jit \
33 $(JavaScriptCore)/builtins \
38 ArrayConstructor.lut.h \
39 ArrayPrototype.lut.h \
40 BooleanPrototype.lut.h \
41 DateConstructor.lut.h \
43 ErrorPrototype.lut.h \
44 JSDataViewPrototype.lut.h \
46 JSGlobalObject.lut.h \
47 JSPromisePrototype.lut.h \
48 JSPromiseConstructor.lut.h \
52 NumberConstructor.lut.h \
53 NumberPrototype.lut.h \
54 ObjectConstructor.lut.h \
55 RegExpConstructor.lut.h \
56 RegExpPrototype.lut.h \
59 StringConstructor.lut.h \
69 # Windows has specific needs for specifying the path to its interpreters
70 ifeq ($(OS),Windows_NT)
71 PYTHON = /usr/bin/python
79 JSCBuiltins: $(JavaScriptCore)/generate-js-builtins JSCBuiltins.h JSCBuiltins.cpp
80 JSCBuiltins.h: $(JavaScriptCore)/generate-js-builtins $(JavaScriptCore)/builtins/*.js
83 JSCBuiltins.cpp: JSCBuiltins.h
85 # lookup tables for classes
87 %.lut.h: create_hash_table %.cpp
89 Lexer.lut.h: create_hash_table Keywords.table
92 # character tables for Yarr
94 RegExpJitTables.h: create_regex_tables
97 KeywordLookup.h: KeywordLookupGenerator.py Keywords.table
100 # udis86 instruction tables
102 udis86_itab.h: $(JavaScriptCore)/disassembler/udis86/itab.py $(JavaScriptCore)/disassembler/udis86/optable.xml
103 (PYTHONPATH=$(JavaScriptCore)/disassembler/udis86 $(PYTHON) $(JavaScriptCore)/disassembler/udis86/itab.py $(JavaScriptCore)/disassembler/udis86/optable.xml || exit 1)
107 Bytecodes.h: $(JavaScriptCore)/generate-bytecode-files $(JavaScriptCore)/bytecode/BytecodeList.json
108 $(PYTHON) $(JavaScriptCore)/generate-bytecode-files --bytecodes_h Bytecodes.h $(JavaScriptCore)/bytecode/BytecodeList.json
110 InitBytecodes.asm: $(JavaScriptCore)/generate-bytecode-files $(JavaScriptCore)/bytecode/BytecodeList.json
111 $(PYTHON) $(JavaScriptCore)/generate-bytecode-files --init_bytecodes_asm InitBytecodes.asm $(JavaScriptCore)/bytecode/BytecodeList.json
113 # Inspector interfaces
115 INSPECTOR_DOMAINS = \
116 $(JavaScriptCore)/inspector/protocol/Console.json \
117 $(JavaScriptCore)/inspector/protocol/Debugger.json \
118 $(JavaScriptCore)/inspector/protocol/GenericTypes.json \
119 $(JavaScriptCore)/inspector/protocol/InspectorDomain.json \
120 $(JavaScriptCore)/inspector/protocol/Profiler.json \
121 $(JavaScriptCore)/inspector/protocol/Runtime.json \
124 INSPECTOR_GENERATOR_SCRIPTS = \
125 $(JavaScriptCore)/inspector/scripts/CodeGeneratorInspector.py \
126 $(JavaScriptCore)/inspector/scripts/CodeGeneratorInspectorStrings.py \
131 InspectorJSFrontendDispatchers.h \
132 InjectedScriptSource.h \
135 # The combined JSON file depends on the actual set of domains and their file contents, so that
136 # adding, modifying, or removing domains will trigger regeneration of inspector files.
139 EnabledInspectorDomains : force
140 echo '$(INSPECTOR_DOMAINS)' | cmp -s - $@ || echo '$(INSPECTOR_DOMAINS)' > $@
142 InspectorJS.json : inspector/scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) EnabledInspectorDomains
143 $(PYTHON) $(JavaScriptCore)/inspector/scripts/generate-combined-inspector-json.py $(INSPECTOR_DOMAINS) > ./InspectorJS.json
145 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
146 InspectorJSFrontendDispatchers.h : InspectorJS.json $(INSPECTOR_GENERATOR_SCRIPTS)
147 $(PYTHON) $(JavaScriptCore)/inspector/scripts/CodeGeneratorInspector.py ./InspectorJS.json --output_h_dir . --output_cpp_dir . --output_js_dir . --output_type JavaScript
149 InjectedScriptSource.h : inspector/InjectedScriptSource.js $(JavaScriptCore)/inspector/scripts/jsmin.py $(JavaScriptCore)/inspector/scripts/xxd.pl
150 echo "//# sourceURL=__WebInspectorInjectedScript__" > ./InjectedScriptSource.min.js
151 $(PYTHON) $(JavaScriptCore)/inspector/scripts/jsmin.py < $(JavaScriptCore)/inspector/InjectedScriptSource.js >> ./InjectedScriptSource.min.js
152 $(PERL) $(JavaScriptCore)/inspector/scripts/xxd.pl InjectedScriptSource_js ./InjectedScriptSource.min.js InjectedScriptSource.h
153 rm -f ./InjectedScriptSource.min.js
155 # Web Replay inputs generator
157 INPUT_GENERATOR_SCRIPTS = \
158 $(JavaScriptCore)/replay/scripts/CodeGeneratorReplayInputs.py \
159 $(JavaScriptCore)/replay/scripts/CodeGeneratorReplayInputsTemplates.py \
162 INPUT_GENERATOR_SPECIFICATIONS = \
163 $(JavaScriptCore)/replay/JSInputs.json \
166 all : JSReplayInputs.h
168 JSReplayInputs.h : $(INPUT_GENERATOR_SPECIFICATIONS) $(INPUT_GENERATOR_SCRIPTS)
169 $(PYTHON) $(JavaScriptCore)/replay/scripts/CodeGeneratorReplayInputs.py --outputDir . --framework JavaScriptCore $(INPUT_GENERATOR_SPECIFICATIONS)