2010-04-21 Xan Lopez <xlopez@igalia.com>
[WebKit-https.git] / WebCore / GNUmakefile.am
index 144ffa7e602d66b192c41fe48c4f3d35321a7487..93b685e94bff5708e07231b3a1ec31da4d6a2973 100644 (file)
@@ -9,9 +9,13 @@ WEBCORE_CSS_PROPERTY_NAMES := $(WebCore)/css/CSSPropertyNames.in
 WEBCORE_CSS_VALUE_KEYWORDS := $(WebCore)/css/CSSValueKeywords.in
 
 webcore_cppflags += \
+       -I$(srcdir)/WebKit/gtk \
+       -I$(srcdir)/WebKit/gtk/WebCoreSupport \
+       -I$(srcdir)/WebKit/gtk/webkit \
        -I$(srcdir)/WebCore \
        -I$(srcdir)/WebCore/accessibility \
        -I$(srcdir)/WebCore/bindings/js \
+       -I$(srcdir)/WebCore/bindings/gobject \
        -I$(srcdir)/WebCore/bridge \
        -I$(srcdir)/WebCore/bridge/c \
        -I$(srcdir)/WebCore/bridge/jni/jsc \
@@ -77,7 +81,8 @@ webcoregtk_cppflags += \
 webcore_built_nosources += \
        DerivedSources/DocTypeStrings.cpp \
        DerivedSources/tokenizer.cpp \
-       DerivedSources/ColorData.c
+       DerivedSources/ColorData.c \
+       DerivedSources/webkit/webkitdomdummy.c
 
 webcore_built_sources += \
        DerivedSources/CSSGrammar.cpp \
@@ -308,6 +313,16 @@ IDL_BINDINGS += \
        WebCore/xml/XMLSerializer.idl \
        WebCore/xml/XSLTProcessor.idl
 
+webcoregtk_dom_sources = \
+       WebCore/bindings/gobject/ConvertToUTF8String.cpp \
+       WebCore/bindings/gobject/ConvertToUTF8String.h \
+       WebCore/bindings/gobject/WebKitDOMBinding.cpp \
+       WebCore/bindings/gobject/WebKitDOMBinding.h \
+       WebCore/bindings/gobject/WebKitDOMObject.cpp \
+       WebCore/bindings/gobject/WebKitDOMObject.h
+
+webcoregtk_sources += $(webcoregtk_dom_sources)
+
 webcore_sources += \
        WebCore/WebCorePrefix.h \
         WebCore/accessibility/AXObjectCache.cpp \
@@ -3763,6 +3778,82 @@ libWebCoreJS.la: $(libWebCoreJS_objects)
        $(CXXLINK) $(libWebCoreJS_objects) $(LIBS)
 
 
