GNUmakefile.am 12.7 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
32
33

srcdir = @srcdir@
VPATH = @srcdir@

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

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

# Libraries and support components
40
41
bin_PROGRAMS :=

42
43
noinst_PROGRAMS :=

44
45
noinst_HEADERS :=

46
47
48
49
50
lib_LIBRARIES :=

IDL_BINDINGS :=

# Global flags to CPP
51
global_cppflags :=
52

53
54
55
global_cppflags += \
	-DWTF_USE_ICU_UNICODE=1

56
57
58
59
60
# 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 \
61
62
	-Wno-unused-parameter -Wno-parentheses \
	-fno-exceptions
63
64

global_cxxflags := \
65
66
	$(SYMBOL_VISIBILITY_INLINES) \
	-fno-rtti
67
68
69

if !ENABLE_DEBUG
global_cflags += \
70
	$(SYMBOL_VISIBILITY)
71
72
endif

73
74
75
76
77
78
# -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
endif

79
if OS_GNU
80
version_script = -Wl,--version-script,$(srcdir)/symbols.filter
81
82
endif

83
84
# Shared libraries
lib_LTLIBRARIES = \
85
	libwebkit-1.0.la
86

87
88
# Convenience libraries
noinst_LTLIBRARIES = \
89
90
	libJavaScriptCore.la \
	libWebCore.la
91
92

#
93
# JavaScriptCore
94
95
96
javascriptcore_h_api :=
javascriptcore_cppflags:=
javascriptcore_sources :=
97
javascriptcore_built_sources :=
98
javascriptcore_built_nosources :=
99
javascriptcore_dist :=
100

zecke@webkit.org's avatar
zecke@webkit.org committed
101
102
103
104
105
106
107
javascriptcore_cppflags += \
	-I$(srcdir)/JavaScriptCore \
	-I$(srcdir)/JavaScriptCore/ForwardingHeaders \
	-I$(srcdir)/JavaScriptCore/wtf \
	-I$(srcdir)/JavaScriptCore/kjs \
	-I$(top_builddir)/DerivedSources

108
109
# The variables above are already included below so no need to touch
# these variables unless you really have to
110
nodist_EXTRA_libJavaScriptCore_la_SOURCES = \
111
112
113
	$(javascriptcore_built_nosources)

nodist_libJavaScriptCore_la_SOURCES = \
114
115
	$(javascriptcore_built_sources)

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

119
libJavaScriptCore_la_SOURCES = \
120
121
	$(javascriptcore_sources)

122
libJavaScriptCore_la_LIBADD = \
123
	$(UNICODE_LIBS) \
124
125
	$(GLOBALDEPS_LIBS) \
	-lpthread
darin@apple.com's avatar
.:    
darin@apple.com committed
126
127

libJavaScriptCore_la_CXXFLAGS = \
128
	$(global_cxxflags) \
129
	$(libJavaScriptCore_la_CFLAGS)
darin@apple.com's avatar
.:    
darin@apple.com committed
130
131

libJavaScriptCore_la_CFLAGS = \
132
133
	-fstrict-aliasing \
	-O3 \
134
135
	$(global_cflags) \
	$(GLOBALDEPS_CFLAGS) \
136
	$(UNICODE_CFLAGS)
137

138
139
libJavaScriptCore_la_CPPFLAGS = \
	$(global_cppflags) \
140
	$(javascriptcore_cppflags)
141
142

#
143
144
# WebCore
webcore_cppflags :=
145
webcore_sources :=
146
webcore_libadd :=
147
148
webcore_built_sources :=
webcore_built_nosources :=
149
webcore_dist :=
150
151
webcoregtk_cppflags :=
webcoregtk_sources :=
152

153
154
155
nodist_EXTRA_libWebCore_la_SOURCES = \
	$(webcore_built_nosources)

156
157
nodist_libWebCore_la_SOURCES = \
	$(webcore_built_sources)
158

159
libWebCore_la_SOURCES = \
160
161
	$(webcore_sources) \
	$(webcoregtk_sources)
162

