GNUmakefile.am 23.6 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Top-level Makefile rule for automake
#
# Variable conventions:
#
# _h_api            = API headers that will be installed and included in the distribution
# _cppflags         = flags that will be passed to the C/CXX Preprocessor
# _sources          = sources that will be compiled and included in the distribution
# _built_sources    = files that will be autogenerated by the build system and
#                     will be part of the _SOURCES primary
# _built_nosources  = files that are autogenerated but are not part of the
#                     _SOURCES primary
# _cleanfiles       = files that will be removed by the clean target
#
# Sources, headers, flags, etc... should be added to the respective variables
# with the above suffix, e.g, webcore-specific sources should go to
16
17
18
# webcore_sources, gtk port API and WebCoreSupport parts to webkitgtk_sources,
# etc... The only exceptions are the global variables. See Global Variables
# below.
19
20
21
22
23
#
# Global Variables
#
# global_cppflags   = CPPFLAGS that apply to JSC, WebCore, and to any
#                     specific port
24
# global_cflags     = CFLAGS that apply to JSC, WebCore, and to
25
#                     any specific port
26
27
# global_cxxflags   = CXXFLAGS that apply to JSC, WebCore, and to any
#                     specific port
28
29
30
31

srcdir = @srcdir@
VPATH = @srcdir@

32
33
34
35
DISTCHECK_CONFIGURE_FLAGS = \
	--enable-introspection	\
	--enable-gtk-doc

36
37
# Directory for autogenerated sources
GENSOURCES := $(top_builddir)/DerivedSources
38
GENPROGRAMS := $(top_builddir)/Programs
39
40

# Script for creating hash tables
41
CREATE_HASH_TABLE = $(srcdir)/JavaScriptCore/create_hash_table
42

43
44
45
46
# Programs to run the WebKitGtk unit tests
GTESTER = gtester
GTESTER_REPORT = gtester-report

47
# Libraries and support components
48
bin_PROGRAMS :=
49
noinst_PROGRAMS :=
50
noinst_HEADERS :=
kov@webkit.org's avatar
kov@webkit.org committed
51
noinst_LTLIBRARIES :=
52
53
lib_LIBRARIES :=
IDL_BINDINGS :=
54
TEST_PROGS :=
55
56
POFILES :=
MOFILES :=
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
javascriptcore_h_api :=
javascriptcore_cppflags:=
javascriptcore_sources :=
javascriptcore_built_sources :=
javascriptcore_built_nosources :=
javascriptcore_dist :=
webcore_cppflags :=
webcore_sources :=
webcore_libadd :=
webcore_built_sources :=
webcore_built_nosources :=
webcore_dist :=
webcoregtk_cppflags :=
webcoregtk_sources :=
webkitgtk_h_api :=
webkitgtk_sources :=
webkitgtk_cppflags :=
webkitgtk_built_sources :=
webkitgtk_built_nosources :=
webkitgtk_cleanfiles :=
77
global_cppflags :=
78
79
80
81
global_cflags :=
global_cxxflags :=
corekit_cflags :=
corekit_cppflags :=
82
JSCORE_GIRSOURCES :=
kov@webkit.org's avatar
kov@webkit.org committed
83
84
85
WEBKIT_GIRSOURCES :=
typelibsdir :=
typelibs_DATA :=
kov@webkit.org's avatar
kov@webkit.org committed
86
EXTRA_DIST :=
87
88
89
90
BUILT_SOURCES :=
CLEANFILES :=
DISTCLEANFILES :=
MAINTAINERCLEANFILES :=
91
92
93

# CFLAGS/CXXFLAGS used by WebCore and WebKit
#
94
# gtk+.pc already include glib, cairo, freetype and pango CFLAGS
95
96
97
98
99
100
# Don't include them for now to reduce the noise when compiling
# $(GLIB_CFLAGS) $(CAIRO_CFLAGS) $(PANGO_CFLAGS)  $(FREETYPE_CFLAGS)
corekit_cflags += \
	-fno-strict-aliasing \
	$(COVERAGE_CFLAGS) \
	$(ENCHANT_CFLAGS) \
101
	$(GAIL_CFLAGS) \
