9c39968d7992cb9923317a3ea544be678292dbb3
[WebKit-https.git] / Source / JavaScriptCore / GNUmakefile.am
1 include $(srcdir)/Source/JavaScriptCore/GNUmakefile.list.am
2
3 lib_LTLIBRARIES += \
4         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
5
6 jsc_lib_for_dep = libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la
7 $(jsc_lib_for_dep): $(srcdir)/Source/JavaScriptCore/GNUmakefile.list.am
8
9 # We are going to make everything public for now. When
10 # https://bugs.webkit.org/show_bug.cgi?id=27551 is fixed we'll able to
11 # simply rely on the usual symbol visibility flags.
12 libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LDFLAGS = \
13         -version-info @LIBJAVASCRIPTCOREGTK_VERSION@ \
14         $(no_undefined)
15
16 nodist_EXTRA_libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
17         $(javascriptcore_built_nosources)
18
19 nodist_libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
20         $(javascriptcore_built_sources)
21
22 libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_ladir = $(libwebkitgtkincludedir)/JavaScriptCore
23 libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_HEADERS = $(javascriptcore_h_api)
24
25 libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_SOURCES = \
26         $(javascriptcore_sources)
27
28 libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_LIBADD = \
29         -lpthread \
30         libWTF.la \
31         $(GLIB_LIBS) \
32         $(LLVM_LIBS) \
33         $(UNICODE_LIBS) \
34         $(WINMM_LIBS)
35
36 libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CXXFLAGS = \
37         $(global_cxxflags) \
38         $(libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS)
39
40 libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CFLAGS = \
41         $(javascriptcore_cflags)
42
43 libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_CPPFLAGS = \
44         $(global_cppflags) \
45         $(javascriptcore_cppflags)
46
47 javascriptcore_cppflags += \
48         -I$(srcdir)/Source \
49         -I$(srcdir)/Source/JavaScriptCore \
50         -I$(srcdir)/Source/JavaScriptCore/API \
51         -I$(srcdir)/Source/JavaScriptCore/ForwardingHeaders \
52         -I$(srcdir)/Source/JavaScriptCore/assembler \
53         -I$(srcdir)/Source/JavaScriptCore/bindings \
54         -I$(srcdir)/Source/JavaScriptCore/builtins \
55         -I$(srcdir)/Source/JavaScriptCore/bytecode \
56         -I$(srcdir)/Source/JavaScriptCore/bytecompiler \
57         -I$(srcdir)/Source/JavaScriptCore/debugger \
58         -I$(srcdir)/Source/JavaScriptCore/dfg \
59         -I$(srcdir)/Source/JavaScriptCore/disassembler \
60         -I$(srcdir)/Source/JavaScriptCore/ftl \
61         -I$(srcdir)/Source/JavaScriptCore/heap \
62         -I$(srcdir)/Source/JavaScriptCore/inspector \
63         -I$(srcdir)/Source/JavaScriptCore/inspector/agents \
64         -I$(srcdir)/Source/JavaScriptCore/interpreter \
65         -I$(srcdir)/Source/JavaScriptCore/jit \
66         -I$(srcdir)/Source/JavaScriptCore/llint \
67         -I$(srcdir)/Source/JavaScriptCore/parser \
68         -I$(srcdir)/Source/JavaScriptCore/profiler \
69         -I$(srcdir)/Source/JavaScriptCore/runtime \
70         -I$(srcdir)/Source/JavaScriptCore/tools \
71         -I$(srcdir)/Source/JavaScriptCore/yarr \
72         -I$(top_builddir)/DerivedSources/JavaScriptCore \
73         -I$(srcdir)/Source/WTF \
74         $(LLVM_CFLAGS)
75
76 # FIXME: the -fomit-frame-pointer and -ftree-dce optimizations are disabled after they've been causing
77 # trouble with the merged jsCStack code. The former is required due to otherwise incorrectly compiled
78 # operationCallEval function, while the latter is required when using GCC 4.8. See bugs #127777 and
79 # #127909 for more information.
80 javascriptcore_cppflags += \
81         -fno-omit-frame-pointer
82
83 if COMPILER_GCC
84 javascriptcore_cppflags += \
85         -fno-tree-dce
86 endif
87
88 javascriptcore_cflags += \
89         $(global_cflags) \
90         $(GLIB_CFLAGS) \
91         $(LLVM_CFLAGS) \
92         $(UNICODE_CFLAGS)
93
94 pkgconfig_DATA += Source/JavaScriptCore/javascriptcoregtk-@WEBKITGTK_API_VERSION@.pc
95
96 $(shell mkdir -p DerivedSources/JavaScriptCore)
97
98 DerivedSources/JavaScriptCore/Bytecodes.h: $(srcdir)/Source/JavaScriptCore/generate-bytecode-files $(srcdir)/Source/JavaScriptCore/bytecode/BytecodeList.json
99         $(AM_V_GEN)$(PYTHON) $(srcdir)/Source/JavaScriptCore/generate-bytecode-files --bytecodes_h $@ $(srcdir)/Source/JavaScriptCore/bytecode/BytecodeList.json
100
101 DerivedSources/JavaScriptCore/InitBytecodes.asm: $(srcdir)/Source/JavaScriptCore/generate-bytecode-files $(srcdir)/Source/JavaScriptCore/bytecode/BytecodeList.json
102         $(AM_V_GEN)$(PYTHON) $(srcdir)/Source/JavaScriptCore/generate-bytecode-files --init_bytecodes_asm $@ $(srcdir)/Source/JavaScriptCore/bytecode/BytecodeList.json
103
104 DerivedSources/JavaScriptCore/Lexer.lut.h: $(srcdir)/Source/JavaScriptCore/create_hash_table $(srcdir)/Source/JavaScriptCore/parser/Keywords.table
105         $(AM_V_GEN)$(PERL) $^ > $@
106
107 DerivedSources/JavaScriptCore/%.lut.h: $(srcdir)/Source/JavaScriptCore/create_hash_table $(srcdir)/Source/JavaScriptCore/runtime/%.cpp
108         $(AM_V_GEN)$(PERL) $^ -i > $@
109
110 DerivedSources/JavaScriptCore/RegExpJitTables.h: $(srcdir)/Source/JavaScriptCore/create_regex_tables
111         $(AM_V_GEN)$(PYTHON) $^ > $@
112
113 DerivedSources/JavaScriptCore/KeywordLookup.h: $(srcdir)/Source/JavaScriptCore/KeywordLookupGenerator.py $(srcdir)/Source/JavaScriptCore/parser/Keywords.table
114         $(AM_V_GEN)$(PYTHON) $^ > $@
115
116 DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h: $(javascriptcore_sources) $(llint_nosources) $(offlineasm_nosources)
117         $(AM_V_GEN)$(RUBY) $(srcdir)/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb $(srcdir)/Source/JavaScriptCore/llint/LowLevelInterpreter.asm $@
118         $(AM_V_at)touch $@
119
120 $(Programs_LLIntOffsetsExtractor_OBJECTS): DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h DerivedSources/JavaScriptCore/Bytecodes.h
121
122 DerivedSources/JavaScriptCore/LLIntAssembly.h: Programs/LLIntOffsetsExtractor$(EXEEXT) DerivedSources/JavaScriptCore/InitBytecodes.asm
123         $(AM_V_GEN)$(RUBY) $(srcdir)/Source/JavaScriptCore/offlineasm/asm.rb $(srcdir)/Source/JavaScriptCore/llint/LowLevelInterpreter.asm Programs/LLIntOffsetsExtractor$(EXEEXT) $@
124         $(AM_V_at)touch $@
125
126 DerivedSources/JavaScriptCore/JSCBuiltins.h: DerivedSources/JavaScriptCore/JSCBuiltins.cpp
127 DerivedSources/JavaScriptCore/JSCBuiltins.cpp: $(srcdir)/Source/JavaScriptCore/generate-js-builtins $(javascriptcore_builtins_js_nosources)
128         $(AM_V_GEN)$(PYTHON) $^ $@
129
130 $(libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_OBJECTS): DerivedSources/JavaScriptCore/LLIntAssembly.h
131
132 jsc: $(javascriptcore_built_nosources) Programs/jsc$(EXEEXT)
133
134 bin_PROGRAMS += \
135         Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT)
136
137 noinst_PROGRAMS += \
138         Programs/jsc \
139         Programs/minidom \
140         Programs/LLIntOffsetsExtractor
141
142 Programs_minidom_CPPFLAGS = \
143         $(global_cppflags) \
144         $(javascriptcore_cppflags)
145
146 Programs_minidom_CFLAGS = \
147         -ansi \
148         -fno-strict-aliasing \
149         $(global_cflags) \
150         $(GLOBALDEPS_CFLAGS)
151
152 Programs_minidom_LDADD = \
153         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
154         $(WINMM_LIBS) \
155         -lm \
156         -lpthread \
157         -lstdc++
158
159 Programs_minidom_LDFLAGS = \
160         -no-install
161
162 Programs_LLIntOffsetsExtractor_CPPFLAGS = \
163         $(global_cppflags) \
164         $(javascriptcore_cppflags)
165
166 Programs_LLIntOffsetsExtractor_CFLAGS = \
167         -ansi \
168         -fno-strict-aliasing \
169         $(global_cflags) \
170         $(GLOBALDEPS_CFLAGS)
171
172 Programs_LLIntOffsetsExtractor_LDADD = \
173         -lpthread \
174         libWTF.la \
175         $(UNICODE_LIBS) \
176         $(GLIB_LIBS) \
177         $(WINMM_LIBS) \
178         -lm \
179         -lpthread \
180         -lstdc++
181
182 Programs_LLIntOffsetsExtractor_LDFLAGS = \
183         -no-install
184
185 # jsc
186 Programs/jsc$(EXEEXT): Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT)
187         $(AM_V_GEN)cp -f Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT) Programs/jsc$(EXEEXT)
188 Programs_jsc_LDADD =
189 Programs_jsc_SOURCES =
190
191 Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_CPPFLAGS = \
192         $(global_cppflags) \
193         $(javascriptcore_cppflags)
194
195 Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_CXXFLAGS = \
196         -fno-strict-aliasing \
197         $(global_cxxflags) \
198         $(global_cflags) \
199         $(GLOBALDEPS_CFLAGS) \
200         $(UNICODE_CFLAGS)
201
202 Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_LDADD = \
203         -lpthread \
204         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
205         $(WINMM_LIBS)
206
207 EXTRA_DIST += \
208         Source/JavaScriptCore/AUTHORS \
209         Source/JavaScriptCore/ChangeLog \
210         Source/JavaScriptCore/COPYING.LIB \
211         Source/JavaScriptCore/create_hash_table \
212         Source/JavaScriptCore/create_regex_tables \
213         Source/JavaScriptCore/icu/LICENSE \
214         Source/JavaScriptCore/icu/README \
215         Source/JavaScriptCore/inspector/InjectedScriptSource.js \
216         Source/JavaScriptCore/inspector/protocol/Console.json \
217         Source/JavaScriptCore/inspector/protocol/Debugger.json \
218         Source/JavaScriptCore/inspector/protocol/GenericTypes.json \
219         Source/JavaScriptCore/inspector/protocol/InspectorDomain.json \
220         Source/JavaScriptCore/inspector/protocol/Runtime.json \
221         Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py \
222         Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py \
223         Source/JavaScriptCore/inspector/scripts/cssmin.py \
224         Source/JavaScriptCore/inspector/scripts/generate-combined-inspector-json.py \
225         Source/JavaScriptCore/inspector/scripts/inline-and-minify-stylesheets-and-scripts.py \
226         Source/JavaScriptCore/inspector/scripts/jsmin.py \
227         Source/JavaScriptCore/inspector/scripts/xxd.pl \
228         Source/JavaScriptCore/KeywordLookupGenerator.py \
229         Source/JavaScriptCore/parser/Keywords.table \
230         Source/JavaScriptCore/THANKS \
231         $(javascriptcore_builtins_js_nosources) \
232         $(llint_nosources) \
233         $(offlineasm_nosources)
234
235 CLEANFILES += \
236         $(javascriptcore_built_nosources) \
237         Programs/jsc \
238         Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@ \
239         Programs/LLIntOffsetsExtractor \
240         Programs/minidom
241
242 DISTCLEANFILES += \
243         $(top_builddir)/Source/JavaScriptCore/javascriptcoregtk-@WEBKITGTK_API_VERSION@.pc
244
245 if ENABLE_INTROSPECTION
246 # The GIR file is generated via autoconf, as we don't need to run the scanner against non-GObject libraries.
247 JavaScriptCore-@WEBKITGTK_API_VERSION@.typelib: JavaScriptCore-@WEBKITGTK_API_VERSION@.gir $(G_IR_COMPILER)
248         $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(WebKit) --includedir $(top_builddir) $< -o $@
249
250 gir_DATA += JavaScriptCore-@WEBKITGTK_API_VERSION@.gir
251 typelibs_DATA += JavaScriptCore-@WEBKITGTK_API_VERSION@.typelib
252 CLEANFILES += JavaScriptCore-@WEBKITGTK_API_VERSION@.gir JavaScriptCore-@WEBKITGTK_API_VERSION@.typelib
253 endif
254
255
256 # Inspector Interfaces
257
258 JavaScriptCore_INSPECTOR_DOMAINS := \
259     $(JavaScriptCore)/inspector/protocol/Console.json \
260     $(JavaScriptCore)/inspector/protocol/Debugger.json \
261     $(JavaScriptCore)/inspector/protocol/GenericTypes.json \
262     $(JavaScriptCore)/inspector/protocol/InspectorDomain.json \
263     $(JavaScriptCore)/inspector/protocol/Runtime.json
264
265 DerivedSources/JavaScriptCore/InspectorJS.json: $(INSPECTOR_SCRIPTS_DIR)/generate-combined-inspector-json.py $(JavaScriptCore_INSPECTOR_DOMAINS)
266         $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/generate-combined-inspector-json.py $(JavaScriptCore)/inspector/protocol > $(GENSOURCES_JAVASCRIPTCORE)/InspectorJS.json
267
268 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
269 # Copy generated header files to DerivedSources/JavaScriptCore/inspector so that WebCore's ForwardingHeader style of #include <inspector/Foo.h> will work.
270 DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.cpp: DerivedSources/JavaScriptCore/InspectorJS.json $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspector.py $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspectorStrings.py
271         $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspector.py $< --output_h_dir $(GENSOURCES_JAVASCRIPTCORE) --output_cpp_dir $(GENSOURCES_JAVASCRIPTCORE) --output_js_dir $(GENSOURCES_JAVASCRIPTCORE) --output_type JavaScript
272         $(AM_V_at)touch $@
273         mkdir -p DerivedSources/JavaScriptCore/inspector
274         cp DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.h DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h DerivedSources/JavaScriptCore/inspector
275 DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.h: DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.cpp
276 DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.cpp: DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h
277 DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h: DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.cpp
278 DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.cpp: DerivedSources/JavaScriptCore/InspectorJSBackendCommands.js
279 DerivedSources/JavaScriptCore/InspectorJSBackendCommands.js: DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h
280 DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h: DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.cpp
281
282 DerivedSources/JavaScriptCore/InjectedScriptSource.h: $(JavaScriptCore)/inspector/InjectedScriptSource.js $(INSPECTOR_SCRIPTS_DIR)/xxd.pl $(INSPECTOR_SCRIPTS_DIR)/jsmin.py
283         $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/jsmin.py < $< > $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js
284         $(AM_V_at)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl InjectedScriptSource_js $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js $@
285         $(AM_V_at)rm -rf $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js