2008-03-09 Alp Toker <alp@atoker.com>
[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 global_cppflags += \
62         -DWTF_USE_ICU_UNICODE=1
63
64 # Default compiler flags
65 global_cflags := \
66         -Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
67         -Wformat -Wformat-security -Wno-format-y2k -Wundef \
68         -Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
69         -Wno-unused-parameter
70
71 global_cxxflags := \
72         $(SYMBOL_VISIBILITY_INLINES)
73
74 if !ENABLE_DEBUG
75 global_cflags += \
76         -fno-exceptions \
77         $(SYMBOL_VISIBILITY)
78
79 global_cxxflags += \
80         -fno-rtti
81 endif
82
83 # Shared libraries
84 lib_LTLIBRARIES = \
85         libwebkit-1.0.la
86
87 # Convenience libraries
88 noinst_LTLIBRARIES = \
89         libJavaScriptCore.la \
90         libWebCore.la
91
92 #
93 # JavaScriptCore
94 javascriptcore_h_api :=
95 javascriptcore_cppflags:=
96 javascriptcore_sources :=
97 javascriptcore_built_sources :=
98 javascriptcore_built_nosources :=
99
100 # The variables above are already included below so no need to touch
101 # these variables unless you really have to
102 libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
103 libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
104
105 libJavaScriptCore_la_SOURCES = \
106         $(javascriptcore_built_sources) \
107         $(javascriptcore_sources)
108
109 libJavaScriptCore_la_LIBADD = \
110         $(UNICODE_LIBS) \
111         $(GLOBALDEPS_LIBS) \
112         -lpthread
113
114 libJavaScriptCore_la_CXXFLAGS = \
115         $(global_cxxflags) \
116         $(global_cflags) \
117         $(GLOBALDEPS_CFLAGS) \
118         $(UNICODE_CFLAGS) \
119         -fstrict-aliasing
120
121 libJavaScriptCore_la_CFLAGS = \
122         $(global_cflags) \
123         $(GLOBALDEPS_CFLAGS) \
124         $(UNICODE_CFLAGS) \
125         -fstrict-aliasing
126
127 libJavaScriptCore_la_CPPFLAGS = \
128         $(global_cppflags) \
129         $(javascriptcore_cppflags)
130
131 #
132 # WebCore
133 webcore_cppflags :=
134 webcore_sources :=
135 webcore_headers :=
136 webcore_libadd :=
137 webcore_built_sources :=
138 webcore_built_nosources :=
139
140 webcore_cppflags += $(HILDON_CPPFLAGS)
141
142 # WebKit
143 webkitgtk_h_api :=
144 webkitgtk_headers :=
145 webkitgtk_sources :=
146 webkitgtk_cppflags :=
147 webkitgtk_built_sources :=
148 webkitgtk_built_nosources :=
149 webkitgtk_cleanfiles :=
150
151 libWebCore_la_SOURCES = \
152         $(webcore_built_sources) \
153         $(webcore_headers) \
154         $(webcore_sources)
155
156 libWebCore_la_CXXFLAGS = \
157         -fno-strict-aliasing \
158         $(global_cxxflags) \
159         $(global_cflags) \
160         $(GLOBALDEPS_CFLAGS) \
161         $(UNICODE_CFLAGS) \
162         $(WEBKITDEPS_CFLAGS) \
163         $(LIBCURL_CFLAGS) \
164         $(SQLITE3_CFLAGS) \
165         $(GSTREAMER_CFLAGS) \
166         $(LIBXSLT_CFLAGS) \
167         $(COVERAGE_CFLAGS) \
168         $(HILDON_CFLAGS)
169
170 libWebCore_la_CFLAGS = \
171         -fno-strict-aliasing \
172         $(global_cflags) \
173         $(GLOBALDEPS_CFLAGS) \
174         $(UNICODE_CFLAGS) \
175         $(WEBKITDEPS_CFLAGS) \
176         $(LIBCURL_CFLAGS) \
177         $(SQLITE3_CFLAGS) \
178         $(GSTREAMER_CFLAGS) \
179         $(LIBXSLT_CFLAGS) \
180         $(COVERAGE_CFLAGS) \
181         $(HILDON_CFLAGS)
182
183 libWebCore_la_CPPFLAGS = \
184         $(global_cppflags) \
185         $(webcore_cppflags) \
186         $(webkitgtk_cppflags)
187
188 libWebCore_la_LIBADD = \
189         libJavaScriptCore.la \
190         $(webcore_libadd) \
191         $(GLOBALDEPS_LIBS) \
192         $(WEBKITDEPS_LIBS) \
193         $(LIBCURL_LIBS) \
194         $(UNICODE_LIBS) \
195         $(SQLITE3_LIBS) \
196         $(GSTREAMER_LIBS) \
197         $(LIBXSLT_LIBS) \
198         $(HILDON_LIBS) \
199         -lpthread \
200         -ljpeg
201
202 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
203 libwebkit_1_0_la_HEADERS = $(webkitgtk_h_api)
204
205 libwebkit_1_0_la_SOURCES = \
206         $(webkitgtk_built_sources) \
207         $(webkitgtk_headers) \
208         $(webkitgtk_sources)
209
210 libwebkit_1_0_la_CXXFLAGS = \
211         $(libWebCore_la_CXXFLAGS)
212
213 libwebkit_1_0_la_CFLAGS = \
214         $(libWebCore_la_CFLAGS)
215
216 libwebkit_1_0_la_CPPFLAGS = \
217         $(libWebCore_la_CPPFLAGS)
218
219 libwebkit_1_0_la_LDFLAGS = \
220         $(COVERAGE_LDFLAGS) \
221         -version-info @LIBWEBKITGTK_VERSION@
222
223 libwebkit_1_0_la_LIBADD = \
224         libWebCore.la
225
226 #
227 # Extra checks and flags
228 global_cppflags += \
229         -DBUILDING_GTK__=1 \
230         -DWTF_CHANGES
231
232 if !ENABLE_FAST_MALLOC
233 global_cppflags += \
234         -DUSE_SYSTEM_MALLOC
235 endif
236
237 if TARGET_X11
238 global_cppflags += -DXP_UNIX
239 endif
240
241 if !ENABLE_DEBUG
242 global_cppflags += -DNDEBUG
243 else
244 webkitgtk_cppflags += \
245         -DG_DISABLE_DEPRECATED \
246         -DGDK_PIXBUF_DISABLE_DEPRECATED \
247         -DGDK_DISABLE_DEPRECATED \
248         -DGTK_DISABLE_DEPRECATED \
249         -DPANGO_DISABLE_DEPRECATED
250
251 # Might be useful in the future
252 #       -DGDK_MULTIHEAD_SAFE \
253 #       -DGTK_MULTIHEAD_SAFE
254 endif
255
256 if !ENABLE_DATABASE
257 global_cppflags += -DENABLE_DATABASE=0
258 endif
259
260 if !ENABLE_ICONDATABASE
261 global_cppflags += -DENABLE_ICONDATABASE=0
262 endif
263
264 if ENABLE_COVERAGE
265 global_cppflags += \
266         -DGCC_GENERATE_TEST_COVERAGE_FILES \
267         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
268 endif
269
270 if ENABLE_VIDEO
271 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
272 endif
273
274 webkitgtk_cppflags += \
275 -I$(top_builddir)/WebKit/gtk/webkit \
276 -DBUILDING_CAIRO__=1 \
277 -DBUILD_WEBKIT
278
279 webkitgtk_h_api += \
280         WebKit/gtk/webkit/webkit.h \
281         WebKit/gtk/webkit/webkitdefines.h \
282         WebKit/gtk/webkit/webkitnetworkrequest.h \
283         WebKit/gtk/webkit/webkitwebbackforwardlist.h \
284         WebKit/gtk/webkit/webkitwebframe.h \
285         WebKit/gtk/webkit/webkitwebhistoryitem.h \
286         WebKit/gtk/webkit/webkitwebsettings.h \
287         WebKit/gtk/webkit/webkitwebview.h
288
289 webkitgtk_built_sources += \
290         WebKit/gtk/webkit/webkit-marshal.h \
291         WebKit/gtk/webkit/webkit-marshal.cpp
292
293 webkitgtk_headers += \
294         WebKit/gtk/webkit/webkitprivate.h \
295         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
296         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
297         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
298         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
299         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
300         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
301         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
302
303 webkitgtk_sources += \
304         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
305         WebKit/gtk/webkit/webkitprivate.cpp \
306         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
307         WebKit/gtk/webkit/webkitwebframe.cpp \
308         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
309         WebKit/gtk/webkit/webkitwebsettings.cpp \
310         WebKit/gtk/webkit/webkitwebview.cpp \
311         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
312         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
313         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
314         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
315         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
316         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
317         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
318
319 webkitgtk_cleanfiles += \
320         $(top_builddir)/Programs/GtkLauncher \
321         $(top_builddir)/WebKit/gtk/webkit-1.0.pc
322
323 pkgconfigdir = $(libdir)/pkgconfig
324 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
325
326 WEBKIT_MARSHAL = $(CURDIR)/WebKit/gtk/webkit/webkit-marshal
327 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
328
329 stamp_files := \
330         stamp-webkit-marshal.cpp \
331         stamp-webkit-marshal.h
332
333 WebKit/gtk/webkit/webkit-marshal.cpp: stamp-webkit-marshal.cpp
334         @true
335
336 WebKit/gtk/webkit/webkit-marshal.h: stamp-webkit-marshal.h
337         @true
338
339 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
340         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
341         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
342         echo timestamp > $(@F)
343
344 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
345         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
346         echo timestamp > $(@F)
347
348 # END WEBKIT GTK+
349
350 # Files that will be cleaned
351 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
352 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
353 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
354
355 # Include module makefiles
356 include JavaScriptCore/GNUmakefile.am
357 include WebCore/GNUmakefile.am
358 include WebKitTools/GNUmakefile.am
359
360
361 # Autogenerated sources
362 BUILT_SOURCES = \
363         $(javascriptcore_built_sources) \
364         $(javascriptcore_built_nosources) \
365         $(webcore_built_sources) \
366         $(webcore_built_nosources) \
367         $(webkitgtk_built_sources) \
368         $(webkitgtk_built_nosources)
369
370 # Project-wide clean rules
371 CLEANFILES += \
372         $(webkitgtk_cleanfiles) \
373         $(top_builddir)/Programs/DumpRenderTree \
374         $(top_builddir)/Programs/testkjs \
375         $(GENSOURCES)
376
377 MAINTAINERCLEANFILES += \
378         $(srcdir)/aconfig.h.in \
379         configure \
380         config.* \
381         GNUmakefile.in \
382         INSTALL \
383         README