102
103
104
105
106
107
108
109
110
111
112
	$(GEOCLUE_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GSTREAMER_CFLAGS) \
	$(GTK_CFLAGS) \
	$(HILDON_CFLAGS) \
	$(LIBSOUP_CFLAGS) \
	$(LIBXML_CFLAGS) \
	$(LIBXSLT_CFLAGS) \
	$(SQLITE3_CFLAGS) \
	$(UNICODE_CFLAGS) \
	$(XT_CFLAGS)
113

114
# When building webcore/webkit, we want WebCore/config.h and NOT
115
# JavaScriptCore/config.h, hence, it's important that WebCore/ should come first
116
117
118
119
120
121
122
# before JavaScriptCore in the include path.
corekit_cppflags += \
	$(global_cppflags) \
	$(webcore_cppflags) \
	$(webcoregtk_cppflags) \
	$(javascriptcore_cppflags)

123
124
# For the Gtk port we want to use XP_UNIX both in X11 and Mac
if !TARGET_WIN32
125
126
corekit_cppflags += -DXP_UNIX
endif
127

128
# Default compiler flags
129
global_cflags += \
130
131
132
	-Wall -W -Wcast-align -Wchar-subscripts -Wreturn-type \
	-Wformat -Wformat-security -Wno-format-y2k -Wundef \
	-Wmissing-format-attribute -Wpointer-arith -Wwrite-strings \
133
134
	-Wno-unused-parameter -Wno-parentheses \
	-fno-exceptions
135

136
137
global_cxxflags += \
	$(global_cflags) \
138
139
	$(SYMBOL_VISIBILITY_INLINES) \
	-fno-rtti
140

141
142
143
# -no-undefined required for building DLLs on Windows
# It breaks the build on other platforms, so we use it conditionally
if OS_WIN32
144
no_undefined = -no-undefined
145
version_script = -export-symbols-regex "^(webkit_|JS).*"
146
147
endif

148
if OS_GNU
149
version_script = -Wl,--version-script,$(srcdir)/autotools/symbols.filter
150
151
endif

152
153
# Shared libraries
lib_LTLIBRARIES = \
154
	libwebkit-1.0.la
155

156
# Convenience libraries
kov@webkit.org's avatar
kov@webkit.org committed
157
158
noinst_LTLIBRARIES += \
	libJavaScriptCore.la
159

160
# JavaScriptCore
zecke@webkit.org's avatar
zecke@webkit.org committed
161
162
javascriptcore_cppflags += \
	-I$(srcdir)/JavaScriptCore/ForwardingHeaders \
163
	-I$(srcdir)/JavaScriptCore/parser \
zecke@webkit.org's avatar
zecke@webkit.org committed
164
	-I$(srcdir)/JavaScriptCore/wtf \
165
	-I$(srcdir)/JavaScriptCore/wtf/gtk \
166
	-I$(srcdir)/JavaScriptCore/wtf/gobject \
zecke@webkit.org's avatar
zecke@webkit.org committed
167
168
	-I$(top_builddir)/DerivedSources

169
nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
170
171
172
	$(javascriptcore_built_nosources)

nodist_libJavaScriptCore_la_SOURCES = \
173
174
	$(javascriptcore_built_sources)

175
libJavaScriptCore_ladir = $(prefix)/include/webkit-1.0/JavaScriptCore
176
libJavaScriptCore_la_HEADERS = $(javascriptcore_h_api)
177

178
libJavaScriptCore_la_SOURCES = \
179
180
	$(javascriptcore_sources)

181
182
183
184
185
libJavaScriptCore_la_LIBADD = \
	$(UNICODE_LIBS) \
	$(GLIB_LIBS) \
	-lpthread

darin@apple.com's avatar
.:    
darin@apple.com committed
186
libJavaScriptCore_la_CXXFLAGS = \
187
	$(global_cxxflags) \
188
	$(libJavaScriptCore_la_CFLAGS)
darin@apple.com's avatar
.:    
darin@apple.com committed
189
190

libJavaScriptCore_la_CFLAGS = \
191
192
	-fstrict-aliasing \
	-O3 \
193
	$(global_cflags) \
194
	$(GLIB_CFLAGS) \
195
	$(UNICODE_CFLAGS)
196

197
198
libJavaScriptCore_la_CPPFLAGS = \
	$(global_cppflags) \
199
	$(javascriptcore_cppflags)