+DerivedSources/webkit/webkitdomdummy.c:
+       echo > $@
+
+# Because WebCore/bindings/gobject/WebKitDOMObject.h is static source but is also a distributed header
+# required by other distributed headers (both static and auto-generated), need to move this to the
+# DerivedSources/webkit directory.  The reason is that we want all header files distributed in the
+# include/webkit-x.y/webkit directory, but do not want to name the WebCore/bindings/gobject directory 
+# "webkit", as that's a bit presumptuous for a GTK binding.
+$(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h:
+       cp -f $(WebCore)/bindings/gobject/WebKitDOMObject.h $@
+
+# Start with a subset of all the DOM bindings
+IDL_BINDINGS_GDOM := \
+       WebCore/css/CSSRule.idl \
+       WebCore/css/CSSRuleList.idl \
+       WebCore/css/CSSStyleDeclaration.idl \
+       WebCore/css/CSSStyleSheet.idl \
+       WebCore/css/CSSValue.idl \
+       WebCore/css/MediaList.idl \
+       WebCore/css/StyleSheet.idl \
+       WebCore/dom/Attr.idl \
+       WebCore/dom/Element.idl \
+       WebCore/dom/NamedNodeMap.idl \
+       WebCore/dom/Node.idl \
+       WebCore/dom/NodeList.idl
+
+# All classes autogenerated in the GObject DOM bindings
+GDOM_AUTO_CLASSES := $(basename $(notdir $(IDL_BINDINGS_GDOM)))
+
+# The classes implemented manually
+GDOM_FIXED_CLASSES := Object
+
+GDOM_CLASSES := $(GDOM_AUTO_CLASSES) $(GDOM_FIXED_CLASSES)
+
+# Filter out SVG for now
+FEATURE_DEFINES_GDOM := $(filter-out ENABLE-SVG%, $(FEATURE_DEFINES))
+
+# Autogenerated header files
+GDOM_HEADERS_BUILT := $(patsubst %,DerivedSources/webkit/WebKitDOM%.h,$(GDOM_AUTO_CLASSES)) \
+       $(top_builddir)/DerivedSources/webkit/webkitdom.h \
+       $(top_builddir)/DerivedSources/webkit/webkitdomdefines.h \
+       $(top_builddir)/DerivedSources/webkit/WebKitDOMObject.h
+
+# Autogenerated source files
+GDOM_SOURCES_BUILT := $(patsubst %,DerivedSources/webkit/WebKitDOM%.cpp,$(GDOM_AUTO_CLASSES))
+
+# Hand-coded header files
+GDOM_HEADERS_FIXED := $(patsubst %,$(srcdir)/WebCore/bindings/gobject/WebKitDOM%.h,$(GDOM_FIXED_CLASSES))
+
+# All header files that get installed
+libgdom_h_api := $(GDOM_HEADERS_FIXED) $(GDOM_HEADERS_BUILT)
+
+DerivedSources/webkit/webkitdom.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl
+       echo $(GDOM_CLASSES) | $(PERL) $< gdom > $@
+
+DerivedSources/webkit/webkitdomdefines.h: $(WebCore)/bindings/scripts/gobject-generate-headers.pl $(IDL_BINDINGS_GDOM) $(WebCore)/GNUmakefile.am
+       echo $(GDOM_CLASSES) | $(PERL) $< defines > $@
+
+DerivedSources/webkit/WebKitDOM%.h: DerivedSources/webkit/WebKitDOM%.cpp;
+
+DerivedSources/webkit/WebKitDOM%.cpp: %.idl $(SCRIPTS_BINDINGS) $(WebCore)/bindings/scripts/CodeGeneratorGObject.pm $(webcoregtk_dom_sources)
+       $(AM_V_GEN)$(PERL) -I$(WebCore)/bindings/scripts $(WebCore)/bindings/scripts/generate-bindings.pl --include $(WebCore)/dom --include $(WebCore)/html --include $(WebCore)/css --include $(WebCore)/page --include $(WebCore)/xml --include $(WebCore)/svg --outputDir "$(GENSOURCESWEBKITDOM)" --defines "LANGUAGE_GOBJECT=1 $(FEATURE_DEFINES_GDOM)" --generator GObject $<
+
+gdom_built_nosources := $(GDOM_HEADERS_BUILT) $(GDOM_SOURCES_BUILT)
+
+libgdom_objects := $(subst .cpp,.lo,$(GDOM_SOURCES_BUILT))
+
+-include WebCore/bindings/gobject/$(DEPDIR)/%.Plo
+-include DerivedSources/webkit/$(DEPDIR)/%.Plo
+
+$(libgdom_objects): AM_CPPFLAGS+=$(libwebkit_1_0_la_CPPFLAGS)
+$(libgdom_objects): AM_CXXFLAGS+=$(libwebkit_1_0_la_CXXFLAGS)
+
+libgdom.la: $(libgdom_objects)
+       $(CXXLINK) $(libgdom_objects) $(LIBS)
+
 noinst_HEADERS += \
        $(IDL_BINDINGS)
 
@@ -3778,6 +3869,7 @@ webcore_dist += \
        WebCore/bindings/scripts/InFilesParser.pm \
        WebCore/bindings/scripts/generate-bindings.pl \
        WebCore/bindings/scripts/CodeGeneratorJS.pm \
+       WebCore/bindings/scripts/CodeGeneratorGObject.pm \
        WebCore/css/html.css \
        WebCore/css/mathml.css \
        WebCore/css/quirks.css \