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
# _built_sources    = files that will be autogenerated by the build system and
9
#                     will be part of the _SOURCES primary
10
# _built_nosources  = files that are autogenerated but are not part of the
11
#                     _SOURCES primary
12
# _cleanfiles       = files that will be removed by the clean target
13
#
14
# Sources, headers, flags, etc... should be added to the respective variables
15
# with the above suffix, e.g, webcore-specific sources should go to
16
# webcore_sources, gtk port API and WebCoreSupport parts to webkitgtk_sources,
17
# etc... The only exceptions are the global variables. See Global Variables
18
# below.
19
20
# Global Variables Reference
21
# global_cppflags   = CPPFLAGS that apply to all C/C++ files that are built for any project.
22
# global_cflags     = CFLAGS that apply to all C files that are built for any project.
23
# global_cxxflags   = CXXFLAGS that apply to all C++ files that are bult for any project.
24
25
srcdir = @srcdir@
26
VPATH = @srcdir@
27
28
DISTCHECK_CONFIGURE_FLAGS = \
29
	--enable-introspection	\
30
	--enable-gtk-doc \
31
	--enable-webkit2
32
33
# Directory for autogenerated sources
34
GENSOURCES := $(top_builddir)/DerivedSources
35
GENSOURCES_JAVASCRIPTCORE := $(top_builddir)/DerivedSources/JavaScriptCore
36
GENSOURCES_WEBCORE := $(top_builddir)/DerivedSources/WebCore
37
GENSOURCES_WEBKIT := $(top_builddir)/DerivedSources/webkit
38
GENSOURCES_WEBKIT2 := $(top_builddir)/DerivedSources/WebKit2
39
GENPROGRAMS := $(top_builddir)/Programs
40
GENSOURCES_INSPECTOR := $(GENPROGRAMS)/resources/inspector
41
WebCore := $(srcdir)/Source/WebCore
42
WebKit := $(srcdir)/Source/WebKit/gtk
43
WebKit2 := $(srcdir)/Source/WebKit2
44
pkgconfigdir := $(libdir)/pkgconfig
45
libwebkitgtkincludedir := $(prefix)/include/webkitgtk-@WEBKITGTK_API_VERSION@
46
47
# Libraries and support components
48
bin_PROGRAMS :=
49
noinst_PROGRAMS :=
50
libexec_PROGRAMS :=
51
noinst_HEADERS :=
52
noinst_LTLIBRARIES :=
53
lib_LTLIBRARIES :=
54
IDL_BINDINGS :=
55
TEST_PROGS :=
56
POFILES :=
57
PO_LINGUAS :=
58
USER_LINGUAS :=
59
USE_LINGUAS :=
60
MOFILES :=
61
ALL_MOFILES :=
62
dom_binding_idls :=
63
wtf_sources :=
64
javascriptcore_h_api :=
65
javascriptcore_cppflags:=
66
javascriptcore_cflags :=
67
javascriptcore_sources :=
68
javascriptcore_built_sources :=
69
javascriptcore_built_nosources :=
70
webcore_cppflags :=
71
webcore_modules_sources :=
72
webcore_sources :=
73
webcore_libadd :=
74
webcore_built_sources :=
75
webcore_built_nosources :=
76
webcoregtk_sources :=
77
webcoregtk_cppflags :=
78
webkitgtk_built_h_api :=
79
webkitgtk_static_h_api :=
80
webkitgtk_h_api :=
81
webkitgtk_sources :=
82
webkitgtk_cppflags :=
83
webkitgtk_gdom_built_sources :=
84
webkitgtk_built_sources :=
85
webkitgtk_built_nosources :=
86
webkit2_h_api :=
87
webkit2_sources :=
88
webkit2_built_sources :=
89
webkit2gtk_h_api :=
90
webkit2gtk_built_sources :=
91
webkit2_plugin_process_sources :=
92
webkit2_plugin_process_built_sources :=
93
webkittestrunner_built_sources :=
94
libwebcoreinternals_built_sources :=
95
minibrowser_built_sources :=
96
global_cppflags :=
97
global_cflags :=
98
global_cxxflags :=
99
JSCORE_GIRSOURCES :=
100
WEBKIT_GIRSOURCES :=
101
FEATURE_DEFINES :=
102
typelibsdir :=
103
typelibs_DATA :=
104
EXTRA_DIST :=
105
BUILT_SOURCES :=
106
CLEANFILES :=
107
DOMAIN :=
108
DISTCLEANFILES :=
109
MAINTAINERCLEANFILES :=
110
pkgconfig_DATA :=
111
112
# We do not care at all about this implicit built-in make rules,
113
# disable them to save some build time
114
%: %.c
115
%: %.cpp
116
%: %.o
117
(%): %
118
%.out: %
119
%.c: %.w %.ch
120
%.tex: %.w %.ch
121
%:: %,v
122
%:: RCS/%,v
123
%:: RCS/%
124
%:: s.%
125
%:: SCCS/s.%
126
127
global_cppflags += \
128
	-Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
