summaryrefslogtreecommitdiff
path: root/recipes/webkit/webkit-gtk/GNUmakefile.am
blob: a662290fd519de20ce2daccf68b8972bea9b2892 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
# 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
# webcore_sources, gtk port API and WebCoreSupport parts to webkitgtk_sources,
# etc... The only exceptions are the global variables. See Global Variables
# below.
#
# Global Variables
#
# global_cppflags   = CPPFLAGS that apply to JSC, WebCore, and to any
#                     specific port
# global_cflags     = CFLAGS that apply to JSC, WebCore, and to
#                     any specific port
# global_cxxflags   = CXXFLAGS that apply to JSC, WebCore, and to any
#                     specific port

srcdir = @srcdir@
VPATH = @srcdir@

DISTCHECK_CONFIGURE_FLAGS = \
	--enable-introspection	\
	--enable-gtk-doc

# Directory for autogenerated sources
GENSOURCES := $(top_builddir)/DerivedSources
GENSOURCESWEBKITDOM := $(top_builddir)/DerivedSources/webkit
GENPROGRAMS := $(top_builddir)/Programs

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

# Script for creating regexp tables
CREATE_REGEXP_TABLES = $(srcdir)/JavaScriptCore/create_regex_tables

# Programs to run the WebKitGtk unit tests
GTESTER = gtester
GTESTER_REPORT = gtester-report

# Libraries and support components
bin_PROGRAMS :=
noinst_PROGRAMS :=
noinst_HEADERS :=
noinst_LTLIBRARIES :=
lib_LIBRARIES :=
IDL_BINDINGS :=
TEST_PROGS :=
POFILES :=
MOFILES :=
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 :=
IDL_BINDINGS_GDOM :=
GDOM_AUTO_CLASSES :=
GDOM_FIXED_CLASSES :=
GDOM_CLASSES :=
GDOM_HEADERS_BUILT :=
GDOM_HEADERS_FIXED :=
libgdom_h_api :=
libgdom_cleanfiles :=
webkitgtk_h_api :=
webkitgtk_sources :=
webkitgtk_cppflags :=
webkitgtk_built_sources :=
webkitgtk_built_nosources :=
webkitgtk_cleanfiles :=
global_cppflags :=
global_cflags :=
global_cxxflags :=
corekit_cflags :=
corekit_cppflags :=
JSCORE_GIRSOURCES :=
WEBKIT_GIRSOURCES :=
typelibsdir :=
typelibs_DATA :=
EXTRA_DIST :=
BUILT_SOURCES :=
CLEANFILES :=
DISTCLEANFILES :=
MAINTAINERCLEANFILES :=

webcoregtk_cppflags += \
	-I$(top_builddir)/DerivedSources/webkit \
	-I$(srcdir)/WebCore/bindings \
	-I$(srcdir)/WebCore/bindings/gobject

# CFLAGS/CXXFLAGS used by WebCore and WebKit
#
# gtk+.pc already include glib, cairo, freetype and pango CFLAGS
# 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) \
	$(GAIL_CFLAGS) \
	$(GEOCLUE_CFLAGS) \
	$(GLIB_CFLAGS) \
	$(GSTREAMER_CFLAGS) \
	$(GTK_CFLAGS) \
	$(HILDON_CFLAGS) \
	$(LIBSOUP_CFLAGS) \
	$(LIBXML_CFLAGS) \
	$(LIBXSLT_CFLAGS) \
	$(SQLITE3_CFLAGS) \
	$(UNICODE_CFLAGS) \
	$(XT_CFLAGS)

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

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

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

global_cxxflags += \
	$(global_cflags) \
	$(SYMBOL_VISIBILITY_INLINES) \
	-fno-rtti

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

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

# Shared libraries
lib_LTLIBRARIES = \
	libwebkit-1.0.la

# Convenience libraries
noinst_LTLIBRARIES += \
	libJavaScriptCore.la

# JavaScriptCore
javascriptcore_cppflags += \
	-I$(srcdir)/JavaScriptCore/ForwardingHeaders \
	-I$(srcdir)/JavaScriptCore/parser \
	-I$(srcdir)/JavaScriptCore/wtf \
	-I$(srcdir)/JavaScriptCore/wtf/gtk \
	-I$(srcdir)/JavaScriptCore/wtf/gobject \
	-I$(top_builddir)/DerivedSources

nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
	$(javascriptcore_built_nosources)

nodist_libJavaScriptCore_la_SOURCES = \
	$(javascriptcore_built_sources)

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

libJavaScriptCore_la_SOURCES = \
	$(javascriptcore_sources)

