80ae226a354a9304ccf0a9b7990779326c031ebe
[WebKit-https.git] / Tools / GNUmakefile.am
1 noinst_PROGRAMS += \
2         Programs/ImageDiff
3
4 if ENABLE_WEBKIT1
5 noinst_PROGRAMS += \
6         Programs/DumpRenderTree \
7         Programs/GtkLauncher
8 endif
9
10 # GtkLauncher
11 Programs_GtkLauncher_CPPFLAGS = \
12         -I$(srcdir)/Source/WebKit/gtk \
13         -I$(srcdir)/Source/WebCore/platform/network/soup/cache/ \
14         -I$(top_builddir)/Source/WebKit/gtk \
15         -I$(top_builddir)/DerivedSources \
16         -DWEBKIT_EXEC_PATH=\"${shell pwd}/$(top_builddir)/Programs/\" \
17         $(global_cppflags) \
18         $(javascriptcore_cppflags)
19
20 Programs_GtkLauncher_SOURCES = \
21         Tools/GtkLauncher/LauncherInspectorWindow.c \
22         Tools/GtkLauncher/LauncherInspectorWindow.h \
23         Tools/GtkLauncher/main.c
24
25 Programs_GtkLauncher_CFLAGS = \
26         -ansi \
27         -fno-strict-aliasing \
28         $(global_cflags) \
29         $(FREETYPE_CFLAGS) \
30         $(GTK_CFLAGS) \
31         $(LIBSOUP_CFLAGS) \
32         $(GSTREAMER_CFLAGS)
33
34 Programs_GtkLauncher_LDADD = \
35         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
36         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
37         $(FREETYPE_LIBS) \
38         $(GTK_LIBS) \
39         $(GLIB_LIBS) \
40         $(LIBSOUP_LIBS) \
41         $(WINMM_LIBS) \
42         $(GSTREAMER_LIBS)
43
44 Programs_GtkLauncher_LDFLAGS = \
45         -no-fast-install \
46         -no-install
47
48 # libWebCoreInternals
49 # We must split off the window.internals implementation into a separate
50 # convenience library because it requires a different include path order
51 # to prefer the WebCore config.h over the DumpRenderTree config.h
52 noinst_LTLIBRARIES += libWebCoreInternals.la
53 libWebCoreInternals_la_SOURCES = \
54         Source/WebCore/bindings/js/JSDOMWrapper.cpp \
55         Source/WebCore/bindings/js/JSDOMWrapper.h \
56         Source/WebCore/testing/MallocStatistics.h \
57         Source/WebCore/testing/Internals.cpp \
58         Source/WebCore/testing/Internals.h \
59         Source/WebCore/testing/InternalSettings.cpp \
60         Source/WebCore/testing/InternalSettings.h \
61         Source/WebCore/testing/MockPagePopupDriver.cpp \
62         Source/WebCore/testing/MockPagePopupDriver.h \
63         Source/WebCore/testing/TypeConversions.h \
64         Source/WebCore/testing/js/WebCoreTestSupport.cpp \
65         Source/WebCore/testing/js/WebCoreTestSupport.h
66
67 libwebcoreinternals_built_sources += \
68         DerivedSources/WebCore/InternalSettingsGenerated.cpp \
69         DerivedSources/WebCore/InternalSettingsGenerated.h   \
70         DerivedSources/WebCore/JSMallocStatistics.cpp \
71         DerivedSources/WebCore/JSMallocStatistics.h   \
72         DerivedSources/WebCore/JSInternals.cpp \
73         DerivedSources/WebCore/JSInternals.h   \
74         DerivedSources/WebCore/JSInternalSettings.cpp \
75         DerivedSources/WebCore/JSInternalSettings.h   \
76         DerivedSources/WebCore/JSInternalSettingsGenerated.cpp \
77         DerivedSources/WebCore/JSInternalSettingsGenerated.h \
78         DerivedSources/WebCore/JSTypeConversions.cpp \
79         DerivedSources/WebCore/JSTypeConversions.h
80
81 nodist_libWebCoreInternals_la_SOURCES = $(libwebcoreinternals_built_sources)
82 BUILT_SOURCES += $(libwebcoreinternals_built_sources)
83
84 libWebCoreInternals_la_CPPFLAGS = \
85         $(global_cppflags) \
86         $(webcore_cppflags) \
87         $(webcoregtk_cppflags) \
88         $(javascriptcore_cppflags) \
89         $(CAIRO_CFLAGS) \
90         $(FREETYPE_CFLAGS) \
91         $(LIBSOUP_CFLAGS) \
92         $(PANGO_CFLAGS) \
93         -I$(top_builddir)/DerivedSources \
94         -I$(top_builddir)/DerivedSources/WebCore
95
96 libWebCoreInternals_la_CXXFLAGS = \
97         $(global_cxxflags) \
98         $(libWebCoreInternals_la_CFLAGS)
99
100 libWebCoreInternals_la_CFLAGS = \
101         -fno-strict-aliasing \
102         $(javascriptcore_cflags)
103
104 # DumpRenderTree
105 Programs_DumpRenderTree_CPPFLAGS = \
106         $(global_cppflags) \
107         -DTOP_LEVEL_DIR=\"${shell pwd}/${srcdir}\" \
108         -I$(srcdir)/Tools/DumpRenderTree \
109         -I$(srcdir)/Tools/DumpRenderTree/atk \
110         -I$(srcdir)/Tools/DumpRenderTree/cairo \
111         -I$(srcdir)/Tools/DumpRenderTree/gtk \
112         -I$(srcdir)/Source/WebKit/gtk \
113         -I$(srcdir)/Source/WebCore/platform/gtk \
114         -I$(srcdir)/Source/WebCore/testing/js \
115         -I$(top_builddir)/DerivedSources \
116         -I$(top_builddir)/Source/WebKit/gtk \
117         $(javascriptcore_cppflags) \
118         $(webcore_cppflags)
119
120 if TARGET_X11
121 Programs_DumpRenderTree_CPPFLAGS += \
122         -DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
123         -DFONTS_CONF_DIR=\"${shell pwd}/${srcdir}/Tools/DumpRenderTree/gtk/fonts\"
124 endif
125
126 Programs_DumpRenderTree_SOURCES = \
127         Tools/DumpRenderTree/DumpRenderTree.h \
128         Tools/DumpRenderTree/DumpRenderTreeCommon.cpp \
129         Tools/DumpRenderTree/DumpRenderTreePrefix.h \
130         Tools/DumpRenderTree/AccessibilityController.cpp \
131         Tools/DumpRenderTree/AccessibilityController.h \
132         Tools/DumpRenderTree/AccessibilityTextMarker.cpp \
133         Tools/DumpRenderTree/AccessibilityTextMarker.h \
134         Tools/DumpRenderTree/AccessibilityUIElement.cpp \
135         Tools/DumpRenderTree/AccessibilityUIElement.h \
136         Tools/DumpRenderTree/CyclicRedundancyCheck.cpp \
137         Tools/DumpRenderTree/CyclicRedundancyCheck.h \
138         Tools/DumpRenderTree/GCController.cpp \
139         Tools/DumpRenderTree/GCController.h \
140         Tools/DumpRenderTree/JavaScriptThreading.h \
141         Tools/DumpRenderTree/TestRunner.cpp \
142         Tools/DumpRenderTree/TestRunner.h \
143         Tools/DumpRenderTree/PixelDumpSupport.cpp \
144         Tools/DumpRenderTree/PixelDumpSupport.h \
145         Tools/DumpRenderTree/WorkQueue.cpp \
146         Tools/DumpRenderTree/WorkQueue.h \
147         Tools/DumpRenderTree/WorkQueueItem.h \
148         Tools/DumpRenderTree/config.h \
149         Tools/DumpRenderTree/atk/AccessibilityCallbacks.h \
150         Tools/DumpRenderTree/atk/AccessibilityCallbacksAtk.cpp \
151         Tools/DumpRenderTree/atk/AccessibilityControllerAtk.cpp \
152         Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp \
153         Tools/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp \
154         Tools/DumpRenderTree/cairo/PixelDumpSupportCairo.h \
155         Tools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp \
156         Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp \
157         Tools/DumpRenderTree/gtk/DumpRenderTree.cpp \
158         Tools/DumpRenderTree/gtk/DumpRenderTreeGtk.h \
159         Tools/DumpRenderTree/gtk/EditingCallbacks.h \
160         Tools/DumpRenderTree/gtk/EditingCallbacks.cpp \
161         Tools/DumpRenderTree/gtk/EventSender.h \
162         Tools/DumpRenderTree/gtk/EventSender.cpp \
163         Tools/DumpRenderTree/gtk/GCControllerGtk.cpp \
164         Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp \
165         Tools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp \
166         Tools/DumpRenderTree/gtk/SelfScrollingWebKitWebView.cpp \
167         Tools/DumpRenderTree/gtk/SelfScrollingWebKitWebView.h \
168         Tools/DumpRenderTree/gtk/TextInputController.h \
169         Tools/DumpRenderTree/gtk/TextInputController.cpp \
170         Tools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp \
171         Source/WebCore/platform/gtk/GtkVersioning.c
172
173 Programs_DumpRenderTree_CXXFLAGS = \
174         $(global_cxxflags) \
175         $(Programs_DumpRenderTree_CFLAGS)
176
177 Programs_DumpRenderTree_CFLAGS = \
178         -fno-strict-aliasing \
179         $(global_cflags) \
180         $(GLOBALDEPS_CFLAGS) \
181         $(CAIRO_CFLAGS) \
182         $(GTK_CFLAGS) \
183         $(LIBSOUP_CFLAGS)
184
185 Programs_DumpRenderTree_LDADD = \
186         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
187         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
188         libWebCorePlatform.la \
189         libWebCoreModules.la \
190         libWebCoreInternals.la \
191         $(GLOBALDEPS_LIBS) \
192         $(CAIRO_LIBS) \
193         $(GTK_LIBS) \
194         $(GLIB_LIBS) \
195         $(LIBSOUP_LIBS) \
196         $(FREETYPE_LIBS) \
197         $(WINMM_LIBS) \
198         $(XRENDER_LIBS) \
199         $(XT_LIBS)
200
201 Programs_DumpRenderTree_LDFLAGS = \
202         -no-fast-install \
203         -no-install
204
205 # ImageDiff
206 Programs_ImageDiff_CPPFLAGS = $(global_cppflags)
207
208 Programs_ImageDiff_SOURCES = \
209    Tools/ImageDiff/gtk/ImageDiff.cpp
210
211 Programs_ImageDiff_CXXFLAGS = \
212    $(global_cxxflags) \
213    $(global_cppflags) \
214    $(Programs_ImageDiff_CFLAGS)
215
216 Programs_ImageDiff_CFLAGS = \
217    -fno-strict-aliasing \
218    $(global_cflags) \
219    $(GLOBALDEPS_CFLAGS) \
220    $(GTK_CFLAGS)
221
222 Programs_ImageDiff_LDADD = \
223    $(GTK_LIBS)
224
225 Programs_ImageDiff_LDFLAGS = \
226    -no-fast-install \
227    -no-install
228
229 # clean target
230 CLEANFILES += \
231         Programs/DumpRenderTree \
232         Programs/GtkLauncher \
233         Programs/ImageDiff
234
235 if TARGET_X11
236
237 # Build TestNetscapePlugin only for X11
238 # since we don't support plugins for non-X11 builds at the moment.
239 noinst_LTLIBRARIES += \
240         TestNetscapePlugin/libtestnetscapeplugin.la
241
242 TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS = \
243         -I$(srcdir)/Tools/DumpRenderTree \
244         -I$(srcdir)/Source/WebCore \
245         -I$(srcdir)/Source/WebCore/bridge \
246         -I$(srcdir)/Source/WebCore/plugins \
247         -I$(srcdir)/Tools/DumpRenderTree/TestNetscapePlugIn \
248         -I$(srcdir)/Tools/DumpRenderTree/TestNetscapePlugIn/unix/ForwardingHeaders \
249         $(global_cppflags) \
250         $(javascriptcore_cppflags)
251
252 # For the Gtk port we want to use XP_UNIX both on X11 and Mac
253 if !TARGET_WIN32
254 TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS += -DXP_UNIX
255 endif
256
257 # Add MOZ_X11 only for X11 targets
258 if TARGET_X11
259 TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS += -DMOZ_X11
260 endif
261
262 TestNetscapePlugin_libtestnetscapeplugin_la_SOURCES = \
263         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp \
264         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp \
265         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/FormValue.cpp \
266         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp \
267         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLWithJavaScriptURL.cpp \
268         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp \
269         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp \
270         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPDeallocateCalledBeforeNPShutdown.cpp \
271         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPPNewFails.cpp \
272         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPPSetWindowCalledDuringDestruction.cpp \
273     Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp \
274         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
275         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp \
276         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp \
277         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp \
278         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp \
279         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PrivateBrowsing.cpp \
280         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp \
281         Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp \
282         Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h \
283         Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp \
284         Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h \
285         Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp \
286         Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.h \
287         Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp \
288         Tools/DumpRenderTree/TestNetscapePlugIn/unix/ForwardingHeaders/WebKit/npapi.h \
289         Tools/DumpRenderTree/TestNetscapePlugIn/unix/ForwardingHeaders/WebKit/npfunctions.h \
290         Tools/DumpRenderTree/TestNetscapePlugIn/unix/ForwardingHeaders/WebKit/npruntime.h
291
292 TestNetscapePlugin_libtestnetscapeplugin_la_LDFLAGS = \
293         -rpath ${shell pwd}/$(top_builddir)/../unix/TestNetscapePlugin/.libs \
294         $(no_undefined) \
295         -avoid-version \
296         -module
297
298 CLEANFILES += TestNetscapePlugin/libtestnetscapeplugin.la
299 endif
300
301 check-local:
302         $(top_srcdir)/Tools/Scripts/run-gtk-tests --timeout=-1
303
304 EXTRA_DIST += \
305         Tools/gtk/common.py \
306         Tools/gtk/generate-feature-defines-files \
307         Tools/gtk/generate-gtkdoc \
308         Tools/gtk/gtkdoc.py \
309         Tools/jhbuild/jhbuildutils.py \
310         Tools/Scripts/VCSUtils.pm \
311         Tools/Scripts/run-gtk-tests \
312         Tools/Scripts/webkit-build-directory \
313         Tools/Scripts/webkitdirs.pm
314
315 docs: docs-build.stamp
316 .PHONY : docs
317 DISTCLEANFILES += docs-build.stamp
318
319 docs_build_stamp_list = \
320         Source/WebKit/gtk/docs/webkitenvironment.xml
321
322 if ENABLE_WEBKIT1
323 docs_build_stamp_list += \
324         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
325         Source/WebKit/gtk/docs/webkitgtk-docs.sgml \
326         Source/WebKit/gtk/docs/webkitgtk-sections.txt
327 endif
328
329 if ENABLE_WEBKIT2
330 docs_build_stamp_list += \
331         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
332         Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
333         Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
334 endif
335
336 docs-build.stamp: $(doc_build_stamp_list)
337         CC=$(CC) $(srcdir)/Tools/gtk/generate-gtkdoc
338         @touch docs-build.stamp
339
340 clean-local: doc-clean-local
341 doc-clean-local:
342         @rm -f Documentation/webkitgtk/*~ Documentation/webkitgtk*.bak
343         @rm -f Documentation/webkit2gtk/*~ Documentation/webkit2gtk*.bak
344 distclean-local: doc-distclean-local
345 doc-distclean-local:
346         @rm -rf Documentation
347 maintainer-clean-local: doc-maintainer-clean-local
348 doc-maintainer-clean-local: clean
349         @rm -rf Documentation/webkitgtk Documentation/webkit2gtk
350         -@rmdir Documentation
351
352 install-data-local:
353 if ENABLE_WEBKIT1
354         @installfiles=`echo ./Documentation/webkitgtk/html/*`; \
355         if test "$$installfiles" = './Documentation/webkitgtk/html/*'; \
356         then echo 1>&2 'No documentation to install' ; \
357         else \
358           DOC_MODULE_VERSION=`cat ./Documentation/webkitgtk/version.xml`; \
359           if test -n "$(DOC_MODULE_VERSION)"; then \
360             installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk-$(DOC_MODULE_VERSION)"; \
361           else \
362             installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk"; \
363           fi; \
364           $(mkinstalldirs) $${installdir} ; \
365           for i in $$installfiles; do \
366             echo ' $(INSTALL_DATA) '$$i ; \
367             $(INSTALL_DATA) $$i $${installdir}; \
368           done; \
369           if test -n "$(DOC_MODULE_VERSION)"; then \
370             mv -f $${installdir}/webkitgtk.devhelp2 \
371               $${installdir}/webkitgtk-$(DOC_MODULE_VERSION).devhelp2; \
372           fi; \
373         fi
374 endif
375 if ENABLE_WEBKIT2
376         @installfiles=`echo ./Documentation/webkit2gtk/html/*`; \
377         if test "$$installfiles" = './Documentation/webkit2gtk/html/*'; \
378         then echo 1>&2 'No documentation to install' ; \
379         else \
380           DOC_MODULE_VERSION=`cat ./Documentation/webkit2gtk/version.xml`; \
381           if test -n "$(DOC_MODULE_VERSION)"; then \
382             installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk-$(DOC_MODULE_VERSION)"; \
383           else \
384             installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk"; \
385           fi; \
386           $(mkinstalldirs) $${installdir} ; \
387           for i in $$installfiles; do \
388             echo ' $(INSTALL_DATA) '$$i ; \
389             $(INSTALL_DATA) $$i $${installdir}; \
390           done; \
391           if test -n "$(DOC_MODULE_VERSION)"; then \
392             mv -f $${installdir}/webkit2gtk.devhelp2 \
393               $${installdir}/webkit2gtk-$(DOC_MODULE_VERSION).devhelp2; \
394           fi; \
395         fi
396 endif
397         @$(AM_V_GEN)$(PYTHON) $(srcdir)/Tools/gtk/generate-gtkdoc --rebase --virtual-root=$${DESTDIR}
398
399 uninstall-local:
400 if ENABLE_WEBKIT1
401         @DOC_MODULE_VERSION=`cat ./Documentation/webkitgtk/version.xml`; \
402         if test -n "$(DOC_MODULE_VERSION)"; then \
403           installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk-$(DOC_MODULE_VERSION)"; \
404         else \
405           installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk"; \
406         fi; \
407         rm -rf $${installdir}
408 endif
409 if ENABLE_WEBKIT2
410         @DOC_MODULE_VERSION=`cat ./Documentation/webkit2gtk/version.xml`; \
411         if test -n "$(DOC_MODULE_VERSION)"; then \
412           installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk-$(DOC_MODULE_VERSION)"; \
413         else \
414           installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk"; \
415         fi; \
416         rm -rf $${installdir}
417 endif
418
419 if ENABLE_GTK_DOC
420 all: docs-build.stamp
421 endif
422