163
libWebCore_la_CXXFLAGS = \
164
	$(global_cxxflags) \
165
	$(libWebCore_la_CFLAGS)
166

167
libWebCore_la_CFLAGS = \
168
	-fno-strict-aliasing \
169
	$(global_cflags) \
darin@apple.com's avatar
.:    
darin@apple.com committed
170
	$(GLOBALDEPS_CFLAGS) \
171
	$(UNICODE_CFLAGS) \
172
173
174
175
	$(LIBXML_CFLAGS) \
	$(CAIRO_CFLAGS) \
	$(PANGO_CFLAGS) \
	$(GTK_CFLAGS) \
176
	$(XT_CFLAGS) \
alp@webkit.org's avatar
.:    
alp@webkit.org committed
177
	$(LIBCURL_CFLAGS) \
178
	$(LIBSOUP_CFLAGS) \
179
	$(FREETYPE_CFLAGS) \
180
181
182
	$(SQLITE3_CFLAGS) \
	$(GSTREAMER_CFLAGS) \
	$(LIBXSLT_CFLAGS) \
183
184
	$(COVERAGE_CFLAGS) \
	$(HILDON_CFLAGS)
185

186
libWebCore_la_CPPFLAGS = \
187
	$(global_cppflags) \
188
	$(webcore_cppflags) \
zecke@webkit.org's avatar
zecke@webkit.org committed
189
	$(javascriptcore_cppflags) \
190
	$(webcoregtk_cppflags) \
191
	$(HILDON_CPPFLAGS)
192

193
194
libWebCore_la_LIBADD = \
	libJavaScriptCore.la \
195
	libWebCoreJS.la \
196
	$(webcore_libadd) \
darin@apple.com's avatar
.:    
darin@apple.com committed
197
	$(GLOBALDEPS_LIBS) \
198
199
200
201
	$(LIBXML_LIBS) \
	$(CAIRO_LIBS) \
	$(PANGO_LIBS) \
	$(GTK_LIBS) \
202
	$(XT_LIBS) \
alp@webkit.org's avatar
.:    
alp@webkit.org committed
203
	$(LIBCURL_LIBS) \
204
	$(LIBSOUP_LIBS) \
205
	$(FREETYPE_LIBS) \
206
	$(UNICODE_LIBS) \
207
208
209
	$(SQLITE3_LIBS) \
	$(GSTREAMER_LIBS) \
	$(LIBXSLT_LIBS) \
210
	$(HILDON_LIBS) \
211
	$(JPEG_LIBS) \
212
	$(PNG_LIBS) \
213
	-lpthread
214

215
216
217
218
219
220
221
222
223
224
225
# WebKit
webkitgtk_h_api :=
webkitgtk_sources :=
webkitgtk_cppflags :=
webkitgtk_built_sources :=
webkitgtk_built_nosources :=
webkitgtk_cleanfiles :=

nodist_libwebkit_1_0_la_SOURCES = \
	$(webkitgtk_built_sources)

226
libwebkit_1_0_ladir = $(prefix)/include/webkit-1.0/webkit
227
228
229
libwebkit_1_0_la_HEADERS = \
	$(webkitgtk_h_api) \
	WebKit/gtk/webkit/webkitenumtypes.h
230
231
232
233
234
235
236
237
238
239
240

libwebkit_1_0_la_SOURCES = \
	$(webkitgtk_sources)

libwebkit_1_0_la_CXXFLAGS = \
	$(libWebCore_la_CXXFLAGS)

libwebkit_1_0_la_CFLAGS = \
	$(libWebCore_la_CFLAGS)

libwebkit_1_0_la_CPPFLAGS = \
241
242
	$(libWebCore_la_CPPFLAGS) \
	$(webkitgtk_cppflags)
243
244

libwebkit_1_0_la_LDFLAGS = \
245
	$(COVERAGE_LDFLAGS) \
246
	-version-info @LIBWEBKITGTK_VERSION@ \
247
	$(version_script) \
248
	$(no_undefined)
249

250
251
252
libwebkit_1_0_la_LIBADD = \
	libWebCore.la