libJavaScriptCore_la_LIBADD = \
	$(UNICODE_LIBS) \
	$(GLIB_LIBS) \
	-lpthread

libJavaScriptCore_la_CXXFLAGS = \
	$(global_cxxflags) \
	$(libJavaScriptCore_la_CFLAGS)

libJavaScriptCore_la_CFLAGS = \
	-fstrict-aliasing \
	-O3 \
	$(global_cflags) \
	$(GLIB_CFLAGS) \
	$(UNICODE_CFLAGS)

libJavaScriptCore_la_CPPFLAGS = \
	$(global_cppflags) \
	$(javascriptcore_cppflags)

# WebKit
nodist_EXTRA_libwebkit_1_0_la_SOURCES = \
	$(webcore_built_nosources)

nodist_libwebkit_1_0_la_SOURCES = \
	$(webcore_built_sources) \
	$(webkitgtk_built_sources)

libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
libwebkit_1_0_la_HEADERS = \
	$(webkitgtk_h_api) \
	WebKit/gtk/webkit/webkitenumtypes.h

libwebkit_1_0_la_SOURCES = \
	$(webcore_sources) \
	$(webcoregtk_sources) \
	$(webkitgtk_sources)

libwebkit_1_0_la_CXXFLAGS = \
	$(global_cxxflags) \
	$(corekit_cflags)

libwebkit_1_0_la_CFLAGS = \
	$(global_cflags) \
	$(corekit_cflags)

libwebkit_1_0_la_CPPFLAGS = \
	$(corekit_cppflags) \
	$(webkitgtk_cppflags) \
	$(HILDON_CPPFLAGS)

libwebkit_1_0_la_LDFLAGS = \
	-version-info @LIBWEBKITGTK_VERSION@ \
	$(version_script) \
	$(no_undefined)

libwebkit_1_0_la_LIBADD = \
	-lpthread \
	libJavaScriptCore.la \
	libWebCoreJS.la \
	libgdom.la \
	$(webcore_ldflags) \
	$(CAIRO_LIBS) \
	$(COVERAGE_LDFLAGS) \
	$(ENCHANT_LIBS) \
	$(FREETYPE_LIBS) \
	$(GAIL_LIBS) \
	$(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)

libgdom_ladir = $(prefix)/include/webkit-1.0/webkit
nodist_libgdom_la_HEADERS = \
	$(libgdom_h_api)

libgdom_cleanfiles += \
	$(top_builddir)/WebKit/gtk/webkit/webkitdomenumtypes.h \
	$(top_builddir)/libgdom.la \
	$(top_builddir)/stamp-webkitdomenumtypes.h

#
# Extra checks and flags
global_cppflags += \
	-DBUILDING_CAIRO__=1 \
	-DBUILDING_GTK__=1 \
	-DWTF_CHANGES

if USE_ICU_UNICODE
global_cppflags += \
	-DWTF_USE_ICU_UNICODE=1
endif

if USE_GLIB_UNICODE
global_cppflags += \
	-DWTF_USE_GLIB_UNICODE=1
endif

if !ENABLE_FAST_MALLOC
global_cppflags += \
	-DUSE_SYSTEM_MALLOC
endif

if !ENABLE_DEBUG
global_cppflags += -DNDEBUG
global_cflags += $(SYMBOL_VISIBILITY)

else
webcoregtk_cppflags += \
	-DG_DISABLE_DEPRECATED \
	-DGDK_PIXBUF_DISABLE_DEPRECATED \
	-DGDK_DISABLE_DEPRECATED \
	-DGTK_DISABLE_DEPRECATED \
	-DPANGO_DISABLE_DEPRECATED

# Might be useful in the future
#	-DGDK_MULTIHEAD_SAFE \
#	-DGTK_MULTIHEAD_SAFE
endif

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

