summaryrefslogtreecommitdiffstats
path: root/qemu/roms/openbios/config/xml/dictionary.xsl
diff options
context:
space:
mode:
authorYang Zhang <yang.z.zhang@intel.com>2015-08-28 09:58:54 +0800
committerYang Zhang <yang.z.zhang@intel.com>2015-09-01 12:44:00 +0800
commite44e3482bdb4d0ebde2d8b41830ac2cdb07948fb (patch)
tree66b09f592c55df2878107a468a91d21506104d3f /qemu/roms/openbios/config/xml/dictionary.xsl
parent9ca8dbcc65cfc63d6f5ef3312a33184e1d726e00 (diff)
Add qemu 2.4.0
Change-Id: Ic99cbad4b61f8b127b7dc74d04576c0bcbaaf4f5 Signed-off-by: Yang Zhang <yang.z.zhang@intel.com>
Diffstat (limited to 'qemu/roms/openbios/config/xml/dictionary.xsl')
-rw-r--r--qemu/roms/openbios/config/xml/dictionary.xsl195
1 files changed, 195 insertions, 0 deletions
diff --git a/qemu/roms/openbios/config/xml/dictionary.xsl b/qemu/roms/openbios/config/xml/dictionary.xsl
new file mode 100644
index 000000000..61f62d84c
--- /dev/null
+++ b/qemu/roms/openbios/config/xml/dictionary.xsl
@@ -0,0 +1,195 @@
+<?xml version="1.0" encoding="ISO-8859-15" ?>
+
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
+
+ <xsl:template match="/" mode="dictionaries">
+
+ <xsl:text>&#10;#&#10;# dictionary rules&#10;#&#10;&#10;</xsl:text>
+
+ <!-- Set all dictionary source lists empty -->
+ <xsl:for-each select="//dictionary">
+ <xsl:sort select="@name"/>
+
+ <xsl:variable name="conditions">
+ <xsl:text>0</xsl:text>
+ <xsl:for-each select="(ancestor-or-self::*)[@condition!='']">
+ <xsl:call-template name="resolve-condition">
+ <xsl:with-param select="@condition" name="expression"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:if test="$conditions = 0">
+
+ <xsl:if test="not(preceding::dictionary/@name = @name)">
+ <xsl:value-of select="@name"/>
+ <xsl:text>-DICTIONARY :=&#10;</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+
+ <!-- Add all forth source files to their dictionaries -->
+ <xsl:for-each select="//dictionary/object">
+
+ <xsl:variable name="path">
+ <xsl:for-each select="ancestor::build">
+ <xsl:call-template name="get-dirname">
+ <xsl:with-param select="@base" name="path"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:variable name="conditions">
+ <xsl:text>0</xsl:text>
+ <xsl:for-each select="(ancestor-or-self::*)[@condition!='']">
+ <xsl:call-template name="resolve-condition">
+ <xsl:with-param select="@condition" name="expression"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:variable name="dictname">
+ <xsl:value-of select="parent::*/@name"/>
+ </xsl:variable>
+
+ <xsl:if test="$conditions=0">
+
+ <xsl:variable name="source"><xsl:value-of select="@source" /></xsl:variable>
+
+ <!-- Handle just Forth source, not FCode -->
+ <xsl:if test="not(@target = 'fcode')">
+ <xsl:value-of select="$dictname"/><xsl:text>-DICTIONARY:=$(</xsl:text>
+ <xsl:value-of select="$dictname"/><xsl:text>-DICTIONARY) </xsl:text>
+
+ <xsl:value-of select="$path"/>
+ <xsl:value-of select="$source"/>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:if>
+
+ </xsl:if>
+ </xsl:for-each>
+
+ <xsl:text>&#10;&#10;</xsl:text>
+
+ <!-- Create targets for all dictionaries -->
+ <xsl:for-each select="//dictionary">
+ <xsl:sort select="@name"/>
+
+ <xsl:variable name="outer-conditions">
+ <xsl:text>0</xsl:text>
+ <xsl:for-each select="(ancestor-or-self::*)[@condition!='']">
+ <xsl:call-template name="resolve-condition">
+ <xsl:with-param select="@condition" name="expression"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:if test="$outer-conditions = 0">
+
+ <xsl:if test="not(preceding::dictionary/@name = @name)">
+ <xsl:variable name="name"><xsl:value-of select="@name"/></xsl:variable>
+ <xsl:variable name="init">
+ <xsl:value-of select="(//dictionary[@name=$name]/attribute::init)[last()]"/>
+ </xsl:variable>
+ <!-- dictionary name and dependencies -->
+ <xsl:text>$(ODIR)/</xsl:text>
+ <xsl:value-of select="@name"/><xsl:text>.dict: $(</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>-DICTIONARY) $(ODIR)/forthstrap</xsl:text>
+ <xsl:if test="$init!=''">
+ <xsl:text> $(ODIR)/</xsl:text><xsl:value-of select="$init"/><xsl:text>.dict</xsl:text>
+ </xsl:if>
+
+ <!-- Check for Fcode dependency -->
+ <xsl:for-each select="object[@target = 'fcode']">
+
+ <xsl:variable name="conditions">
+ <xsl:text>0</xsl:text>
+ <xsl:for-each select="(ancestor-or-self::*)[@condition!='']">
+ <xsl:call-template name="resolve-condition">
+ <xsl:with-param select="@condition" name="expression"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:if test="$conditions = 0">
+
+ <xsl:text> $(ODIR)/</xsl:text>
+ <xsl:value-of select="@source"/>
+
+ </xsl:if>
+ </xsl:for-each>
+
+ <xsl:text>&#10;</xsl:text>
+ <!-- rule -->
+ <xsl:text>&#9;$(call quiet-command,$(ODIR)/forthstrap</xsl:text>
+ <xsl:for-each select="//dictionary[@name = @name]">
+
+ <xsl:variable name="conditions">
+ <xsl:text>0</xsl:text>
+ <xsl:for-each select="(ancestor-or-self::*)[@condition!='']">
+ <xsl:call-template name="resolve-condition">
+ <xsl:with-param select="@condition" name="expression"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:variable name="path">
+ <xsl:for-each select="ancestor::build">
+ <xsl:call-template name="get-dirname">
+ <xsl:with-param select="@base" name="path"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:if test="$conditions = 0">
+ <xsl:text> -I</xsl:text>
+ <xsl:text>$(SRCDIR)/</xsl:text>
+ <xsl:value-of select="$path"/>
+ </xsl:if>
+ </xsl:for-each>
+
+ <!-- needed to locate files with full path -->
+ <xsl:text> -I$(SRCDIR)</xsl:text>
+ <!-- needed to include config and build date -->
+ <xsl:text> -I$(ODIR)/forth</xsl:text>
+
+ <xsl:text> -D $@</xsl:text>
+ <xsl:text> -M $@.d</xsl:text>
+ <xsl:if test="$init!=''">
+ <xsl:text> -d $(ODIR)/</xsl:text><xsl:value-of select="$init"/><xsl:text>.dict</xsl:text>
+ </xsl:if>
+ <xsl:text> -c $@-console.log</xsl:text>
+ <xsl:text> $(</xsl:text>
+ <xsl:value-of select="@name"/>
+ <xsl:text>-DICTIONARY)," GEN $(TARGET_DIR)$@")&#10;&#10;</xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+
+ <!-- Create dictionaries target containing all dictionaries -->
+ <xsl:text>dictionaries: </xsl:text>
+ <xsl:for-each select="//dictionary">
+ <xsl:sort select="@name"/>
+
+ <xsl:variable name="conditions">
+ <xsl:text>0</xsl:text>
+ <xsl:for-each select="(ancestor-or-self::*)[@condition!='']">
+ <xsl:call-template name="resolve-condition">
+ <xsl:with-param select="@condition" name="expression"/>
+ </xsl:call-template>
+ </xsl:for-each>
+ </xsl:variable>
+
+ <xsl:if test="$conditions = 0">
+
+ <xsl:if test="not(preceding::dictionary/@name = @name)">
+ <xsl:text>$(ODIR)/</xsl:text>
+ <xsl:value-of select="@name"/><xsl:text>.dict </xsl:text>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+ <xsl:text>&#10;</xsl:text>
+ </xsl:template>
+
+</xsl:stylesheet>