2008-03-09 J?rg Billeter <j@bitron.ch>
[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         -fstrict-aliasing
119
120 libJavaScriptCore_la_CFLAGS = \
121         $(global_cflags) \
122         $(GLOBALDEPS_CFLAGS) \
123         $(UNICODE_CFLAGS) \
124         -fstrict-aliasing
125
126 libJavaScriptCore_la_CPPFLAGS = \
127         $(global_cppflags) \
128         $(javascriptcore_cppflags)
129
130 #
131 # WebCore
132 webcore_cppflags :=
133 webcore_sources :=
134 webcore_headers :=
135 webcore_libadd :=
136 webcore_built_sources :=
137 webcore_built_nosources :=
138
139 webcore_cppflags += $(HILDON_CPPFLAGS)
140
141 # WebKit
142 webkitgtk_h_api :=
143 webkitgtk_headers :=
144 webkitgtk_sources :=
145 webkitgtk_cppflags :=
146 webkitgtk_built_sources :=
147 webkitgtk_built_nosources :=
148 webkitgtk_cleanfiles :=
149
150 libWebCore_la_SOURCES = \
151         $(webcore_built_sources) \
152         $(webcore_headers) \
153         $(webcore_sources)
154
155 libWebCore_la_CXXFLAGS = \
156         -fno-strict-aliasing \
157         $(global_cxxflags) \
158         $(global_cflags) \
159         $(GLOBALDEPS_CFLAGS) \
160         $(WEBKITDEPS_CFLAGS) \
161         $(LIBCURL_CFLAGS) \
162         $(SQLITE3_CFLAGS) \
163         $(GSTREAMER_CFLAGS) \
164         $(LIBXSLT_CFLAGS) \
165         $(COVERAGE_CFLAGS) \
166         $(HILDON_CFLAGS)
167
168 libWebCore_la_CFLAGS = \
169         -fno-strict-aliasing \
170         $(global_cflags) \
171         $(UNICODE_CFLAGS) \
172         $(GLOBALDEPS_CFLAGS) \
173         $(WEBKITDEPS_CFLAGS) \
174         $(LIBCURL_CFLAGS) \
175         $(SQLITE3_CFLAGS) \
176         $(GSTREAMER_CFLAGS) \
177         $(LIBXSLT_CFLAGS) \
178         $(COVERAGE_CFLAGS) \
179         $(HILDON_CFLAGS)
180
181 libWebCore_la_CPPFLAGS = \
182         $(global_cppflags) \
183         $(webcore_cppflags) \
184         $(webkitgtk_cppflags)
185
186 libWebCore_la_LIBADD = \
187         libJavaScriptCore.la \
188         $(webcore_libadd) \
189         $(GLOBALDEPS_LIBS) \
190         $(WEBKITDEPS_LIBS) \
191         $(LIBCURL_LIBS) \
192         $(UNICODE_LIBS) \
193         $(SQLITE3_LIBS) \
194         $(GSTREAMER_LIBS) \
195         $(LIBXSLT_LIBS) \
196         $(HILDON_LIBS) \
197         -lpthread \
198         -ljpeg
199
200 libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
201 libwebkit_1_0_la_HEADERS = $(webkitgtk_h_api)
202
203 libwebkit_1_0_la_SOURCES = \
204         $(webkitgtk_built_sources) \
205         $(webkitgtk_headers) \
206         $(webkitgtk_sources)
207
208 libwebkit_1_0_la_CXXFLAGS = \
209         $(libWebCore_la_CXXFLAGS)
210
211 libwebkit_1_0_la_CFLAGS = \
212         $(libWebCore_la_CFLAGS)
213
214 libwebkit_1_0_la_CPPFLAGS = \
215         $(libWebCore_la_CPPFLAGS)
216
217 libwebkit_1_0_la_LDFLAGS = \
218         $(COVERAGE_LDFLAGS) \
219         -version-info @LIBWEBKITGTK_VERSION@
220
221 libwebkit_1_0_la_LIBADD = \
222         libWebCore.la
223
224 #
225 # Extra checks and flags
226 global_cppflags += \
227         -DBUILDING_GTK__=1 \
228         -DWTF_CHANGES
229
230 if !ENABLE_FAST_MALLOC
231 global_cppflags += \
232         -DUSE_SYSTEM_MALLOC
233 endif
234
235 if TARGET_X11
236 global_cppflags += -DXP_UNIX
237 endif
238
239 if !ENABLE_DEBUG
240 global_cppflags += -DNDEBUG
241 else
242 webkitgtk_cppflags += \
243         -DG_DISABLE_DEPRECATED \
244         -DGDK_PIXBUF_DISABLE_DEPRECATED \
245         -DGDK_DISABLE_DEPRECATED \
246         -DGTK_DISABLE_DEPRECATED \
247         -DPANGO_DISABLE_DEPRECATED
248
249 # Might be useful in the future
250 #       -DGDK_MULTIHEAD_SAFE \
251 #       -DGTK_MULTIHEAD_SAFE
252 endif
253
254 if !ENABLE_DATABASE
255 global_cppflags += -DENABLE_DATABASE=0
256 endif
257
258 if !ENABLE_ICONDATABASE
259 global_cppflags += -DENABLE_ICONDATABASE=0
260 endif
261
262 if ENABLE_COVERAGE
263 global_cppflags += \
264         -DGCC_GENERATE_TEST_COVERAGE_FILES \
265         -DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
266 endif
267
268 if ENABLE_VIDEO
269 webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
270 endif
271
272 webkitgtk_cppflags += \
273 -I$(top_builddir)/WebKit/gtk/webkit \
274 -DBUILDING_CAIRO__=1 \
275 -DBUILD_WEBKIT
276
277 webkitgtk_h_api += \
278         WebKit/gtk/webkit/webkit.h \
279         WebKit/gtk/webkit/webkitdefines.h \
280         WebKit/gtk/webkit/webkitnetworkrequest.h \
281         WebKit/gtk/webkit/webkitwebbackforwardlist.h \
282         WebKit/gtk/webkit/webkitwebframe.h \
283         WebKit/gtk/webkit/webkitwebhistoryitem.h \
284         WebKit/gtk/webkit/webkitwebsettings.h \
285         WebKit/gtk/webkit/webkitwebview.h
286
287 webkitgtk_built_sources += \
288         WebKit/gtk/webkit/webkit-marshal.h \
289         WebKit/gtk/webkit/webkit-marshal.cpp
290
291 webkitgtk_headers += \
292         WebKit/gtk/webkit/webkitprivate.h \
293         WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
294         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
295         WebKit/gtk/WebCoreSupport/DragClientGtk.h \
296         WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
297         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
298         WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
299         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h
300
301 webkitgtk_sources += \
302         WebKit/gtk/webkit/webkitnetworkrequest.cpp \
303         WebKit/gtk/webkit/webkitprivate.cpp \
304         WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
305         WebKit/gtk/webkit/webkitwebframe.cpp \
306         WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
307         WebKit/gtk/webkit/webkitwebsettings.cpp \
308         WebKit/gtk/webkit/webkitwebview.cpp \
309         WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
310         WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
311         WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
312         WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
313         WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
314         WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
315         WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp
316
317 webkitgtk_cleanfiles += \
318         $(top_builddir)/Programs/GtkLauncher \
319         $(top_builddir)/WebKit/gtk/webkit-1.0.pc
320
321 pkgconfigdir = $(libdir)/pkgconfig
322 pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
323
324 WEBKIT_MARSHAL = $(CURDIR)/WebKit/gtk/webkit/webkit-marshal
325 WEBKIT_MARSHAL_LIST = $(srcdir)/WebKit/gtk/webkit/webkit-marshal.list
326
327 stamp_files := \
328         stamp-webkit-marshal.cpp \
329         stamp-webkit-marshal.h
330
331 WebKit/gtk/webkit/webkit-marshal.cpp: stamp-webkit-marshal.cpp
332         @true
333
334 WebKit/gtk/webkit/webkit-marshal.h: stamp-webkit-marshal.h
335         @true
336
337 stamp-webkit-marshal.cpp: $(WEBKIT_MARSHAL_LIST)
338         echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
339         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
340         echo timestamp > $(@F)
341
342 stamp-webkit-marshal.h: $(WEBKIT_MARSHAL_LIST)
343         $(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
344         echo timestamp > $(@F)
345
346 # END WEBKIT GTK+
347
348 # Files that will be cleaned
349 MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
350 DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
351 CLEANFILES := $(stamp_files) $(BUILT_SOURCES)
352
353 # Include module makefiles
354 include JavaScriptCore/GNUmakefile.am
355 include WebCore/GNUmakefile.am
356 include WebKitTools/GNUmakefile.am
357
358
359 # Autogenerated sources
360 BUILT_SOURCES = \
361         $(javascriptcore_built_sources) \
362         $(javascriptcore_built_nosources) \
363         $(webcore_built_sources) \
364         $(webcore_built_nosources) \
365         $(webkitgtk_built_sources) \
366         $(webkitgtk_built_nosources)
367
368 # Project-wide clean rules
369 CLEANFILES += \
370         $(webkitgtk_cleanfiles) \
371         $(top_builddir)/Programs/DumpRenderTree \
372         $(top_builddir)/Programs/testkjs \
373         $(GENSOURCES)
374
375 MAINTAINERCLEANFILES += \
376         $(srcdir)/aconfig.h.in \
377         configure \
378         config.* \
379         GNUmakefile.in \
380         INSTALL \
381         README