Fix http://bugs.webkit.org/show_bug.cgi?id=17175 (Bug 17175: Use of C++ compiler...
[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
35 # Script for creating hash tables
36 CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/kjs/create_hash_table
37
38 # Libraries and support components
39 noinst_HEADERS :=
40
41 noinst_PROGRAMS :=
42
43 lib_LIBRARIES :=
44
45 IDL_BINDINGS :=
46
47 # Files that will be distributed
48 EXTRA_DIST :=
49
50 #
51 # Global flags to CPP
52 global_cppflags :=
53
54 global_cppflags += \
55         -I$(srcdir)/JavaScriptCore \
56         -I$(srcdir)/JavaScriptCore/ForwardingHeaders \
57         -I$(srcdir)/JavaScriptCore/wtf \
58         -I$(srcdir)/JavaScriptCore/kjs \
59         -I$(top_builddir)/DerivedSources
60
61 # Default compiler flags
62 global_cflags := \
63         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
64         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
65         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
66         -Wno-unused-parameter
67
68 global_cxxflags := \
69         $(SYMBOL_VISIBILITY_INLINES)
70
71 if !ENABLE_DEBUG
72 global_cflags += \
73         -fno-exceptions \
74         $(SYMBOL_VISIBILITY)
75
76 global_cxxflags += \
77         -fno-rtti
78 endif
79
80 # Shared libraries
81 lib_LTLIBRARIES = \
82         libWebKitGtk.la
83
84 # Convenience libraries
85 noinst_LTLIBRARIES = \
86         libJavaScriptCore.la
87
88 #
89 # JavaScriptCore
90 javascriptcore_h_api :=
91 javascriptcore_cppflags:=
92 javascriptcore_sources :=
93 javascriptcore_built_sources :=
94 javascriptcore_built_nosources :=
95
96 # The variables above are already included below so no need to touch
97 # these variables unless you really have to
98 libJavaScriptCore_ladir = $(prefix)/include/WebKit/JavaScriptCore
99 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
100
101 libJavaScriptCore_la_SOURCES = \
102         $(javascriptcore_built_sources) \
103         $(javascriptcore_sources)
104
105 libJavaScriptCore_la_LDFLAGS = $(ICU_LIBS) -lpthread
106
107 libJavaScriptCore_la_CXXFLAGS = $(global_cxxflags) $(global_cflags) -fstrict-aliasing
108
109 libJavaScriptCore_la_CFLAGS = $(global_cflags) -fstrict-aliasing
110
111 libJavaScriptCore_la_CPPFLAGS = \
112         $(global_cppflags) \
113         $(javascriptcore_cppflags) \
114         $(ICU_CPPFLAGS)
115
116 #
117 # WebCore
118 webcore_cppflags :=
119 webcore_sources :=
120 webcore_headers :=
121 webcore_built_sources :=
122 webcore_built_nosources :=
123
124 # WebKitGtk
125 webkitgtk_h_api :=
126 webkitgtk_headers :=
127 webkitgtk_sources :=
128 webkitgtk_cppflags :=
129 webkitgtk_ldflags :=
130 webkitgtk_built_sources :=
131 webkitgtk_built_nosources :=
132 webkitgtk_cleanfiles :=
133
134 # No need to touch the following variables unless you have to. If you need to change the values
135 # for the following variables, use the "webkitgtk_" variables above
136 libWebKitGtk_ladir := $(prefix)/include/WebKit/webkit
137
138 libWebKitGtk_la_HEADERS = $(webkitgtk_h_api)
139
140 libWebKitGtk_la_SOURCES = \
141         $(webcore_built_sources) \
142         $(webcore_headers) \
143         $(webcore_sources) \
144         $(webkitgtk_built_sources) \
145         $(webkitgtk_headers) \
146         $(webkitgtk_sources)
147
148 libWebKitGtk_la_CXXFLAGS = \
149         -fno-strict-aliasing \
150         $(global_cxxflags) \
151         $(global_cflags) \
152         $(DEPENDENCIES_CFLAGS) \
153         $(LIBCURL_CFLAGS) \
154         $(SQLITE3_CFLAGS) \
155         $(GSTREAMER_CFLAGS) \
156         $(LIBXSLT_CFLAGS) \
157         $(COVERAGE_CFLAGS)
158
159 libWebKitGtk_la_CFLAGS = \
160         -fno-strict-aliasing \
161         $(global_cflags) \
162         $(DEPENDENCIES_CFLAGS) \
163         $(LIBCURL_CFLAGS) \
164         $(SQLITE3_CFLAGS) \
165         $(GSTREAMER_CFLAGS) \
166         $(LIBXSLT_CFLAGS) \
167         $(COVERAGE_CFLAGS)
168
169 libWebKitGtk_la_CPPFLAGS = \
170         $(global_cppflags) \
171         $(webcore_cppflags) \
172         $(webkitgtk_cppflags) \
173         $(ICU_CPPFLAGS)
174
175 libWebKitGtk_la_LIBADD = libJavaScriptCore.la
176
177 libWebKitGtk_la_LDFLAGS = \
178         $(webkitgtk_ldflags) \
179         $(DEPENDENCIES_LIBS) \
180         $(LIBCURL_LIBS) \
181         $(ICU_LIBS) \
182         $(SQLITE3_LIBS) \
183         $(GSTREAMER_LIBS) \
184         $(LIBXSLT_LIBS) \
185         $(COVERAGE_LDFLAGS) \
186         -lpthread \
187         -ljpeg \
188         -version-info @LIBWEBKITGTK_VERSION@
189
190 #
191 # Extra checks and flags
192 global_cppflags += \
193         -DBUILDING_GTK__=1 \
194         -DWTF_CHANGES
195
196 if !ENABLE_FAST_MALLOC
197 global_cppflags += \
198         -DUSE_SYSTEM_MALLOC
199 endif
200
201 if TARGET_X11
202 global_cppflags += -DXP_UNIX
203 endif
204
205 if !ENABLE_DEBUG
206 global_cppflags += -DNDEBUG
207 else
208 webkitgtk_cppflags += \
209         -DG_DISABLE_DEPRECATED \
210         -DGDK_PIXBUF_DISABLE_DEPRECATED \
211         -DGDK_DISABLE_DEPRECATED \
212         -DGTK_DISABLE_DEPRECATED \
213         -DPANGO_DISABLE_DEPRECATED
214
215 # Might be useful in the future
216 #       -DGDK_MULTIHEAD_SAFE \
217 #       -DGTK_MULTIHEAD_SAFE
218 endif
219
220 if !ENABLE_DATABASE
221 global_cppflags += -DENABLE_DATABASE=0
222 endif
223
224 if !ENABLE_ICONDATABASE
225 global_cppflags += -DENABLE_ICONDATABASE=0
226 endif
227
228 if ENABLE_COVERAGE
229 global_cppflags += \
230         -DGCC_GENERATE_TEST_COVERAGE_FILES \
231         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
232 endif
233
234 if ENABLE_VIDEO
235 webkitgtk_ldflags += -lgstinterfaces-0.10 -lgstvideo-0.10
236 endif
237
238 #
239 # WEBKIT GTK+
240 webkitgtk_cppflags += \
241 -I$(top_builddir)/WebKit/gtk/webkit \
242 -DBUILDING_CAIRO__=1 \
243 -DBUILD_WEBKIT
244
245 webkitgtk_h_api += \
246         WebKit/gtk/webkit/webkit.h \
247         WebKit/gtk/webkit/webkitdefines.h \
248         WebKit/gtk/webkit/webkitnetworkrequest.h \
249         WebKit/gtk/webkit/webkitwebbackforwardlist.h \
250         WebKit/gtk/webkit/webkitwebframe.h \
251         WebKit/gtk/webkit/webkitwebhistoryitem.h \
252         WebKit/gtk/webkit/webkitwebsettings.h \
253         WebKit/gtk/webkit/webkitwebview.h
254
255 webkitgtk_built_sources += \
256         WebKit/gtk/webkit/webkit-marshal.h \
257         WebKit/gtk/webkit/webkit-marshal.cpp
258
259 webkitgtk_headers += \
260         WebKit/gtk/webkit/webkitprivate.h \
261         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
262         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
263         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
264         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
265         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
266         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
267         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
268
269 webkitgtk_sources += \
270         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
271         WebKit/gtk/webkit/webkitprivate.cpp \
272         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
273         WebKit/gtk/webkit/webkitwebframe.cpp \
274         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
275         WebKit/gtk/webkit/webkitwebsettings.cpp \
276         WebKit/gtk/webkit/webkitwebview.cpp \
277         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
278         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
279         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
280         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
281         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
282         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
283         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
284
285 webkitgtk_cleanfiles += \
286         $(top_builddir)/Programs/GtkLauncher \
287         $(top_builddir)/WebKit/gtk/webkit-1.0.pc
288
289 pkgconfigdir = $(libdir)/pkgconfig
290 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
291
292 WEBKIT_MARSHAL = $(CURDIR)/WebKit/gtk/webkit/webkit-marshal
293 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
294
295 stamp_files := \
296         stamp-webkit-marshal.cpp \
297         stamp-webkit-marshal.h
298
299 WebKit/gtk/webkit/webkit-marshal.cpp: stamp-webkit-marshal.cpp
300         @true
301
302 WebKit/gtk/webkit/webkit-marshal.h: stamp-webkit-marshal.h
303         @true
304
305 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
306         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
307         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
308         echo timestamp > $(@F)
309
310 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
311         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
312         echo timestamp > $(@F)
313
314 # END WEBKIT GTK+
315
316 # Files that will be cleaned
317 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
318 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
319 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
320
321 # Include module makefiles
322 include JavaScriptCore/GNUmakefile.am
323 include WebCore/GNUmakefile.am
324 include WebKitTools/GNUmakefile.am
325
326
327 # Autogenerated sources
328 BUILT_SOURCES = \
329         $(javascriptcore_built_sources) \
330         $(javascriptcore_built_nosources) \
331         $(webcore_built_sources) \
332         $(webcore_built_nosources) \
333         $(webkitgtk_built_sources) \
334         $(webkitgtk_built_nosources)
335
336 # Project-wide clean rules
337 CLEANFILES += \
338         $(webkitgtk_cleanfiles) \
339         $(top_builddir)/Programs/DumpRenderTree \
340         $(top_builddir)/Programs/testkjs \
341         $(GENSOURCES)
342
343 MAINTAINERCLEANFILES += \
344         $(srcdir)/aconfig.h.in \
345         configure \
346         config.* \
347         GNUmakefile.in \
348         INSTALL \
349         README