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