63bcfb2a5f35261d1f83fc2defb822e279ec942a
[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/cairo \
110         -I$(srcdir)/Tools/DumpRenderTree/gtk \
111         -I$(srcdir)/Source/WebKit/gtk \
112         -I$(srcdir)/Source/WebCore/platform/gtk \
113         -I$(srcdir)/Source/WebCore/testing/js \
114         -I$(top_builddir)/DerivedSources \
115         -I$(top_builddir)/Source/WebKit/gtk \
116         $(javascriptcore_cppflags) \
117         $(webcore_cppflags)
118
119 if TARGET_X11
120 Programs_DumpRenderTree_CPPFLAGS += \
121         -DTEST_PLUGIN_DIR=\"${shell pwd}/${top_builddir}/TestNetscapePlugin/.libs\" \
122         -DFONTS_CONF_DIR=\"${shell pwd}/${srcdir}/Tools/DumpRenderTree/gtk/fonts\"
123 endif
124
125 Programs_DumpRenderTree_SOURCES = \
126         Tools/DumpRenderTree/DumpRenderTree.h \
127         Tools/DumpRenderTree/DumpRenderTreeCommon.cpp \
128         Tools/DumpRenderTree/DumpRenderTreePrefix.h \
129         Tools/DumpRenderTree/AccessibilityController.cpp \
130         Tools/DumpRenderTree/AccessibilityController.h \
131         Tools/DumpRenderTree/AccessibilityTextMarker.cpp \
132         Tools/DumpRenderTree/AccessibilityTextMarker.h \
133         Tools/DumpRenderTree/AccessibilityUIElement.cpp \
134         Tools/DumpRenderTree/AccessibilityUIElement.h \
135         Tools/DumpRenderTree/CyclicRedundancyCheck.cpp \
136         Tools/DumpRenderTree/CyclicRedundancyCheck.h \
137         Tools/DumpRenderTree/GCController.cpp \
138         Tools/DumpRenderTree/GCController.h \
139         Tools/DumpRenderTree/JavaScriptThreading.h \
140         Tools/DumpRenderTree/TestRunner.cpp \
141         Tools/DumpRenderTree/TestRunner.h \
142         Tools/DumpRenderTree/PixelDumpSupport.cpp \
143         Tools/DumpRenderTree/PixelDumpSupport.h \
144         Tools/DumpRenderTree/WorkQueue.cpp \
145         Tools/DumpRenderTree/WorkQueue.h \
146         Tools/DumpRenderTree/WorkQueueItem.h \
147         Tools/DumpRenderTree/config.h \
148         Tools/DumpRenderTree/cairo/PixelDumpSupportCairo.cpp \
149         Tools/DumpRenderTree/cairo/PixelDumpSupportCairo.h \
150         Tools/DumpRenderTree/gtk/AccessibilityCallbacks.h \
151         Tools/DumpRenderTree/gtk/AccessibilityCallbacks.cpp \
152         Tools/DumpRenderTree/gtk/AccessibilityControllerGtk.cpp \
153         Tools/DumpRenderTree/gtk/AccessibilityUIElementGtk.cpp \
154         Tools/DumpRenderTree/gtk/DumpRenderTree.cpp \
155         Tools/DumpRenderTree/gtk/DumpRenderTreeGtk.h \
156         Tools/DumpRenderTree/gtk/EditingCallbacks.h \
157         Tools/DumpRenderTree/gtk/EditingCallbacks.cpp \
158         Tools/DumpRenderTree/gtk/EventSender.h \
159         Tools/DumpRenderTree/gtk/EventSender.cpp \
160         Tools/DumpRenderTree/gtk/GCControllerGtk.cpp \
161         Tools/DumpRenderTree/gtk/TestRunnerGtk.cpp \
162         Tools/DumpRenderTree/gtk/PixelDumpSupportGtk.cpp \
163         Tools/DumpRenderTree/gtk/SelfScrollingWebKitWebView.cpp \
164         Tools/DumpRenderTree/gtk/SelfScrollingWebKitWebView.h \
165         Tools/DumpRenderTree/gtk/TextInputController.h \
166         Tools/DumpRenderTree/gtk/TextInputController.cpp \
167         Tools/DumpRenderTree/gtk/WorkQueueItemGtk.cpp \
168         Source/WebCore/platform/gtk/GtkVersioning.c
169
170 Programs_DumpRenderTree_CXXFLAGS = \
171         $(global_cxxflags) \
172         $(Programs_DumpRenderTree_CFLAGS)
173
174 Programs_DumpRenderTree_CFLAGS = \
175         -fno-strict-aliasing \
176         $(global_cflags) \
177         $(GLOBALDEPS_CFLAGS) \
178         $(CAIRO_CFLAGS) \
179         $(GTK_CFLAGS) \
180         $(LIBSOUP_CFLAGS)
181
182 Programs_DumpRenderTree_LDADD = \
183         libjavascriptcoregtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
184         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
185         libWebCorePlatform.la \
186         libWebCoreModules.la \
187         libWebCoreInternals.la \
188         $(GLOBALDEPS_LIBS) \
189         $(CAIRO_LIBS) \
190         $(GTK_LIBS) \
191         $(GLIB_LIBS) \
192         $(LIBSOUP_LIBS) \
193         $(FREETYPE_LIBS) \
194         $(WINMM_LIBS) \
195         $(XRENDER_LIBS) \
196         $(XT_LIBS)
197
198 Programs_DumpRenderTree_LDFLAGS = \
199         -no-fast-install \
200         -no-install
201
202 # ImageDiff
203 Programs_ImageDiff_CPPFLAGS = $(global_cppflags)
204
205 Programs_ImageDiff_SOURCES = \
206    Tools/ImageDiff/gtk/ImageDiff.cpp
207
208 Programs_ImageDiff_CXXFLAGS = \
209    $(global_cxxflags) \
210    $(global_cppflags) \
211    $(Programs_ImageDiff_CFLAGS)
212
213 Programs_ImageDiff_CFLAGS = \
214    -fno-strict-aliasing \
215    $(global_cflags) \
216    $(GLOBALDEPS_CFLAGS) \
217    $(GTK_CFLAGS)
218
219 Programs_ImageDiff_LDADD = \
220    $(GTK_LIBS)
221
222 Programs_ImageDiff_LDFLAGS = \
223    -no-fast-install \
224    -no-install
225
226 # clean target
227 CLEANFILES += \
228         Programs/DumpRenderTree \
229         Programs/GtkLauncher \
230         Programs/ImageDiff
231
232 if TARGET_X11
233
234 # Build TestNetscapePlugin only for X11
235 # since we don't support plugins for non-X11 builds at the moment.
236 noinst_LTLIBRARIES += \
237         TestNetscapePlugin/libtestnetscapeplugin.la
238
239 TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS = \
240         -I$(srcdir)/Tools/DumpRenderTree \
241         -I$(srcdir)/Source/WebCore \
242         -I$(srcdir)/Source/WebCore/bridge \
243         -I$(srcdir)/Source/WebCore/plugins \
244         -I$(srcdir)/Tools/DumpRenderTree/TestNetscapePlugIn \
245         -I$(srcdir)/Tools/DumpRenderTree/TestNetscapePlugIn/unix/ForwardingHeaders \
246         $(global_cppflags) \
247         $(javascriptcore_cppflags)
248
249 # For the Gtk port we want to use XP_UNIX both on X11 and Mac
250 if !TARGET_WIN32
251 TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS += -DXP_UNIX
252 endif
253
254 # Add MOZ_X11 only for X11 targets
255 if TARGET_X11
256 TestNetscapePlugin_libtestnetscapeplugin_la_CPPFLAGS += -DMOZ_X11
257 endif
258
259 TestNetscapePlugin_libtestnetscapeplugin_la_SOURCES = \
260         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/DocumentOpenInDestroyStream.cpp \
261         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/EvaluateJSAfterRemovingPluginElement.cpp \
262         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/FormValue.cpp \
263         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp \
264         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLWithJavaScriptURL.cpp \
265         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp \
266         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp \
267         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPDeallocateCalledBeforeNPShutdown.cpp \
268         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPPNewFails.cpp \
269         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPPSetWindowCalledDuringDestruction.cpp \
270     Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeCallsWithNullNPP.cpp \
271         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp \
272         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NPRuntimeRemoveProperty.cpp \
273         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/NullNPPGetValuePointer.cpp \
274         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PassDifferentNPPStruct.cpp \
275         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PluginScriptableNPObjectInvokeDefault.cpp \
276         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/PrivateBrowsing.cpp \
277         Tools/DumpRenderTree/TestNetscapePlugIn/Tests/x11/CallInvalidateRectWithNullNPPArgument.cpp \
278         Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.cpp \
279         Tools/DumpRenderTree/TestNetscapePlugIn/PluginTest.h \
280         Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.cpp \
281         Tools/DumpRenderTree/TestNetscapePlugIn/PluginObject.h \
282         Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.cpp \
283         Tools/DumpRenderTree/TestNetscapePlugIn/TestObject.h \
284         Tools/DumpRenderTree/TestNetscapePlugIn/main.cpp \
285         Tools/DumpRenderTree/TestNetscapePlugIn/unix/ForwardingHeaders/WebKit/npapi.h \
286         Tools/DumpRenderTree/TestNetscapePlugIn/unix/ForwardingHeaders/WebKit/npfunctions.h \
287         Tools/DumpRenderTree/TestNetscapePlugIn/unix/ForwardingHeaders/WebKit/npruntime.h
288
289 TestNetscapePlugin_libtestnetscapeplugin_la_LDFLAGS = \
290         -rpath ${shell pwd}/$(top_builddir)/../unix/TestNetscapePlugin/.libs \
291         $(no_undefined) \
292         -avoid-version \
293         -module
294
295 CLEANFILES += TestNetscapePlugin/libtestnetscapeplugin.la
296 endif
297
298 check-local:
299         $(top_srcdir)/Tools/Scripts/run-gtk-tests --timeout=-1
300
301 EXTRA_DIST += \
302         Tools/gtk/common.py \
303         Tools/gtk/generate-gtkdoc \
304         Tools/gtk/gtkdoc.py \
305         Tools/jhbuild/jhbuildutils.py \
306         Tools/Scripts/VCSUtils.pm \
307         Tools/Scripts/run-gtk-tests \
308         Tools/Scripts/webkit-build-directory \
309         Tools/Scripts/webkitdirs.pm
310
311 docs: docs-build.stamp
312 .PHONY : docs
313 DISTCLEANFILES += docs-build.stamp
314
315 if ENABLE_WEBKIT2
316 docs-build.stamp: \
317         Source/WebKit/gtk/docs/webkitenvironment.xml \
318         Source/WebKit/gtk/docs/webkitgtk-docs.sgml \
319         Source/WebKit/gtk/docs/webkitgtk-sections.txt \
320         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
321         libwebkit2gtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
322         Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-docs.sgml \
323         Source/WebKit2/UIProcess/API/gtk/docs/webkit2gtk-sections.txt
324         CC=$(CC) $(srcdir)/Tools/gtk/generate-gtkdoc
325         @touch docs-build.stamp
326 else
327 docs-build.stamp: \
328         libwebkitgtk-@WEBKITGTK_API_MAJOR_VERSION@.@WEBKITGTK_API_MINOR_VERSION@.la \
329         Source/WebKit/gtk/docs/webkitenvironment.xml \
330         Source/WebKit/gtk/docs/webkitgtk-docs.sgml \
331         Source/WebKit/gtk/docs/webkitgtk-sections.txt
332         CC=$(CC) $(srcdir)/Tools/gtk/generate-gtkdoc
333         @touch docs-build.stamp
334 endif
335
336 clean-local: doc-clean-local
337 doc-clean-local:
338         @rm -f Documentation/webkitgtk/*~ Documentation/webkitgtk*.bak
339         @rm -f Documentation/webkit2gtk/*~ Documentation/webkit2gtk*.bak
340 distclean-local: doc-distclean-local
341 doc-distclean-local:
342         @rm -rf Documentation
343 maintainer-clean-local: doc-maintainer-clean-local
344 doc-maintainer-clean-local: clean
345         @rm -rf Documentation/webkitgtk Documentation/webkit2gtk
346         -@rmdir Documentation
347
348 install-data-local:
349 if ENABLE_WEBKIT1
350         @installfiles=`echo ./Documentation/webkitgtk/html/*`; \
351         if test "$$installfiles" = './Documentation/webkitgtk/html/*'; \
352         then echo 1>&2 'No documentation to install' ; \
353         else \
354           DOC_MODULE_VERSION=`cat ./Documentation/webkitgtk/version.xml`; \
355           if test -n "$(DOC_MODULE_VERSION)"; then \
356             installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk-$(DOC_MODULE_VERSION)"; \
357           else \
358             installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk"; \
359           fi; \
360           $(mkinstalldirs) $${installdir} ; \
361           for i in $$installfiles; do \
362             echo ' $(INSTALL_DATA) '$$i ; \
363             $(INSTALL_DATA) $$i $${installdir}; \
364           done; \
365           if test -n "$(DOC_MODULE_VERSION)"; then \
366             mv -f $${installdir}/webkitgtk.devhelp2 \
367               $${installdir}/webkitgtk-$(DOC_MODULE_VERSION).devhelp2; \
368           fi; \
369         fi
370 endif
371 if ENABLE_WEBKIT2
372         @installfiles=`echo ./Documentation/webkit2gtk/html/*`; \
373         if test "$$installfiles" = './Documentation/webkit2gtk/html/*'; \
374         then echo 1>&2 'No documentation to install' ; \
375         else \
376           DOC_MODULE_VERSION=`cat ./Documentation/webkit2gtk/version.xml`; \
377           if test -n "$(DOC_MODULE_VERSION)"; then \
378             installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk-$(DOC_MODULE_VERSION)"; \
379           else \
380             installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk"; \
381           fi; \
382           $(mkinstalldirs) $${installdir} ; \
383           for i in $$installfiles; do \
384             echo ' $(INSTALL_DATA) '$$i ; \
385             $(INSTALL_DATA) $$i $${installdir}; \
386           done; \
387           if test -n "$(DOC_MODULE_VERSION)"; then \
388             mv -f $${installdir}/webkit2gtk.devhelp2 \
389               $${installdir}/webkit2gtk-$(DOC_MODULE_VERSION).devhelp2; \
390           fi; \
391         fi
392 endif
393         @$(AM_V_GEN)$(PYTHON) $(srcdir)/Tools/gtk/generate-gtkdoc --rebase --virtual-root=$${DESTDIR}
394
395 uninstall-local:
396 if ENABLE_WEBKIT1
397         @DOC_MODULE_VERSION=`cat ./Documentation/webkitgtk/version.xml`; \
398         if test -n "$(DOC_MODULE_VERSION)"; then \
399           installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk-$(DOC_MODULE_VERSION)"; \
400         else \
401           installdir="$(DESTDIR)$(HTML_DIR)/webkitgtk"; \
402         fi; \
403         rm -rf $${installdir}
404 endif
405 if ENABLE_WEBKIT2
406         @DOC_MODULE_VERSION=`cat ./Documentation/webkit2gtk/version.xml`; \
407         if test -n "$(DOC_MODULE_VERSION)"; then \
408           installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk-$(DOC_MODULE_VERSION)"; \
409         else \
410           installdir="$(DESTDIR)$(HTML_DIR)/webkit2gtk"; \
411         fi; \
412         rm -rf $${installdir}
413 endif
414
415 if ENABLE_GTK_DOC
416 all: docs-build.stamp
417 endif
418