200

kov@webkit.org's avatar
kov@webkit.org committed
201
202
# WebKit
nodist_EXTRA_libwebkit_1_0_la_SOURCES = \
203
204
	$(webcore_built_nosources)

205
nodist_libwebkit_1_0_la_SOURCES = \
kov@webkit.org's avatar
kov@webkit.org committed
206
	$(webcore_built_sources) \
207
208
	$(webkitgtk_built_sources)

209
libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
210
211
212
libwebkit_1_0_la_HEADERS = \
	$(webkitgtk_h_api) \
	WebKit/gtk/webkit/webkitenumtypes.h
213
214

libwebkit_1_0_la_SOURCES = \
kov@webkit.org's avatar
kov@webkit.org committed
215
216
	$(webcore_sources) \
	$(webcoregtk_sources) \
217
218
219
	$(webkitgtk_sources)

libwebkit_1_0_la_CXXFLAGS = \
220
221
	$(global_cxxflags) \
	$(corekit_cflags)
222
223

libwebkit_1_0_la_CFLAGS = \
224
225
	$(global_cflags) \
	$(corekit_cflags)
226
227

libwebkit_1_0_la_CPPFLAGS = \
228
229
230
	$(corekit_cppflags) \
	$(webkitgtk_cppflags) \
	$(HILDON_CPPFLAGS)
231

232
libwebkit_1_0_la_LDFLAGS = \
233
	-version-info @LIBWEBKITGTK_VERSION@ \
234
	$(version_script) \
235
	$(no_undefined)
236

237
libwebkit_1_0_la_LIBADD = \
238
239
240
241
242
243
	-lpthread \
	libJavaScriptCore.la \
	libWebCoreJS.la \
	$(webcore_ldflags) \
	$(CAIRO_LIBS) \
	$(COVERAGE_LDFLAGS) \
244
	$(ENCHANT_LIBS) \
245
	$(FREETYPE_LIBS) \
246
	$(GAIL_LIBS) \
247
248
249
250
251
252
253
254
255
256
257
258
259
260
	$(GEOCLUE_LIBS) \
	$(GLIB_LIBS) \
	$(GSTREAMER_LIBS) \
	$(GTK_LIBS) \
	$(HILDON_LIBS) \
	$(JPEG_LIBS) \
	$(LIBSOUP_LIBS) \
	$(LIBXML_LIBS) \
	$(LIBXSLT_LIBS) \
	$(PANGO_LIBS) \
	$(PNG_LIBS) \
	$(SQLITE3_LIBS) \
	$(UNICODE_LIBS) \
	$(XT_LIBS)
261

262
#
263
264
# Extra checks and flags
global_cppflags += \
265
	-DBUILDING_CAIRO__=1 \
266
	-DBUILDING_GTK__=1 \
kov@webkit.org's avatar
WebCore    
kov@webkit.org committed
267
268
269
270
	-DWTF_CHANGES

if USE_ICU_UNICODE
global_cppflags += \
271
	-DWTF_USE_ICU_UNICODE=1
kov@webkit.org's avatar
WebCore    
kov@webkit.org committed
272
273
274
275
endif

if USE_GLIB_UNICODE
global_cppflags += \
276
	-DWTF_USE_GLIB_UNICODE=1
kov@webkit.org's avatar
WebCore    
kov@webkit.org committed
277
endif
278

279
280
281
282
283
if !ENABLE_FAST_MALLOC
global_cppflags += \
	-DUSE_SYSTEM_MALLOC
endif

284
285
if !ENABLE_DEBUG
global_cppflags += -DNDEBUG
286
287
global_cflags += $(SYMBOL_VISIBILITY)

288
else
289
webcoregtk_cppflags += \
290
291
292
293
	-DG_DISABLE_DEPRECATED \
	-DGDK_PIXBUF_DISABLE_DEPRECATED \
	-DGDK_DISABLE_DEPRECATED \
	-DGTK_DISABLE_DEPRECATED \
294
295
296
297
298
	-DPANGO_DISABLE_DEPRECATED

# Might be useful in the future
#	-DGDK_MULTIHEAD_SAFE \
#	-DGTK_MULTIHEAD_SAFE
299
300
301
302
303
304
305
306
307
endif

