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