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