129
	-Wformat -Wformat-security -Wno-format-y2k -Wundef \
130
	-Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
131
	-Wno-unused-parameter -Wno-parentheses \
132
	-fno-exceptions -DENABLE_GLIB_SUPPORT=1
133
134
135
global_cxxflags += \
136
	-fno-rtti
137
138
# -no-undefined required for building DLLs on Windows
139
# It breaks the build on other platforms, so we use it conditionally
140
if OS_WIN32
141
no_undefined = -no-undefined
142
version_script = -export-symbols-regex "^(webkit_|k?JS).*"
143
endif
144
145
if OS_GNU
146
version_script = -Wl,--version-script,$(srcdir)/Source/autotools/symbols.filter
147
endif
148
149
# Extra checks and flags
150
global_cppflags += \
151
	-DBUILDING_CAIRO__=1 \
152
	-DBUILDING_GTK__=1 \
153
	-DBUILDING_SOUP__=1 \
154
	-DWTF_CHANGES
155
156
if ENABLE_WEBKIT2
157
global_cppflags += \
158
	-DBUILDING_WEBKIT2__=1
159
endif
160
161
# For the Gtk port we want to use XP_UNIX both in X11 and Mac
162
if !TARGET_WIN32
163
global_cppflags += \
164
	-DXP_UNIX
165
endif
166
167
# Add MOZ_X11 for X11 targets only
168
if TARGET_X11
169
global_cppflags += \
170
	-DMOZ_X11
171
endif
172
173
# Use the wide character version of win32 API by default
174
if TARGET_WIN32
175
global_cppflags += \
176
	-DUNICODE \
177
	-D_UNICODE
178
endif
179
180
if USE_ICU_UNICODE
181
global_cppflags += \
182
	-DWTF_USE_ICU_UNICODE=1
183
endif
184
185
if USE_GLIB_UNICODE
186
global_cppflags += \
187
	-DWTF_USE_GLIB_UNICODE=1
188
endif
189
190
if !ENABLE_FAST_MALLOC
191
global_cppflags += \
192
	-DUSE_SYSTEM_MALLOC
193
endif
194
195
if USE_GSTREAMER
196
global_cppflags += \
197
	-DWTF_USE_GSTREAMER=1
198
endif
199
200
if USE_ACCELERATED_COMPOSITING
201
global_cppflags += \
202
	-DWTF_USE_ACCELERATED_COMPOSITING=1 \
203
	-DENABLE_3D_RENDERING=1
204
endif
205
206
if USE_TEXTURE_MAPPER_CAIRO
207
global_cppflags += \
208
	-DWTF_USE_TEXTURE_MAPPER=1 \
209
	-DWTF_USE_TEXTURE_MAPPER_CAIRO=1
210
endif
211
212
if USE_TEXTURE_MAPPER_GL
213
global_cppflags += \
214
	-DWTF_USE_TEXTURE_MAPPER=1 \
215
	-DWTF_USE_TEXTURE_MAPPER_GL=1
216
endif
217
218
if USE_CLUTTER
219
global_cppflags += \
220
	-DWTF_USE_CLUTTER=1
221
endif
222
223
if USE_GLX
224
global_cppflags += \
225
	-DWTF_USE_GLX=1
226
endif
227
228
if USE_OPENGL
229
global_cppflags += \
230
	-DWTF_USE_OPENGL=1
231
endif
232
233
# ----
234
# GTK+ 2.x/3.x support
235
# ----
236
if GTK_API_VERSION_2
237
global_cppflags += \
238
	-DGTK_API_VERSION_2=1
239
endif
240
241
if !ENABLE_DEBUG
242
global_cppflags += -DNDEBUG
243
else
244
global_cppflags += \
245
	-DGDK_PIXBUF_DISABLE_DEPRECATED \
246
	-DGDK_DISABLE_DEPRECATED \
247
	-DGTK_DISABLE_DEPRECATED \
248
	-DPANGO_DISABLE_DEPRECATED