253
#
254
255
# Extra checks and flags
global_cppflags += \
256
	-DBUILDING_CAIRO__=1 \
257
258
259
	-DBUILDING_GTK__=1 \
	-DWTF_CHANGES

260
261
262
263
264
if !ENABLE_FAST_MALLOC
global_cppflags += \
	-DUSE_SYSTEM_MALLOC
endif

265
266
267
268
if TARGET_X11
global_cppflags += -DXP_UNIX
endif

269
270
if !ENABLE_DEBUG
global_cppflags += -DNDEBUG
271
else
272
webcoregtk_cppflags += \
273
274
275
276
	-DG_DISABLE_DEPRECATED \
	-DGDK_PIXBUF_DISABLE_DEPRECATED \
	-DGDK_DISABLE_DEPRECATED \
	-DGTK_DISABLE_DEPRECATED \
277
278
279
280
281
	-DPANGO_DISABLE_DEPRECATED

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

284
285
if !ENABLE_DATABASE
global_cppflags += -DENABLE_DATABASE=0
286
287
endif

288
289
if !ENABLE_ICONDATABASE
global_cppflags += -DENABLE_ICONDATABASE=0
290
291
292
293
294
295
296
297
298
endif

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

if ENABLE_VIDEO
299
webcore_libadd += -lgstinterfaces-0.10 -lgstvideo-0.10
300
301
302
endif

webkitgtk_h_api += \
303
304
305
	WebKit/gtk/webkit/webkit.h \
	WebKit/gtk/webkit/webkitdefines.h \
	WebKit/gtk/webkit/webkitnetworkrequest.h \
306
	WebKit/gtk/webkit/webkitversion.h \
307
308
309
	WebKit/gtk/webkit/webkitwebbackforwardlist.h \
	WebKit/gtk/webkit/webkitwebframe.h \
	WebKit/gtk/webkit/webkitwebhistoryitem.h \
310
	WebKit/gtk/webkit/webkitwebinspector.h \
311
	WebKit/gtk/webkit/webkitwebsettings.h \
312
	WebKit/gtk/webkit/webkitwebview.h
313
314

webkitgtk_built_sources += \
315
	DerivedSources/webkitenumtypes.cpp \
316
317
	DerivedSources/webkitmarshal.cpp \
	DerivedSources/webkitmarshal.h \
318
	WebKit/gtk/webkit/webkitenumtypes.h
319

320
321
webkitgtk_sources += \
	WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp \
322
	WebKit/gtk/WebCoreSupport/ChromeClientGtk.h \
323
	WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.cpp \
324
	WebKit/gtk/WebCoreSupport/ContextMenuClientGtk.h \
325
	WebKit/gtk/WebCoreSupport/DragClientGtk.cpp \
326
	WebKit/gtk/WebCoreSupport/DragClientGtk.h \
327
	WebKit/gtk/WebCoreSupport/EditorClientGtk.cpp \
328
	WebKit/gtk/WebCoreSupport/EditorClientGtk.h \
329
	WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.cpp \
330
	WebKit/gtk/WebCoreSupport/FrameLoaderClientGtk.h \
331
	WebKit/gtk/WebCoreSupport/InspectorClientGtk.cpp \
332
	WebKit/gtk/WebCoreSupport/InspectorClientGtk.h \
333
334
	WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.cpp \
	WebKit/gtk/WebCoreSupport/PasteboardHelperGtk.h \
335
336
	WebKit/gtk/webkit/webkitnetworkrequest.cpp \
	WebKit/gtk/webkit/webkitprivate.cpp \
337
	WebKit/gtk/webkit/webkitprivate.h \
338
	WebKit/gtk/webkit/webkitversion.cpp \
339
340
341
	WebKit/gtk/webkit/webkitwebbackforwardlist.cpp \
	WebKit/gtk/webkit/webkitwebframe.cpp \
	WebKit/gtk/webkit/webkitwebhistoryitem.cpp \
342
	WebKit/gtk/webkit/webkitwebinspector.cpp \
343
	WebKit/gtk/webkit/webkitwebsettings.cpp \
