Fixes a crash in JavaScriptDebugServer::returnEvent when debugging
[WebKit-https.git] / GNUmakefile.am
1 # Top-level Makefile rule for automake
2 #
3 # Variable conventions:
4 #
5 # _h_api            = API headers that will be installed and included in the distribution
6 # _cppflags         = flags that will be passed to the C/CXX Preprocessor
7 # _sources          = sources that will be compiled and included in the distribution
8 # _headers          = header files that will be part of the distribution
9 # _built_sources    = files that will be autogenerated by the build system and
10 #                     will be part of the _SOURCES primary
11 # _built_nosources  = files that are autogenerated but are not part of the
12 #                     _SOURCES primary
13 # _cleanfiles       = files that will be removed by the clean target
14 #
15 # Sources, headers, flags, etc... should be added to the respective variables
16 # with the above suffix, e.g, webcore-specific sources should go to
17 # webcore_sources, gtk port-specific flags should go to webkitgtk_cppflags,
18 # etc... The only exceptions are the global variables. See Global Variables below.
19 #
20 # Global Variables
21 #
22 # global_cppflags   = CPPFLAGS that apply to JSC, WebCore, and to any
23 #                     specific port
24 # global_cflags     = CFLAGS that apply to JSC, WebCore, and to
25 #                     any specific port
26 # global_cxxflags   = CXXFLAGS that apply to JSC, WebCore, and to any
27 #                     specific port
28
29 srcdir = @srcdir@
30 VPATH = @srcdir@
31
32 # Directory for autogenerated sources
33 GENSOURCES := $(top_builddir)/DerivedSources
34 GENPROGRAMS := $(top_builddir)/Programs
35
36 # Script for creating hash tables
37 CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/kjs/create_hash_table
38
39 # Libraries and support components
40 noinst_PROGRAMS :=
41
42 lib_LIBRARIES :=
43
44 IDL_BINDINGS :=
45
46 # Files that will be distributed
47 EXTRA_DIST :=
48
49 # Global flags to CPP
50 global_cppflags :=
51
52 global_cppflags += \
53         -DWTF_USE_ICU_UNICODE=1
54
55 # Default compiler flags
56 global_cflags := \
57         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
58         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
59         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
60         -Wno-unused-parameter -Wno-parentheses
61
62 global_cxxflags := \
63         $(SYMBOL_VISIBILITY_INLINES)
64
65 if !ENABLE_DEBUG
66 global_cflags += \
67         -fno-exceptions \
68         $(SYMBOL_VISIBILITY)
69
70 global_cxxflags += \
71         -fno-rtti
72 endif
73
74 # Shared libraries
75 lib_LTLIBRARIES = \
76         libwebkit-1.0.la
77
78 # Convenience libraries
79 noinst_LTLIBRARIES = \
80         libJavaScriptCore.la \
81         libWebCore.la
82
83 #
84 # JavaScriptCore
85 javascriptcore_h_api :=
86 javascriptcore_cppflags:=
87 javascriptcore_sources :=
88 javascriptcore_built_sources :=
89 javascriptcore_built_nosources :=
90
91 javascriptcore_cppflags += \
92         -I$(srcdir)/JavaScriptCore \
93         -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
94         -I$(srcdir)/JavaScriptCore/wtf \
95         -I$(srcdir)/JavaScriptCore/kjs \
96         -I$(top_builddir)/DerivedSources
97
98 # The variables above are already included below so no need to touch
99 # these variables unless you really have to
100 nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
101         $(javascriptcore_built_nosources)
102
103 nodist_libJavaScriptCore_la_SOURCES = \
104         $(javascriptcore_built_sources)
105
106 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
107 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
108
109 libJavaScriptCore_la_SOURCES = \
110         $(javascriptcore_sources)
111
112 libJavaScriptCore_la_LIBADD = \
113         $(UNICODE_LIBS) \
114         $(GLOBALDEPS_LIBS) \
115         -lpthread
116
117 libJavaScriptCore_la_CXXFLAGS = \
118         $(global_cxxflags) \
119         $(global_cflags) \
120         $(GLOBALDEPS_CFLAGS) \
121         $(UNICODE_CFLAGS) \
122         -fno-strict-aliasing
123
124 libJavaScriptCore_la_CFLAGS = \
125         $(global_cflags) \
126         $(GLOBALDEPS_CFLAGS) \
127         $(UNICODE_CFLAGS) \
128         -fno-strict-aliasing
129
130 libJavaScriptCore_la_CPPFLAGS = \
131         $(global_cppflags) \
132         $(javascriptcore_cppflags)
133
134 #
135 # WebCore
136 webcore_cppflags :=
137 webcore_sources :=
138 webcore_headers :=
139 webcore_libadd :=
140 webcore_built_sources :=
141 webcore_built_nosources :=
142
143 nodist_libWebCore_la_SOURCES = \
144         $(webcore_built_sources)
145
146 libWebCore_la_SOURCES = \
147         $(webcore_headers) \
148         $(webcore_sources)
149
150 libWebCore_la_CXXFLAGS = \
151         -fno-strict-aliasing \
152         $(global_cxxflags) \
153         $(global_cflags) \
154         $(GLOBALDEPS_CFLAGS) \
155         $(UNICODE_CFLAGS) \
156         $(WEBKITDEPS_CFLAGS) \
157         $(LIBCURL_CFLAGS) \
158         $(LIBSOUP_CFLAGS) \
159         $(SQLITE3_CFLAGS) \
160         $(GSTREAMER_CFLAGS) \
161         $(LIBXSLT_CFLAGS) \
162         $(COVERAGE_CFLAGS) \
163         $(HILDON_CFLAGS)
164
165 libWebCore_la_CFLAGS = \
166         -fno-strict-aliasing \
167         $(global_cflags) \
168         $(GLOBALDEPS_CFLAGS) \
169         $(UNICODE_CFLAGS) \
170         $(WEBKITDEPS_CFLAGS) \
171         $(LIBCURL_CFLAGS) \
172         $(LIBSOUP_CFLAGS) \
173         $(SQLITE3_CFLAGS) \
174         $(GSTREAMER_CFLAGS) \
175         $(LIBXSLT_CFLAGS) \
176         $(COVERAGE_CFLAGS) \
177         $(HILDON_CFLAGS)
178
179 libWebCore_la_CPPFLAGS = \
180         $(global_cppflags) \
181         $(webcore_cppflags) \
182         $(javascriptcore_cppflags) \
183         $(webkitgtk_cppflags) \
184         $(HILDON_CPPFLAGS)
185
186 libWebCore_la_LIBADD = \
187         libJavaScriptCore.la \
188         $(webcore_libadd) \
189         $(GLOBALDEPS_LIBS) \
190         $(WEBKITDEPS_LIBS) \
191         $(LIBCURL_LIBS) \
192         $(LIBSOUP_LIBS) \
193         $(UNICODE_LIBS) \
194         $(SQLITE3_LIBS) \
195         $(GSTREAMER_LIBS) \
196         $(LIBXSLT_LIBS) \
197         $(HILDON_LIBS) \
198         -lpthread \
199         -ljpeg
200
201 # WebKit
202 webkitgtk_h_api :=
203 webkitgtk_headers :=
204 webkitgtk_sources :=
205 webkitgtk_cppflags :=
206 webkitgtk_built_sources :=
207 webkitgtk_built_nosources :=
208 webkitgtk_cleanfiles :=
209
210 nodist_libwebkit_1_0_la_SOURCES = \
211         $(webkitgtk_built_sources)
212
213 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
214 libwebkit_1_0_la_HEADERS = $(webkitgtk_h_api)
215
216 libwebkit_1_0_la_SOURCES = \
217         $(webkitgtk_headers) \
218         $(webkitgtk_sources)
219
220 libwebkit_1_0_la_CXXFLAGS = \
221         $(libWebCore_la_CXXFLAGS)
222
223 libwebkit_1_0_la_CFLAGS = \
224         $(libWebCore_la_CFLAGS)
225
226 libwebkit_1_0_la_CPPFLAGS = \
227         $(libWebCore_la_CPPFLAGS)
228
229 libwebkit_1_0_la_LDFLAGS = \
230         $(COVERAGE_LDFLAGS) \
231         -version-info @LIBWEBKITGTK_VERSION@
232
233 libwebkit_1_0_la_LIBADD = \
234         libWebCore.la
235
236 #
237 # Extra checks and flags
238 global_cppflags += \
239         -DBUILDING_GTK__=1 \
240         -DWTF_CHANGES
241
242 if !ENABLE_FAST_MALLOC
243 global_cppflags += \
244         -DUSE_SYSTEM_MALLOC
245 endif
246
247 if TARGET_X11
248 global_cppflags += -DXP_UNIX
249 webcore_libadd += -lXt
250 endif
251
252 if !ENABLE_DEBUG
253 global_cppflags += -DNDEBUG
254 else
255 webkitgtk_cppflags += \
256         -DG_DISABLE_DEPRECATED \
257         -DGDK_PIXBUF_DISABLE_DEPRECATED \
258         -DGDK_DISABLE_DEPRECATED \
259         -DGTK_DISABLE_DEPRECATED \
260         -DPANGO_DISABLE_DEPRECATED
261
262 # Might be useful in the future
263 #       -DGDK_MULTIHEAD_SAFE \
264 #       -DGTK_MULTIHEAD_SAFE
265 endif
266
267 if !ENABLE_DATABASE
268 global_cppflags += -DENABLE_DATABASE=0
269 endif
270
271 if !ENABLE_ICONDATABASE
272 global_cppflags += -DENABLE_ICONDATABASE=0
273 endif
274
275 if ENABLE_COVERAGE
276 global_cppflags += \
277         -DGCC_GENERATE_TEST_COVERAGE_FILES \
278         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
279 endif
280
281 if ENABLE_VIDEO
282 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
283 endif
284
285 webkitgtk_cppflags += \
286 -I$(top_builddir)/WebKit/gtk/webkit \
287 -DBUILDING_CAIRO__=1 \
288 -DBUILD_WEBKIT
289
290 webkitgtk_h_api += \
291         WebKit/gtk/webkit/webkit.h \
292         WebKit/gtk/webkit/webkitdefines.h \
293         WebKit/gtk/webkit/webkitnetworkrequest.h \
294         WebKit/gtk/webkit/webkitwebbackforwardlist.h \
295         WebKit/gtk/webkit/webkitwebframe.h \
296         WebKit/gtk/webkit/webkitwebhistoryitem.h \
297         WebKit/gtk/webkit/webkitwebsettings.h \
298         WebKit/gtk/webkit/webkitwebview.h
299
300 webkitgtk_built_sources += \
301         DerivedSources/webkit-marshal.h \
302         DerivedSources/webkit-marshal.cpp
303
304 webkitgtk_headers += \
305         WebKit/gtk/webkit/webkitprivate.h \
306         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
307         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
308         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
309         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
310         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
311         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
312         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
313
314 webkitgtk_sources += \
315         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
316         WebKit/gtk/webkit/webkitprivate.cpp \
317         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
318         WebKit/gtk/webkit/webkitwebframe.cpp \
319         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
320         WebKit/gtk/webkit/webkitwebsettings.cpp \
321         WebKit/gtk/webkit/webkitwebview.cpp \
322         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
323         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
324         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
325         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
326         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
327         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
328         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
329
330 webkitgtk_cleanfiles += \
331         $(top_builddir)/Programs/GtkLauncher \
332         $(top_builddir)/WebKit/gtk/webkit-1.0.pc
333
334 pkgconfigdir = $(libdir)/pkgconfig
335 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
336
337 WEBKIT_MARSHAL = $(GENSOURCES)/webkit-marshal
338 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
339
340 stamp_files := \
341         stamp-webkit-marshal.cpp \
342         stamp-webkit-marshal.h
343
344 DerivedSources/webkit-marshal.cpp: stamp-webkit-marshal.cpp
345         @true
346
347 DerivedSources/webkit-marshal.h: stamp-webkit-marshal.h
348         @true
349
350 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
351         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
352         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
353         echo timestamp > $(@F)
354
355 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
356         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
357         echo timestamp > $(@F)
358
359 # END WEBKIT GTK+
360
361 # Files that will be cleaned
362 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
363 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
364 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
365
366 # Include module makefiles
367 include JavaScriptCore/GNUmakefile.am
368 include WebCore/GNUmakefile.am
369 include WebKitTools/GNUmakefile.am
370
371 # Autogenerated sources
372 BUILT_SOURCES = \
373         $(javascriptcore_built_sources) \
374         $(javascriptcore_built_nosources) \
375         $(webcore_built_sources) \
376         $(webcore_built_nosources) \
377         $(webkitgtk_built_sources) \
378         $(webkitgtk_built_nosources)
379
380 # Project-wide clean rules
381 CLEANFILES += \
382         $(webkitgtk_cleanfiles)
383
384 MAINTAINERCLEANFILES += \
385         $(srcdir)/aconfig.h.in \
386         configure \
387         config.* \
388         GNUmakefile.in \
389         INSTALL \
390         README
391
392 # remove built sources and program directories
393 clean-local:
394         -rm -rf $(GENSOURCES) $(GENPROGRAMS)