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