249
# Might be useful in the future
250
#	-DGDK_MULTIHEAD_SAFE \
251
#	-DGTK_MULTIHEAD_SAFE
252
endif
253
254
if ENABLE_COVERAGE
255
global_cppflags += \
256
	-DGCC_GENERATE_TEST_COVERAGE_FILES \
257
	-DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
258
endif
259
260
EXTRA_DIST += \
261
	$(srcdir)/Source/autotools/symbols.filter \
262
	$(srcdir)/Source/WebKit/LICENSE
263
264
# Include module makefiles
265
include Source/WTF/GNUmakefile.am
266
include Source/JavaScriptCore/GNUmakefile.am
267
include Source/WebCore/GNUmakefile.am
268
include Source/WebKit/gtk/GNUmakefile.am
269
include Source/WebCore/bindings/gobject/GNUmakefile.am
270
include Tools/GNUmakefile.am
271
include Source/WebKit/gtk/po/GNUmakefile.am
272
include Tools/DumpRenderTree/gtk/GNUmakefile.ImageDiff.am
273
274
include Source/WebKit2/GNUmakefile.am
275
include Source/WebKit2/UIProcess/API/gtk/tests/GNUmakefile.am
276
include Tools/MiniBrowser/gtk/GNUmakefile.am
277
include Tools/WebKitTestRunner/GNUmakefile.am
278
include Source/ThirdParty/gtest/GNUmakefile.am
279
include Tools/TestWebKitAPI/GNUmakefile.am
280
# [GTK] Refactor the translations now that we have webkit2
281
# https://bugs.webkit.org/show_bug.cgi?id=55153
282
283
# Autogenerated sources
284
BUILT_SOURCES += \
285
	$(javascriptcore_built_sources) \
286
	$(javascriptcore_built_nosources) \
287
	$(webcore_built_sources) \
288
	$(webcore_built_nosources) \
289
	$(webkitgtk_built_sources) \
290
	$(webkitgtk_built_nosources) \
291
	$(webkit2_built_sources) \
292
	$(webkit2gtk_built_sources) \
293
	$(webkit2_plugin_process_built_sources)
294
295
DISTCLEANFILES += \
296
	$(CLEANFILES) \
297
	$(builddir)/doltcompile \
298
	$(builddir)/doltlibtool
299
300
MAINTAINERCLEANFILES += \
301
	$(CLEANFILES) \
302
	$(builddir)/doltcompile \
303
	$(builddir)/doltlibtool \
304
	$(srcdir)/aconfig.h.in \
305
	$(srcdir)/Source/autotools/config.* \
306
	$(srcdir)/Source/autotools/compile \
307
	$(srcdir)/Source/autotools/depcomp \
308
	$(srcdir)/Source/autotools/install-sh \
309
	$(srcdir)/Source/autotools/missing \
310
	$(srcdir)/configure \
311
	$(srcdir)/GNUmakefile.in \
312
	$(srcdir)/INSTALL \
313
	$(srcdir)/README \
314
	$(top_builddir)/config.*
315
316
# Older automake versions (1.7) place Plo files in a different place so we need
317
# to create the output directory manually.
318
all-local: stamp-po
319
	$(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
320
321
# remove built sources and program directories
322
clean-local:
323
	-rm -rf $(GENPROGRAMS)
324
325
maintainer-clean-local: distclean-local
326
distclean-local:
327
	-rm -rf $(GENSOURCES) $(GENPROGRAMS)
328
329
dist-hook: doc-dist-hook
330
doc-dist-hook: docs-build.stamp
331
	cp $(WebKit)/NEWS $(distdir)
332
	@mkdir -p $(distdir)/Documentation/webkitgtk/html
333
	@mkdir -p $(distdir)/Documentation/webkitgtk/tmpl
334
	@-cp ./Documentation/webkitgtk/tmpl/*.sgml $(distdir)/Documentation/webkitgtk/tmpl
335
	@cp ./Documentation/webkitgtk/html/* $(distdir)/Documentation/webkitgtk/html
336
if ENABLE_WEBKIT2
337
	@mkdir -p $(distdir)/Documentation/webkit2gtk/html
338
	@mkdir -p $(distdir)/Documentation/webkit2gtk/tmpl
339
	@-cp ./Documentation/webkit2gtk/tmpl/*.sgml $(distdir)/Documentation/webkit2gtk/tmpl
340
	@cp ./Documentation/webkit2gtk/html/* $(distdir)/Documentation/webkit2gtk/html
341
endif