if ENABLE_COVERAGE
global_cppflags += \
	-DGCC_GENERATE_TEST_COVERAGE_FILES \
	-DGCC_INSTRUMENT_PROGRAM_FLOW_ARCS
endif

webkitgtk_h_api += \
308
309
310
311
	$(srcdir)/WebKit/gtk/webkit/webkit.h \
	$(srcdir)/WebKit/gtk/webkit/webkitdefines.h \
	$(srcdir)/WebKit/gtk/webkit/webkitdownload.h \
	$(srcdir)/WebKit/gtk/webkit/webkiterror.h \
312
	$(srcdir)/WebKit/gtk/webkit/webkithittestresult.h \
313
	$(srcdir)/WebKit/gtk/webkit/webkitnetworkrequest.h \
314
	$(srcdir)/WebKit/gtk/webkit/webkitnetworkresponse.h \
315
316
	$(srcdir)/WebKit/gtk/webkit/webkitsoupauthdialog.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebbackforwardlist.h \
317
	$(srcdir)/WebKit/gtk/webkit/webkitwebdatasource.h \
318
319
320
321
322
	$(srcdir)/WebKit/gtk/webkit/webkitwebframe.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebhistoryitem.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebinspector.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebnavigationaction.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebpolicydecision.h \
323
	$(srcdir)/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \
