ad73b78d5584810d6357d0185f45d021aadf1523
[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/Lexer.lut.h: $(srcdir)/Source/JavaScriptCore/create_hash_table $(srcdir)/Source/JavaScriptCore/parser/Keywords.table
99         $(AM_V_GEN)$(PERL) $^ > $@
100
101 DerivedSources/JavaScriptCore/%.lut.h: $(srcdir)/Source/JavaScriptCore/create_hash_table $(srcdir)/Source/JavaScriptCore/runtime/%.cpp
102         $(AM_V_GEN)$(PERL) $^ -i > $@
103
104 DerivedSources/JavaScriptCore/RegExpJitTables.h: $(srcdir)/Source/JavaScriptCore/create_regex_tables
105         $(AM_V_GEN)$(PYTHON) $^ > $@
106
107 DerivedSources/JavaScriptCore/KeywordLookup.h: $(srcdir)/Source/JavaScriptCore/KeywordLookupGenerator.py $(srcdir)/Source/JavaScriptCore/parser/Keywords.table
108         $(AM_V_GEN)$(PYTHON) $^ > $@
109
110 DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h: $(javascriptcore_sources) $(llint_nosources) $(offlineasm_nosources)
111         $(AM_V_GEN)$(RUBY) $(srcdir)/Source/JavaScriptCore/offlineasm/generate_offset_extractor.rb $(srcdir)/Source/JavaScriptCore/llint/LowLevelInterpreter.asm $@
112         $(AM_V_at)touch $@
113
114 $(Programs_LLIntOffsetsExtractor_OBJECTS): DerivedSources/JavaScriptCore/LLIntDesiredOffsets.h 
115
116 DerivedSources/JavaScriptCore/LLIntAssembly.h: Programs/LLIntOffsetsExtractor$(EXEEXT)
117         $(AM_V_GEN)$(RUBY) $(srcdir)/Source/JavaScriptCore/offlineasm/asm.rb $(srcdir)/Source/JavaScriptCore/llint/LowLevelInterpreter.asm Programs/LLIntOffsetsExtractor$(EXEEXT) $@
118         $(AM_V_at)touch $@
119
120 DerivedSources/JavaScriptCore/JSCBuiltins.h: DerivedSources/JavaScriptCore/JSCBuiltins.cpp
121 DerivedSources/JavaScriptCore/JSCBuiltins.cpp: $(srcdir)/Source/JavaScriptCore/generate-js-builtins $(javascriptcore_builtins_js_nosources)
122         $(AM_V_GEN)$(PYTHON) $^ $@
123
124 $(libjavascriptcoregtk_@WEBKITGTK_API_MAJOR_VERSION@_@WEBKITGTK_API_MINOR_VERSION@_la_OBJECTS): DerivedSources/JavaScriptCore/LLIntAssembly.h
125
126 jsc: $(javascriptcore_built_nosources) Programs/jsc$(EXEEXT)
127
128 bin_PROGRAMS += \
129         Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT)
130
131 noinst_PROGRAMS += \
132         Programs/jsc \
133         Programs/minidom \
134         Programs/LLIntOffsetsExtractor
135
136 Programs_minidom_CPPFLAGS = \
137         $(global_cppflags) \
138         $(javascriptcore_cppflags)
139
140 Programs_minidom_CFLAGS = \
141         -ansi \
142         -fno-strict-aliasing \
143         $(global_cflags) \
144         $(GLOBALDEPS_CFLAGS)
145
146 Programs_minidom_LDADD = \
147         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
148         $(WINMM_LIBS) \
149         -lm \
150         -lpthread \
151         -lstdc++
152
153 Programs_minidom_LDFLAGS = \
154         -no-install
155
156 Programs_LLIntOffsetsExtractor_CPPFLAGS = \
157         $(global_cppflags) \
158         $(javascriptcore_cppflags)
159
160 Programs_LLIntOffsetsExtractor_CFLAGS = \
161         -ansi \
162         -fno-strict-aliasing \
163         $(global_cflags) \
164         $(GLOBALDEPS_CFLAGS)
165
166 Programs_LLIntOffsetsExtractor_LDADD = \
167         -lpthread \
168         libWTF.la \
169         $(UNICODE_LIBS) \
170         $(GLIB_LIBS) \
171         $(WINMM_LIBS) \
172         -lm \
173         -lpthread \
174         -lstdc++
175
176 Programs_LLIntOffsetsExtractor_LDFLAGS = \
177         -no-install
178
179 # jsc
180 Programs/jsc$(EXEEXT): Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT)
181         $(AM_V_GEN)cp -f Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@$(EXEEXT) Programs/jsc$(EXEEXT)
182 Programs_jsc_LDADD =
183 Programs_jsc_SOURCES =
184
185 Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_CPPFLAGS = \
186         $(global_cppflags) \
187         $(javascriptcore_cppflags)
188
189 Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_CXXFLAGS = \
190         -fno-strict-aliasing \
191         $(global_cxxflags) \
192         $(global_cflags) \
193         $(GLOBALDEPS_CFLAGS) \
194         $(UNICODE_CFLAGS)
195
196 Programs_jsc_@WEBKITGTK_API_MAJOR_VERSION@_LDADD = \
197         -lpthread \
198         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
199         $(WINMM_LIBS)
200
201 EXTRA_DIST += \
202         Source/JavaScriptCore/AUTHORS \
203         Source/JavaScriptCore/ChangeLog \
204         Source/JavaScriptCore/COPYING.LIB \
205         Source/JavaScriptCore/create_hash_table \
206         Source/JavaScriptCore/create_regex_tables \
207         Source/JavaScriptCore/icu/LICENSE \
208         Source/JavaScriptCore/icu/README \
209         Source/JavaScriptCore/inspector/InjectedScriptSource.js \
210         Source/JavaScriptCore/inspector/protocol/Console.json \
211         Source/JavaScriptCore/inspector/protocol/Debugger.json \
212         Source/JavaScriptCore/inspector/protocol/GenericTypes.json \
213         Source/JavaScriptCore/inspector/protocol/InspectorDomain.json \
214         Source/JavaScriptCore/inspector/protocol/Runtime.json \
215         Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspector.py \
216         Source/JavaScriptCore/inspector/scripts/CodeGeneratorInspectorStrings.py \
217         Source/JavaScriptCore/inspector/scripts/cssmin.py \
218         Source/JavaScriptCore/inspector/scripts/generate-combined-inspector-json.py \
219         Source/JavaScriptCore/inspector/scripts/inline-and-minify-stylesheets-and-scripts.py \
220         Source/JavaScriptCore/inspector/scripts/jsmin.py \
221         Source/JavaScriptCore/inspector/scripts/xxd.pl \
222         Source/JavaScriptCore/KeywordLookupGenerator.py \
223         Source/JavaScriptCore/parser/Keywords.table \
224         Source/JavaScriptCore/THANKS \
225         $(javascriptcore_builtins_js_nosources) \
226         $(llint_nosources) \
227         $(offlineasm_nosources)
228
229 CLEANFILES += \
230         $(javascriptcore_built_nosources) \
231         Programs/jsc \
232         Programs/jsc-@WEBKITGTK_API_MAJOR_VERSION@ \
233         Programs/LLIntOffsetsExtractor \
234         Programs/minidom
235
236 DISTCLEANFILES += \
237         $(top_builddir)/Source/JavaScriptCore/javascriptcoregtk-@WEBKITGTK_API_VERSION@.pc
238
239 if ENABLE_INTROSPECTION
240 # The GIR file is generated via autoconf, as we don't need to run the scanner against non-GObject libraries.
241 JavaScriptCore-@WEBKITGTK_API_VERSION@.typelib: JavaScriptCore-@WEBKITGTK_API_VERSION@.gir $(G_IR_COMPILER)
242         $(AM_V_GEN)$(G_IR_COMPILER) --includedir $(WebKit) --includedir $(top_builddir) $< -o $@
243
244 gir_DATA += JavaScriptCore-@WEBKITGTK_API_VERSION@.gir
245 typelibs_DATA += JavaScriptCore-@WEBKITGTK_API_VERSION@.typelib
246 CLEANFILES += JavaScriptCore-@WEBKITGTK_API_VERSION@.gir JavaScriptCore-@WEBKITGTK_API_VERSION@.typelib
247 endif
248
249
250 # Inspector Interfaces
251
252 JavaScriptCore_INSPECTOR_DOMAINS := \
253     $(JavaScriptCore)/inspector/protocol/Console.json \
254     $(JavaScriptCore)/inspector/protocol/Debugger.json \
255     $(JavaScriptCore)/inspector/protocol/GenericTypes.json \
256     $(JavaScriptCore)/inspector/protocol/InspectorDomain.json \
257     $(JavaScriptCore)/inspector/protocol/Runtime.json
258
259 DerivedSources/JavaScriptCore/InspectorJS.json: $(INSPECTOR_SCRIPTS_DIR)/generate-combined-inspector-json.py $(JavaScriptCore_INSPECTOR_DOMAINS)
260         $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/generate-combined-inspector-json.py $(JavaScriptCore)/inspector/protocol > $(GENSOURCES_JAVASCRIPTCORE)/InspectorJS.json
261
262 # Inspector Backend Dispatchers, Frontend Dispatchers, Type Builders
263 # Copy generated header files to DerivedSources/JavaScriptCore/inspector so that WebCore's ForwardingHeader style of #include <inspector/Foo.h> will work.
264 DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.cpp: DerivedSources/JavaScriptCore/InspectorJS.json $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspector.py $(INSPECTOR_SCRIPTS_DIR)/CodeGeneratorInspectorStrings.py
265         $(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
266         $(AM_V_at)touch $@
267         mkdir -p DerivedSources/JavaScriptCore/inspector
268         cp DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.h DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h DerivedSources/JavaScriptCore/inspector
269 DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.h: DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.cpp
270 DerivedSources/JavaScriptCore/InspectorJSTypeBuilders.cpp: DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h
271 DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.h: DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.cpp
272 DerivedSources/JavaScriptCore/InspectorJSFrontendDispatchers.cpp: DerivedSources/JavaScriptCore/InspectorJSBackendCommands.js
273 DerivedSources/JavaScriptCore/InspectorJSBackendCommands.js: DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h
274 DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.h: DerivedSources/JavaScriptCore/InspectorJSBackendDispatchers.cpp
275
276 DerivedSources/JavaScriptCore/InjectedScriptSource.h: $(JavaScriptCore)/inspector/InjectedScriptSource.js $(INSPECTOR_SCRIPTS_DIR)/xxd.pl $(INSPECTOR_SCRIPTS_DIR)/jsmin.py
277         $(AM_V_GEN)$(PYTHON) $(INSPECTOR_SCRIPTS_DIR)/jsmin.py < $< > $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js
278         $(AM_V_at)$(PERL) $(INSPECTOR_SCRIPTS_DIR)/xxd.pl InjectedScriptSource_js $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js $@
279         $(AM_V_at)rm -rf $(GENSOURCES_JAVASCRIPTCORE)/InjectedScriptSource.min.js