webkitgtk_h_api += \
	$(srcdir)/WebKit/gtk/webkit/webkit.h \
	$(srcdir)/WebKit/gtk/webkit/webkitdefines.h \
	$(srcdir)/WebKit/gtk/webkit/webkitdownload.h \
	$(srcdir)/WebKit/gtk/webkit/webkiterror.h \
	$(srcdir)/WebKit/gtk/webkit/webkithittestresult.h \
	$(srcdir)/WebKit/gtk/webkit/webkitnetworkrequest.h \
	$(srcdir)/WebKit/gtk/webkit/webkitnetworkresponse.h \
	$(srcdir)/WebKit/gtk/webkit/webkitsoupauthdialog.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebbackforwardlist.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebdatasource.h \
	$(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 \
	$(srcdir)/WebKit/gtk/webkit/webkitgeolocationpolicydecision.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebresource.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebsettings.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebwindowfeatures.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebview.h \
	$(srcdir)/WebKit/gtk/webkit/webkitwebdatabase.h \
	$(srcdir)/WebKit/gtk/webkit/webkitsecurityorigin.h \
	$(top_builddir)/WebKit/gtk/webkit/webkitversion.h

webkitgtk_built_sources += \
	DerivedSources/webkitenumtypes.cpp \
	DerivedSources/webkitdomenumtypes.cpp \
	DerivedSources/webkitmarshal.cpp \
	DerivedSources/webkitmarshal.h \
	WebKit/gtk/webkit/webkitenumtypes.h

webkitgtk_sources += \
	WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
	WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
	WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
	WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
	WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.cpp \
	WebKit/gtk/WebCoreSupport/DocumentLoaderGtk.h \
	WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
	WebKit/gtk/WebCoreSupport/DragClientGtk.h \
	WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
	WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
	WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
	WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
	WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
	WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
	WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
	WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
	WebKit/gtk/webkit/webkitapplicationcache.cpp \
	WebKit/gtk/webkit/webkitdownload.cpp \
	WebKit/gtk/webkit/webkiterror.cpp \
	WebKit/gtk/webkit/webkithittestresult.cpp \
	WebKit/gtk/webkit/webkitnetworkrequest.cpp \
	WebKit/gtk/webkit/webkitnetworkresponse.cpp \
	WebKit/gtk/webkit/webkitprivate.cpp \
	WebKit/gtk/webkit/webkitprivate.h \
	WebKit/gtk/webkit/webkitsoupauthdialog.c \
	WebKit/gtk/webkit/webkitversion.cpp \
	WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
	WebKit/gtk/webkit/webkitwebdatasource.cpp \
	WebKit/gtk/webkit/webkitwebframe.cpp \
	WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
	WebKit/gtk/webkit/webkitwebinspector.cpp \
	WebKit/gtk/webkit/webkitwebnavigationaction.cpp \
	WebKit/gtk/webkit/webkitwebpolicydecision.cpp \
	WebKit/gtk/webkit/webkitgeolocationpolicydecision.cpp \
	WebKit/gtk/webkit/webkitwebresource.cpp \
	WebKit/gtk/webkit/webkitwebdatabase.cpp \
	WebKit/gtk/webkit/webkitsecurityorigin.cpp \
	WebKit/gtk/webkit/webkitwebsettings.cpp \
	WebKit/gtk/webkit/webkitwebview.cpp \
	WebKit/gtk/webkit/webkitwebwindowfeatures.cpp \
	WebKit/gtk/webkit/webkitworkers.cpp

webkitgtk_cppflags += \
	-DBUILDING_WEBKIT \
	-DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
	-DDATA_DIR=\"${datadir}\" \
	-I$(srcdir)/WebKit/gtk \
	-I$(srcdir)/WebKit/gtk/WebCoreSupport \
	-I$(srcdir)/WebKit/gtk/webkit \
	-I$(top_builddir)/WebKit/gtk \
	-I$(top_builddir)/WebKit/gtk/webkit \
	-I$(GENSOURCESWEBKITDOM)

webkitgtk_cleanfiles += \
	$(top_builddir)/stamp-webkitmarshal.cpp \
	$(top_builddir)/stamp-webkitmarshal.h \
	$(top_builddir)/stamp-webkitenumtypes.cpp \
	$(top_builddir)/stamp-webkitenumtypes.h \
	$(top_builddir)/Programs/GtkLauncher \
	$(top_builddir)/WebKit/gtk/docs/version.xml \
	$(top_builddir)/WebKit/gtk/docs/GNUmakefile \
	$(top_builddir)/WebKit/gtk/webkit-1.0.pc \
	$(top_builddir)/WebKit/gtk/webkit/webkitenumtypes.h \
	$(top_builddir)/WebKit/gtk/webkit/webkitversion.h

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

if ENABLE_INTROSPECTION
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)/