344
	WebKit/gtk/webkit/webkitwebview.cpp
345

346
347
348
349
350
351
352
webkitgtk_cppflags += \
	-DBUILDING_WEBKIT \
	-I$(srcdir)/WebKit/gtk \
	-I$(srcdir)/WebKit/gtk/WebCoreSupport \
	-I$(srcdir)/WebKit/gtk/webkit \
	-I$(top_builddir)/WebKit/gtk/webkit

353
354
webkitgtk_cleanfiles += \
	$(top_builddir)/Programs/GtkLauncher \
355
	$(top_builddir)/WebKit/gtk/webkit-1.0.pc
356

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

360
stamp_files := \
361
362
	stamp-webkitmarshal.cpp \
	stamp-webkitmarshal.h \
363
364
365
	stamp-webkitenumtypes.cpp \
	stamp-webkitenumtypes.h

366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
WEBKIT_MARSHAL = $(GENSOURCES)/webkitmarshal
WEBKIT_MARSHAL_LIST = $(WEBKIT_MARSHAL).list

$(WEBKIT_MARSHAL_LIST): $(webkitgtk_sources) GNUmakefile.am
	( cd $(top_srcdir) && \
	sed -n -e 's/.*webkit_marshal_\([[:upper:][:digit:]]*__[[:upper:][:digit:]_]*\).*/\1/p' \
	$(webkitgtk_sources) ) \
	| sed -e 's/__/:/' -e 'y/_/,/' | sort -u > $@.tmp
	if cmp -s $@.tmp $@; then \
		rm $@.tmp; \
	else \
		mv $@.tmp $@; \
	fi

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

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

386
stamp-webkitmarshal.cpp: $(WEBKIT_MARSHAL_LIST)
387
	echo "extern \"C\" {" > $(WEBKIT_MARSHAL).cpp && \
388
	$(GLIB_GENMARSHAL) --prefix=webkit_marshal $(WEBKIT_MARSHAL_LIST) --body >> $(WEBKIT_MARSHAL).cpp && echo '}' >> $(WEBKIT_MARSHAL).cpp && \
389
390
	echo timestamp > $(@F)

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

395
396
WebKit/gtk/webkit/webkitenumtypes.h: stamp-webkitenumtypes.h
	@true
397
stamp-webkitenumtypes.h: $(webkitgtk_h_api) GNUmakefile
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
	(cd $(srcdir) \
	&& 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 <@filename@>\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,WebKit/gtk/,,' | \
		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)

419
DerivedSources/webkitenumtypes.cpp: $(webkitgtk_h_api) GNUmakefile
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
	(cd $(srcdir) \
	&& 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

442
# END WEBKIT GTK+
443
444
445
#
# Files that will be distributed
EXTRA_DIST = \
446
	WebKit/LICENSE \
447
	$(javascriptcore_dist) \
448
449
	$(webcore_dist) \
	symbols.filter
450
451
452
453
454
455
456
457
458
459
460

# Files that will be cleaned
MAINTAINERCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
DISTCLEANFILES := $(stamp_files) $(BUILT_SOURCES)
CLEANFILES := $(stamp_files) $(BUILT_SOURCES)

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

461
# Autogenerated sources
462
BUILT_SOURCES := \
463
464
465
466
467
468
	$(javascriptcore_built_sources) \
	$(javascriptcore_built_nosources) \
	$(webcore_built_sources) \
	$(webcore_built_nosources) \
	$(webkitgtk_built_sources) \
	$(webkitgtk_built_nosources)
469

470
471
# Project-wide clean rules
CLEANFILES += \
472
	$(webkitgtk_cleanfiles)
473
474
475
476
477
478
479
480

MAINTAINERCLEANFILES += \
	$(srcdir)/aconfig.h.in \
	configure \
	config.* \
	GNUmakefile.in \
	INSTALL \
	README
481

482
483
484
485
486
# Older automake versions (1.7) place Plo files in a different place so we need
# to create the output directory manually.
all-local:
	mkdir -p $(top_builddir)/$(DEPDIR)/DerivedSources

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