324
	$(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \
325
326
327
	$(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebwindowfeatures.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebview.h \
328
329
	$(srcdir)/WebKit/gtk/webkit/webkitwebdatabase.h \
	$(srcdir)/WebKit/gtk/webkit/webkitsecurityorigin.h \
330
	$(top_builddir)/WebKit/gtk/webkit/webkitversion.h
331
332

webkitgtk_built_sources += \
333
	DerivedSources/webkitenumtypes.cpp \
334
335
	DerivedSources/webkitmarshal.cpp \
	DerivedSources/webkitmarshal.h \
336
	WebKit/gtk/webkit/webkitenumtypes.h
337

338
339
webkitgtk_sources += \
	WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
340
	WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
341
	WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
342
	WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
343
344
	WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp \
	WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.h \
345
	WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
346
	WebKit/gtk/WebCoreSupport/DragClientGtk.h \
347
	WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
348
	WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
349
	WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
350
	WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
351
	WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
352
	WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
353
354
	WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
	WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
355
	WebKit/gtk/webkit/webkitapplicationcache.cpp \
356
357
	WebKit/gtk/webkit/webkitdownload.cpp \
	WebKit/gtk/webkit/webkiterror.cpp \
358
	WebKit/gtk/webkit/webkithittestresult.cpp \
359
	WebKit/gtk/webkit/webkitnetworkrequest.cpp \
360
	WebKit/gtk/webkit/webkitnetworkresponse.cpp \
361
	WebKit/gtk/webkit/webkitprivate.cpp \
362
	WebKit/gtk/webkit/webkitprivate.h \
363
	WebKit/gtk/webkit/webkitsoupauthdialog.c \
364
	WebKit/gtk/webkit/webkitversion.cpp \
365
	WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
366
	WebKit/gtk/webkit/webkitwebdatasource.cpp \
367
368
	WebKit/gtk/webkit/webkitwebframe.cpp \
	WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
369
	WebKit/gtk/webkit/webkitwebinspector.cpp \
370
371
	WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
	WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
372
	WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
373
	WebKit/gtk/webkit/webkitwebresource.cpp \
374
375
	WebKit/gtk/webkit/webkitwebdatabase.cpp \
	WebKit/gtk/webkit/webkitsecurityorigin.cpp \
376
	WebKit/gtk/webkit/webkitwebsettings.cpp \
377
	WebKit/gtk/webkit/webkitwebview.cpp \
378
379
	WebKit/gtk/webkit/webkitwebwindowfeatures.cpp \
	WebKit/gtk/webkit/webkitworkers.cpp
380

381
382
webkitgtk_cppflags += \
	-DBUILDING_WEBKIT \
383
384
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
	-DDATA_DIR=\"${datadir}\" \
385
386
387
388
389
	-I$(srcdir)/WebKit/gtk \
	-I$(srcdir)/WebKit/gtk/WebCoreSupport \
	-I$(srcdir)/WebKit/gtk/webkit \
	-I$(top_builddir)/WebKit/gtk/webkit

390
webkitgtk_cleanfiles += \
391
392
393
394
395
	$(top_builddir)/stamp-webkitmarshal.cpp \
	$(top_builddir)/stamp-webkitmarshal.h \
	$(top_builddir)/stamp-webkitenumtypes.cpp \
	$(top_builddir)/stamp-webkitenumtypes.h \
	$(top_builddir)/Programs/GtkLauncher \
396
397
	$(top_builddir)/WebKit/gtk/docs/version.xml \
	$(top_builddir)/WebKit/gtk/docs/GNUmakefile \
398
	$(top_builddir)/WebKit/gtk/webkit-1.0.pc \
399
400
	$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h \
	$(top_builddir)/WebKit/gtk/webkit/webkitversion.h
401

402
pkgconfigdir = $(libdir)/pkgconfig
403
pkgconfig_DATA = WebKit/gtk/webkit-1.0.pc
404

405
if ENABLE_INTROSPECTION
kov@webkit.org's avatar
kov@webkit.org committed
406
407
408
409
410
411
412
JSCORE_GIRSOURCES += JSCore-1.0.gir
WEBKIT_GIRSOURCES += WebKit-1.0.gir

# JSCore-1.0.gir is handwritten - this is a hack to make the typelib
# generation work during make dist
JSCore-1.0.gir: $(srcdir)/WebKit/gtk/JSCore-1.0.gir
	cp $(srcdir)/WebKit/gtk/JSCore-1.0.gir $(builddir)/
413

414
$(WEBKIT_GIRSOURCES): $(JSCORE_GIRSOURCES) $(G_IR_SCANNER) libwebkit-1.0.la
415
416
417
418
419
420
421
422
423
	$(AM_V_GEN)$(G_IR_SCANNER) -v --namespace WebKit --nsversion=1.0 \
	     --include=GObject-2.0 \
	     --include=Gtk-2.0 \
	     --include=JSCore-1.0 \
	     --include=Soup-2.4 \
	     --library=webkit-1.0 \
	     --libtool="$(LIBTOOL)" \
	     --pkg gobject-2.0 \
	     --pkg gtk+-2.0 \
424
	     --pkg libsoup-2.4 \
425
	     --output $@ \
426
	     --add-include-path $(top_srcdir)/WebKit/gtk \
427
428
429
430
	     -I$(top_srcdir)/WebKit/gtk \
	     -I$(top_builddir)/WebKit/gtk \
	     -I$(top_srcdir)/JavaScriptCore/ForwardingHeaders \
	     -I$(top_srcdir) \
431
432
433
434
435
	     $(webkitgtk_h_api)

girdir = $(GIRDIR)
gir_DATA = $(WEBKIT_GIRSOURCES) $(JSCORE_GIRSOURCES)

kov@webkit.org's avatar
kov@webkit.org committed
436
437
typelibsdir += $(GIRTYPELIBDIR)
typelibs_DATA += $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib)
438
439

%.typelib: %.gir $(G_IR_COMPILER)
440
	$(AM_V_GEN)$(G_IR_COMPILER) --includedir $(top_srcdir)/WebKit/gtk $< -o $@
441

kov@webkit.org's avatar
kov@webkit.org committed
442
CLEANFILES += $(JSCORE_GIRSOURCES) $(WEBKIT_GIRSOURCES) $(typelibs_DATA)
443
444
445

endif

kov@webkit.org's avatar
kov@webkit.org committed
446
447
EXTRA_DIST += WebKit/gtk/JSCore-1.0.gir

448
WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
449
WEBKIT_MARSHAL_LIST = $(top_srcdir)/WebKit/gtk/webkitmarshal.list
450
451

$(WEBKIT_MARSHAL).cpp: stamp-webkitmarshal.cpp
452
453
	@true

454
$(WEBKIT_MARSHAL).h: stamp-webkitmarshal.h
455
456
	@true

457
stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
458
459
	$(AM_V_GEN) echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
	$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
460
461
	echo timestamp > $(@F)

462
stamp-webkitmarshal.h: $(WEBKIT_MARSHAL_LIST)
463
	$(AM_V_GEN)$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --header > $(WEBKIT_MARSHAL).h && \
464
465
	echo timestamp > $(@F)

466
467
WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
	@true
468
stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
469
	$(AM_V_GEN)glib-mkenums \
470
471
472
473
474
475
476
			--fhead "#ifndef WEBKIT_ENUM_TYPES_H\n" \
			--fhead "#define WEBKIT_ENUM_TYPES_H\n\n" \
			--fhead "#include <glib-object.h>\n\n" \
			--fhead "#include <webkit/webkitdefines.h>\n\n" \
			--fhead "G_BEGIN_DECLS\n\n" \
			--ftail "G_END_DECLS\n\n" \
			--ftail "#endif\n" \
477
			--fprod "#include <webkit/@basename@>\n\n" \
478
479
480
481
482
			--eprod "#define WEBKIT_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
			--eprod "WEBKIT_API GType\n@enum_name@_get_type(void);\n\n" \
		$(webkitgtk_h_api) | \
		sed 's,web_kit,webkit,' | \
		sed 's,WEBKIT_TYPE_KIT,WEBKIT_TYPE,' \
483
		> xgen-gth \
484
485
486
487
	&& (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
	&& rm -f xgen-gth \
	&& echo timestamp > $(@F)

488
DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
489
	$(AM_V_GEN)glib-mkenums \
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
			--fhead "#include <config.h>\n" \
			--fhead "#include <glib-object.h>\n" \
			--fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h\"\n\n" \
			--fhead "extern \"C\" {\n\n" \
			--fprod "\n/* enumerations from \"@filename@\" */" \
			--vhead "static const G@Type@Value _@enum_name@_values[] = {" \
			--vprod "    { @VALUENAME@, \"@VALUENAME@\", \"@valuenick@\" }," \
			--vtail "    { 0, NULL, NULL }\n};\n\n" \
			--vtail "GType @enum_name@_get_type(void)\n{\n" \
			--vtail "    static GType type = 0;\n\n" \
			--vtail "    if (!type)\n" \
			--vtail "        type = g_@type@_register_static(\"@EnumName@\", _@enum_name@_values);\n\n" \
			--vtail "    return type;\n}\n\n" \
			--ftail "}\n" \
		$(webkitgtk_h_api) | \
		sed 's,web_kit,webkit,' \
506
		> xgen-gtc \
507
508
509
	&& cp xgen-gtc $@ \
	&& rm -f xgen-gtc

kov@webkit.org's avatar
kov@webkit.org committed
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
# Files that will be distributed
EXTRA_DIST += \
	$(srcdir)/gtk-doc.make \
	WebKit/LICENSE \
	$(javascriptcore_dist) \
	$(webcore_dist) \
	$(srcdir)/autotools/symbols.filter \
	$(srcdir)/WebKit/gtk/ChangeLog \
	$(srcdir)/WebKit/gtk/NEWS \
	$(srcdir)/WebKit/gtk/webkitmarshal.list \
	$(srcdir)/WebKit/gtk/docs/GNUmakefile.* \
	$(srcdir)/WebKit/gtk/docs/webkitenvironment.xml \
	$(srcdir)/WebKit/gtk/docs/webkitgtk-docs.sgml \
	$(srcdir)/WebKit/gtk/docs/webkitgtk-sections.txt \
	$(srcdir)/WebKit/gtk/docs/version.xml.in \
	$(srcdir)/WebKit/gtk/po/* \
526
527
	$(srcdir)/WebKit/gtk/resources/* \
	$(srcdir)/WebKit/gtk/tests/resources/*
kov@webkit.org's avatar
kov@webkit.org committed
528

529
530
531
532
533
534
# extra resource files
resourcesdir = ${datadir}/webkit-1.0/resources
dist_resources_DATA = \
	$(shell ls $(srcdir)/WebKit/gtk/resources/*.html)

# END WEBKIT GTK+
535
536
537
538
539

# Include module makefiles
include JavaScriptCore/GNUmakefile.am
include WebCore/GNUmakefile.am
include WebKitTools/GNUmakefile.am
540
include WebKit/gtk/po/GNUmakefile.am
541

542
543
# Build unit tests
noinst_PROGRAMS += $(TEST_PROGS)
544

545
webkit_tests_cflags = \
546
	-fno-strict-aliasing \
547
548
549
	-I$(srcdir)/JavaScriptCore/ForwardingHeaders \
	-I$(srcdir)/WebKit/gtk \
	-I$(top_builddir)/WebKit/gtk \
550
551
	$(global_cflags) \
	$(GLIB_CFLAGS) \
552
553
	$(GTK_CFLAGS) \
	$(LIBSOUP_CFLAGS)
554

555
webkit_tests_ldadd = \
556
	libwebkit-1.0.la \
557
	$(GTK_LIBS)	\
558
559
560
	$(GLIB_LIBS) \
	$(LIBSOUP_LIBS)

561
562
563
564
webkit_tests_ldflags = \
	-no-install \
	-no-fast-install

565
TEST_PROGS += Programs/unittests/testhttpbackend \
566
	Programs/unittests/testloading \
kov@webkit.org's avatar
kov@webkit.org committed
567
	Programs/unittests/testmimehandling \
568
	Programs/unittests/testnetworkrequest \
569
	Programs/unittests/testnetworkresponse \
570
	Programs/unittests/testwebframe \
571
	Programs/unittests/testwebbackforwardlist \
572
	Programs/unittests/testwebhistoryitem \
573
	Programs/unittests/testwindow \
574
	Programs/unittests/testdownload \
575
	Programs/unittests/testatk \
576
	Programs/unittests/testhittestresult \
577
	Programs/unittests/testwebsettings \
578
	Programs/unittests/testwebresource \
579
	Programs/unittests/testwebdatasource \
kov@webkit.org's avatar
kov@webkit.org committed
580
	Programs/unittests/testwebview \
581
	Programs/unittests/testkeyevents
582
583

# Add additional tests here
584
585
586
587
588
Programs_unittests_testhttpbackend_SOURCES = WebKit/gtk/tests/testhttpbackend.c
Programs_unittests_testhttpbackend_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testhttpbackend_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testhttpbackend_LDFLAGS = $(webkit_tests_ldflags)

589
590
591
592
593
Programs_unittests_testloading_SOURCES = WebKit/gtk/tests/testloading.c
Programs_unittests_testloading_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testloading_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testloading_LDFLAGS = $(webkit_tests_ldflags)

594
Programs_unittests_testmimehandling_SOURCES = WebKit/gtk/tests/testmimehandling.c WebKit/gtk/tests/test_utils.c
kov@webkit.org's avatar
kov@webkit.org committed
595
596
597
598
Programs_unittests_testmimehandling_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testmimehandling_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testmimehandling_LDFLAGS = $(webkit_tests_ldflags)

599
600
601
602
603
Programs_unittests_testnetworkrequest_SOURCES = WebKit/gtk/tests/testnetworkrequest.c
Programs_unittests_testnetworkrequest_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testnetworkrequest_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testnetworkrequest_LDFLAGS = $(webkit_tests_ldflags)

604
605
606
607
608
Programs_unittests_testnetworkresponse_SOURCES = WebKit/gtk/tests/testnetworkresponse.c
Programs_unittests_testnetworkresponse_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testnetworkresponse_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testnetworkresponse_LDFLAGS = $(webkit_tests_ldflags)

609
610
611
Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
612
Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)
613
614
615
616

Programs_unittests_testwebbackforwardlist_SOURCES = WebKit/gtk/tests/testwebbackforwardlist.c
Programs_unittests_testwebbackforwardlist_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebbackforwardlist_LDADD = $(webkit_tests_ldadd)
617
Programs_unittests_testwebbackforwardlist_LDFLAGS = $(webkit_tests_ldflags)
618

619
620
621
Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
622
Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags)
623

624
625
626
627
628
Programs_unittests_testwindow_SOURCES = WebKit/gtk/tests/testwindow.c
Programs_unittests_testwindow_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwindow_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testwindow_LDFLAGS = $(webkit_tests_ldflags)

629
630
631
Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c
Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
632
Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags)
633

634
635
636
637
638
Programs_unittests_testatk_SOURCES = WebKit/gtk/tests/testatk.c
Programs_unittests_testatk_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testatk_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testatk_LDFLAGS = $(webkit_tests_ldflags)

639
640
641
642
643
Programs_unittests_testwebsettings_SOURCES = WebKit/gtk/tests/testwebsettings.c
Programs_unittests_testwebsettings_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebsettings_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testwebsettings_LDFLAGS = $(webkit_tests_ldflags)

644
645
646
647
Programs_unittests_testwebresource_SOURCES = WebKit/gtk/tests/testwebresource.c
Programs_unittests_testwebresource_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebresource_LDADD = $(webkit_tests_ldadd)

648
649
650
651
Programs_unittests_testwebdatasource_SOURCES = WebKit/gtk/tests/testwebdatasource.c
Programs_unittests_testwebdatasource_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebdatasource_LDADD = $(webkit_tests_ldadd)

652
Programs_unittests_testwebview_SOURCES = WebKit/gtk/tests/testwebview.c WebKit/gtk/tests/test_utils.c
kov@webkit.org's avatar
kov@webkit.org committed
653
654
655
656
Programs_unittests_testwebview_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebview_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testwebview_LDFLAGS = $(webkit_tests_ldflags)

657
658
659
660
Programs_unittests_testhittestresult_SOURCES = WebKit/gtk/tests/testhittestresult.c
Programs_unittests_testhittestresult_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testhittestresult_LDADD = $(webkit_tests_ldadd)

661
662
663
664
665
Programs_unittests_testkeyevents_SOURCES = WebKit/gtk/tests/testkeyevents.c
Programs_unittests_testkeyevents_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testkeyevents_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testkeyevents_LDFLAGS = $(webkit_tests_ldflags)

666
# Autogenerated sources
667
BUILT_SOURCES += \
668
669
670
671
672
673
	$(javascriptcore_built_sources) \
	$(javascriptcore_built_nosources) \
	$(webcore_built_sources) \
	$(webcore_built_nosources) \
	$(webkitgtk_built_sources) \
	$(webkitgtk_built_nosources)
674

675
# Project-wide clean rules
676
# Files that will be cleaned
677
CLEANFILES += \
678
	$(BUILT_SOURCES) \
679
	$(webkitgtk_cleanfiles)
680

681
682
683
684
685
DISTCLEANFILES += \
	$(CLEANFILES) \
	$(builddir)/doltcompile \
	$(builddir)/doltlibtool

686
MAINTAINERCLEANFILES += \
687
688
689
	$(CLEANFILES) \
	$(builddir)/doltcompile \
	$(builddir)/doltlibtool \
690
	$(srcdir)/aconfig.h.in \
691
692
693
694
695
696
697
698
699
700
	$(srcdir)/autotools/config.* \
	$(srcdir)/autotools/compile \
	$(srcdir)/autotools/depcomp \
	$(srcdir)/autotools/install-sh \
	$(srcdir)/autotools/missing \
	$(srcdir)/configure \
	$(srcdir)/GNUmakefile.in \
	$(srcdir)/INSTALL \
	$(srcdir)/README \
	$(top_builddir)/config.*
701

702
703
# Older automake versions (1.7) place Plo files in a different place so we need
# to create the output directory manually.
704
705
all-local: stamp-po
	$(mkdir_p) $(top_builddir)/$(DEPDIR)/DerivedSources
706

707
708
# remove built sources and program directories
clean-local:
709
710
	-rm -rf $(GENPROGRAMS)

711
712
713
maintainer-clean-local: distclean-local

distclean-local:
714
	-rm -rf $(GENSOURCES) $(GENPROGRAMS)
715
716
717
718
719

install-data-local: po-install-data-local

installdirs-data-local: po-installdirs-data-local

720
uninstall-local: po-uninstall-local
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740

# Run all tests in cwd
# FIXME: we should run this under xvfb
test: $(TEST_PROGS)
	$(GTESTER) --verbose $(TEST_PROGS);

# test-report: run tests in cwd and generate report
# full-report: run tests in cwd with -m perf and -m slow and generate report
# perf-report: run tests in cwd with -m perf and generate report
test-report full-report perf-report: $(TEST_PROGS)
	@ case $@ in \
	  test-report) test_options="-k";; \
	  full-report) test_options="-k -m=perf";; \
	  perf-report) test_options="-k -m=perf -m=slow";; \
	  esac ; \
	  $(GTESTER) --verbose $$test_options -o test-report.xml $(TEST_PROGS); \
	  $(GTESTER_REPORT) test-report.xml > test-report.html ;

.PHONY: test test-report perf-report full-report
check-local: test