$(WEBKIT_GIRSOURCES): $(JSCORE_GIRSOURCES) $(G_IR_SCANNER) libwebkit-1.0.la
	$(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 \
	     --pkg libsoup-2.4 \
	     --output $@ \
	     --add-include-path $(top_srcdir)/WebKit/gtk \
	     -I$(top_srcdir)/WebKit/gtk \
	     -I$(top_builddir)/WebKit/gtk \
	     -I$(top_builddir)/DerivedSources \
	     -I$(top_srcdir)/JavaScriptCore/ForwardingHeaders \
	     -I$(top_srcdir) \
	     $(webkitgtk_h_api) \
	     $(libgdom_h_api)

girdir = $(datadir)/gir-1.0
gir_DATA = $(WEBKIT_GIRSOURCES) $(JSCORE_GIRSOURCES)

typelibsdir += $(libdir)/girepository-1.0
typelibs_DATA += $(JSCORE_GIRSOURCES:.gir=.typelib) $(WEBKIT_GIRSOURCES:.gir=.typelib)

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

CLEANFILES += $(JSCORE_GIRSOURCES) $(WEBKIT_GIRSOURCES) $(typelibs_DATA)

endif

EXTRA_DIST += WebKit/gtk/JSCore-1.0.gir

WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
WEBKIT_MARSHAL_LIST = $(top_srcdir)/WebKit/gtk/webkitmarshal.list

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

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

stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
	$(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 && \
	echo timestamp > $(@F)

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

WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
	@true
stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
	$(AM_V_GEN)glib-mkenums \
			--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" \
			--fprod "#include <webkit/@basename@>\n\n" \
			--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,' \
		> xgen-gth \
	&& (cmp -s xgen-gth WebKit/gtk/webkit/webkitenumtypes.h || cp xgen-gth WebKit/gtk/webkit/webkitenumtypes.h) \
	&& rm -f xgen-gth \
	&& echo timestamp > $(@F)

DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
	$(AM_V_GEN)glib-mkenums \
			--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,' \
		> xgen-gtc \
	&& cp xgen-gtc $@ \
	&& rm -f xgen-gtc

WebKit/gtk/webkit/webkitdomenumtypes.h: stamp-webkitdomenumtypes.h
	@true
stamp-webkitdomenumtypes.h: $(libgdom_h_api) GNUmakefile
	$(AM_V_GEN)glib-mkenums \
			--fhead "#ifndef WEBKIT_DOM_ENUM_TYPES_H\n" \
			--fhead "#define WEBKIT_DOM_ENUM_TYPES_H\n\n" \
			--fhead "#include <glib-object.h>\n\n" \
			--fhead "G_BEGIN_DECLS\n\n" \
			--ftail "G_END_DECLS\n\n" \
			--ftail "#endif\n" \
			--fprod "#include <webkit/@basename@>\n\n" \
			--eprod "#define WEBKIT_DOM_TYPE_@ENUMSHORT@ @enum_name@_get_type()\n\n" \
			--eprod "WEBKIT_API GType\n@enum_name@_get_type(void);n\n" \
			$(libgdom_h_api) | \
		sed 's,web_kit,webkit_dom,' | \
		sed 's,WEBKIT_DOM_TYPE_KIT,WEBKIT_DOM_TYPE,' \
		> xgen-cgth \
	&& (cmp -s xgen-cgth WebKit/gtk/webkit/webkitdomenumtypes.h || cp xgen-cgth WebKit/gtk/webkit/webkitdomenumtypes.h) \
	&& rm -f xgen-cgth \
	&& echo timestamp > $(@F)

DerivedSources/webkitdomenumtypes.cpp: $(top_builddir)/WebKit/gtk/webkit/webkitdomenumtypes.h $(libgdom_h_api) GNUmakefile
	$(AM_V_GEN)glib-mkenums \
			--fhead "#include <config.h>\n" \
			--fhead "#include <glib-object.h>\n" \
			--fhead "#include \"$(top_builddir)/WebKit/gtk/webkit/webkitdomenumtypes.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" \
		$(libgdom_h_api) | \
		sed 's,web_kit,webkitdom,' \
		> xgen-cgtc \
	&& cp xgen-cgtc $@ \
	&& rm -f xgen-cgtc

# 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/* \
	$(srcdir)/WebKit/gtk/resources/* \
	$(srcdir)/WebKit/gtk/tests/resources/* \
	$(srcdir)/WebKit/gtk/tests/test_utils.h

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

# END WEBKIT GTK+

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

# Build unit tests
noinst_PROGRAMS += $(TEST_PROGS)

webkit_tests_cflags = \
	-fno-strict-aliasing \
	-I$(srcdir)/JavaScriptCore/ForwardingHeaders \
	-I$(srcdir)/WebKit/gtk \
	-I$(top_builddir)/WebKit/gtk \
	-I$(top_builddir)/DerivedSources \
	-I$(top_srcdir)/WebCore/bindings \
	-I$(top_srcdir)/WebCore/bindings/gobject \
	$(global_cflags) \
	$(GLIB_CFLAGS) \
	$(GTK_CFLAGS) \
	$(LIBSOUP_CFLAGS)

webkit_tests_ldadd = \
	libwebkit-1.0.la \
	$(GTK_LIBS)	\
	$(GLIB_LIBS) \
	$(LIBSOUP_LIBS)

webkit_tests_ldflags = \
	-no-install \
	-no-fast-install

TEST_PROGS += \
	Programs/unittests/testdomdocument \
	Programs/unittests/testdomdomwindow \
	Programs/unittests/testhttpbackend \
	Programs/unittests/testloading \
	Programs/unittests/testglobals \
	Programs/unittests/testmimehandling \
	Programs/unittests/testnetworkrequest \
	Programs/unittests/testnetworkresponse \
	Programs/unittests/testwebframe \
	Programs/unittests/testwebbackforwardlist \
	Programs/unittests/testwebhistoryitem \
	Programs/unittests/testwindow \
	Programs/unittests/testdownload \
	Programs/unittests/testatk \
	Programs/unittests/testatkroles \
	Programs/unittests/testhittestresult \
	Programs/unittests/testwebsettings \
	Programs/unittests/testwebresource \
	Programs/unittests/testwebdatasource \
	Programs/unittests/testwebview \
	Programs/unittests/testkeyevents

# Add additional tests here
Programs_unittests_testdomdocument_SOURCES = WebKit/gtk/tests/testdomdocument.c
Programs_unittests_testdomdocument_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testdomdocument_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testdomdocument_LDFLAGS = $(webkit_tests_ldflags)

Programs_unittests_testdomdomwindow_SOURCES = WebKit/gtk/tests/testdomdomwindow.c
Programs_unittests_testdomdomwindow_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testdomdomwindow_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testdomdomwindow_LDFLAGS = $(webkit_tests_ldflags)

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)

Programs_unittests_testglobals_SOURCES = WebKit/gtk/tests/testglobals.c
Programs_unittests_testglobals_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testglobals_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testglobals_LDFLAGS = $(webkit_tests_ldflags)

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)

Programs_unittests_testmimehandling_SOURCES = WebKit/gtk/tests/testmimehandling.c WebKit/gtk/tests/test_utils.c
Programs_unittests_testmimehandling_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testmimehandling_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testmimehandling_LDFLAGS = $(webkit_tests_ldflags)

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)

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)

Programs_unittests_testwebframe_SOURCES = WebKit/gtk/tests/testwebframe.c
Programs_unittests_testwebframe_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebframe_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testwebframe_LDFLAGS = $(webkit_tests_ldflags)

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

Programs_unittests_testwebhistoryitem_SOURCES = WebKit/gtk/tests/testwebhistoryitem.c
Programs_unittests_testwebhistoryitem_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebhistoryitem_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testwebhistoryitem_LDFLAGS = $(webkit_tests_ldflags)

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)

Programs_unittests_testdownload_SOURCES = WebKit/gtk/tests/testdownload.c
Programs_unittests_testdownload_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testdownload_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testdownload_LDFLAGS = $(webkit_tests_ldflags)

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)

Programs_unittests_testatkroles_SOURCES = WebKit/gtk/tests/testatkroles.c
Programs_unittests_testatkroles_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testatkroles_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testatkroles_LDFLAGS = $(webkit_tests_ldflags)

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)

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

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

Programs_unittests_testwebview_SOURCES = WebKit/gtk/tests/testwebview.c WebKit/gtk/tests/test_utils.c
Programs_unittests_testwebview_CFLAGS = $(webkit_tests_cflags)
Programs_unittests_testwebview_LDADD = $(webkit_tests_ldadd)
Programs_unittests_testwebview_LDFLAGS = $(webkit_tests_ldflags)

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

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)

# Autogenerated sources
BUILT_SOURCES += \
	$(javascriptcore_built_sources) \
	$(javascriptcore_built_nosources) \
	$(webcore_built_sources) \
	$(webcore_built_nosources) \
	$(webkitgtk_built_sources) \
	$(webkitgtk_built_nosources) \
	$(gdom_built_nosources)

# Project-wide clean rules
# Files that will be cleaned
CLEANFILES += \
	$(BUILT_SOURCES) \
	$(webkitgtk_cleanfiles) \
	$(libgdom_cleanfiles)

DISTCLEANFILES += \
	$(CLEANFILES) \
	$(builddir)/doltcompile \
	$(builddir)/doltlibtool

MAINTAINERCLEANFILES += \
	$(CLEANFILES) \
	$(builddir)/doltcompile \
	$(builddir)/doltlibtool \
	$(srcdir)/aconfig.h.in \
	$(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.*

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

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

maintainer-clean-local: distclean-local

distclean-local:
	-rm -rf $(GENSOURCES) $(GENPROGRAMS)

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

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

uninstall-local: po-uninstall-local

# 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