]> granicus.if.org Git - docbook-dsssl/commitdiff
Checkin new build system
authorNorman Walsh <ndw@nwalsh.com>
Wed, 6 Jul 2005 20:18:00 +0000 (20:18 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Wed, 6 Jul 2005 20:18:00 +0000 (20:18 +0000)
docbook/relaxng/docbook/.cvsignore
docbook/relaxng/docbook/Makefile
docbook/relaxng/docbook/_footer.mak [new file with mode: 0644]
docbook/relaxng/docbook/_header.mak [new file with mode: 0644]
docbook/relaxng/docbook/dbforms/Makefile [new file with mode: 0644]
docbook/relaxng/docbook/dbforms/dbforms.rnc [new file with mode: 0644]
docbook/relaxng/docbook/dbforms/htmlform.rnc [new file with mode: 0644]
docbook/relaxng/docbook/docbook/Makefile [new file with mode: 0644]
docbook/relaxng/docbook/docbook/docbook.rnc [new file with mode: 0644]

index 505ab988767b1eb934e006721704a92cf2925a0f..8e1844962e73beeec1ecf92634ccf79c54d0f5e8 100644 (file)
@@ -5,3 +5,4 @@ docbook.rng
 dbforms.dtd
 dbforms.rnc
 dbforms.rng
+build
index 6eaab64040179aa0dd79b97f0de3a08a51e8442b..a0787a1e8fc43ba2689c61017c53c70739b1dde7 100644 (file)
@@ -1,59 +1,33 @@
-include ../../../cvstools/Makefile.incl
-VPATH=src
-
-.SUFFIXES: .rnc .rng .rnx .dtx .dtd
-.PHONY: tests html
-
-RNCFILES=$(wildcard $(VPATH)/*.rnc)
-TOOLS=../tools
-XSLTPROC=xsltproc
+# Inspired by "Recursive Make: Reloaded" in the July, 2005 issue
+# of Linux Magazine, I've reworked the Makfiles so that they're no
+# longer recursive.
 
-all: docbook.rng docbook.dtd dbforms.rng dbforms.dtd
+# Fair warning, this is a bit more complex than is maybe ideal, but it
+# works and it isn't recursive. I still need to get the documentation
+# build into the new system.
 
-# ============================================================
-#
-# N.B. We need an explicit dependency on src/*.rnc for each *.rng
-#      file because the build process produces an *output* RNC file
-#      in the current directory and that's not the one we want to
-#      depend on.
-#
-#      That's also the reason for the curious sleep/touch pattern
-#      in the build rules. We want to make sure that the output RNC
-#      file is older than the output RNG file so that make doesn't
-#      always think it needs to rebuild the RNG file.
-#
-#      If we could take "." out of VPATH, we wouldn't need to do this.
-
-docbook.rng: $(RNCFILES)
-dbforms.rng: $(RNCFILES)
+include ../../../cvstools/Makefile.incl
 
-.rnc.rng:
-       $(MAKE) -C build $@
-       cp build/$@ .
-       $(RUNTRANG) $@ docbook.rnc
-       sleep 2
-       touch $@
+XSLTPROC=xsltproc
+PERL=perl
 
-.rng.rnx:
-       $(XSLTPROC) -output $@ $(TOOLS)/rngdocxml.xsl $<
+TOOLS=../tools
+AUGMENT=$(TOOLS)/augment.xsl
+INCLUDE=$(TOOLS)/include.xsl
+CLEANUP=$(TOOLS)/cleanup.pl
 
-.rnx.dtx:
-       $(XSLTPROC) -output $@ $(TOOLS)/doc2dtd.xsl $<
+.PHONY: all
 
-.dtx.dtd:
-       $(XSLTPROC) -output $@ $(TOOLS)/xml2dtd.xsl $<
+all::
+_OUTTOP ?= .
+_OUTTOP := $(_OUTTOP)/build
 
-# ============================================================
+.PHONY: clean
 
-tests:
-       mkdir -p tests tests/passed
-       cd tests && ../$(TOOLS)/runtests
+clean:: ; @rm -rf $(_OUTTOP)
 
-# ============================================================
+.SUFFIXES:
 
-clean:
-       $(RM) docbook*
-       $(RM) dbforms*
-       $(MAKE) -C build clean
+MODULES=docbook dbforms
 
-# EOF
+include $(addsuffix /Makefile,$(MODULES))
diff --git a/docbook/relaxng/docbook/_footer.mak b/docbook/relaxng/docbook/_footer.mak
new file mode 100644 (file)
index 0000000..b37c73f
--- /dev/null
@@ -0,0 +1,43 @@
+# -*- Makefile -*-
+
+$(_MODULE)_OBJS := $(addsuffix .rng,$(addprefix $($(_MODULE)_OUTPUT)/,$(basename $(SRCS))))
+
+$(_MODULE)_BINARY := $($(_MODULE)_OUTPUT)/$(BINARY)
+
+.PRECIOUS: $($(_MODULE)_OBJS)
+
+$($(_MODULE)_OUTPUT)/%.rng: $(_MODULE)/%.rnc $($(_MODULE)_OUTPUT)/.f
+       $(RUNTRANG) $< $@
+
+$($(_MODULE)_OUTPUT)/%.rne: $($(_MODULE)_OBJS) $($(_MODULE)_OUTPUT)/.f
+       $(XSLT) $< $(INCLUDE) $@, use.extensions=1
+       $(XSLT) $@, $(AUGMENT) $@ use.extensions=1
+       $(PERL) -i $(CLEANUP) $@
+       $(RM) $@,
+
+
+#$($(_MODULE)_OUTPUT)/%.rng: $(_MODULE)/%.rnc $($(_MODULE)_OUTPUT)/.f
+#      $(RUNTRANG) $< $@
+#
+#$($(_MODULE)_OUTPUT)/%.rng: $($(_MODULE)_OBJS) $($(_MODULE)_OUTPUT)/.f
+#      @echo build $< $@
+#      $(XSLT) $< $(INCLUDE) $@, use.extensions=1
+#      $(XSLT) $@, $(AUGMENT) $@ use.extensions=1
+#      $(PERL) -i $(CLEANUP) $@
+#      $(RM) $@,
+
+$($(_MODULE)_OUTPUT)/%.rnx: $($(_MODULE)_OUTPUT)/%.rne
+       $(XSLT) $< $(INCLUDE) $@, use.extensions=1
+       $(XSLT) $@, $(AUGMENT) $@ use.extensions=1
+       $(PERL) -i $(CLEANUP) $@
+       $(RM) $@,
+
+$($(_MODULE)_OUTPUT)/%.rnd: $($(_MODULE)_OUTPUT)/%.rnx
+       $(XSLTPROC) -output $@ $(TOOLS)/rngdocxml.xsl $<
+
+$($(_MODULE)_OUTPUT)/%.dtx: $($(_MODULE)_OUTPUT)/%.rnd
+       $(XSLTPROC) -output $@ $(TOOLS)/doc2dtd.xsl $<
+
+all:: $($(_MODULE)_BINARY)
+
+$(_MODULE): $($(_MODULE)_BINARY)
diff --git a/docbook/relaxng/docbook/_header.mak b/docbook/relaxng/docbook/_header.mak
new file mode 100644 (file)
index 0000000..9ec1b64
--- /dev/null
@@ -0,0 +1,12 @@
+# -*- Makefile -*-
+
+_MAKEFILES := $(filter-out _header.mak _footer.mak,$(MAKEFILE_LIST))
+
+_MODULE := $(patsubst %/,%,$(dir $(word $(words $(_MAKEFILES)),$(_MAKEFILES))))
+
+$(_MODULE)_OUTPUT := $(_OUTTOP)/$(_MODULE)
+
+$($(_MODULE)_OUTPUT)/.f:
+       @if !([ -e $@ ]); then \
+               ( mkdir -p $(patsubst %/.f,%,$@) ; \
+                 touch $@ ); fi
diff --git a/docbook/relaxng/docbook/dbforms/Makefile b/docbook/relaxng/docbook/dbforms/Makefile
new file mode 100644 (file)
index 0000000..3a73b87
--- /dev/null
@@ -0,0 +1,29 @@
+include _header.mak
+
+SRCS = dbforms.rnc
+
+BINARY = dbforms.rnd
+
+all:: dbforms.rng dbforms.rnc dbforms.dtd
+
+$(_OUTTOP)/dbforms/dbforms.rng: dbforms/htmlform.rnc \
+             src/annotations.rnc src/bibliography.rnc \
+             src/callouts.rnc src/calstbl.rnc src/dbforms.rnc \
+             src/docbook.rnc src/ebnf.rnc src/glossary.rnc \
+             src/hier.rnc src/htmlform.rnc src/htmltbl.rnc \
+             src/index.rnc src/math.rnc src/mathml.rnc \
+             src/msgset.rnc src/pool.rnc src/qandaset.rnc \
+             src/refentry.rnc src/refsect1.rnc src/sect1.rnc \
+             src/svg.rnc src/tasks.rnc src/toc.rnc \
+             src/xinclude.rnc src/xlink.rnc
+
+include _footer.mak
+
+dbforms.rng: $(basename $(docbook_BINARY)).rnx
+       $(XSLTPROC) --output $@ $(TOOLS)/removedoc.xsl $<
+
+dbforms.rnc: dbforms.rng
+       $(RUNTRANG) $< $@
+
+dbforms.dtd: $(basename $(docbook_BINARY)).dtx dbforms.rnc
+       $(XSLTPROC) -output $@ $(TOOLS)/xml2dtd.xsl $<
diff --git a/docbook/relaxng/docbook/dbforms/dbforms.rnc b/docbook/relaxng/docbook/dbforms/dbforms.rnc
new file mode 100644 (file)
index 0000000..5f689af
--- /dev/null
@@ -0,0 +1,21 @@
+# This file is part of DocBook NG: The "Lillet" Release.
+
+# This schema is a "work-in-progress". It validates a DocBook-like grammar that
+# may, in some incarnation, form the basis for DocBook V.next. Or it may not.
+# At the moment, it's just an exploration by Norm. It has utterly no normative
+# value at all.
+#
+# Author: Norman Walsh, <ndw@nwalsh.com>
+# Source: Derived from DocBook XML V4.3
+# Release: $Id$
+#
+# ======================================================================
+
+namespace ctrl = "http://nwalsh.com/xmlns/schema-control/"
+namespace rng  = "http://relaxng.org/ns/structure/1.0"
+namespace s = "http://www.ascc.net/xml/schematron"
+namespace db = "http://docbook.org/ns/docbook"
+default namespace = "http://docbook.org/ns/docbook"
+
+include "../src/docbook.rnc"
+include "htmlform.rnc"
diff --git a/docbook/relaxng/docbook/dbforms/htmlform.rnc b/docbook/relaxng/docbook/dbforms/htmlform.rnc
new file mode 100644 (file)
index 0000000..1c028a3
--- /dev/null
@@ -0,0 +1,270 @@
+# This file is part of DocBook NG: The "Lillet" Release.
+
+# This schema is a "work-in-progress". It validates a DocBook-like grammar that
+# may, in some incarnation, form the basis for DocBook V.next. Or it may not.
+# At the moment, it's just an exploration by Norm. It has utterly no normative
+# value at all.
+#
+# Author: Norman Walsh, <ndw@nwalsh.com>
+# Source: Derived from DocBook XML V4.3
+# Release: $Id$
+#
+
+namespace html = "http://www.w3.org/1999/xhtml"
+namespace ctrl = "http://nwalsh.com/xmlns/schema-control/"
+namespace rng  = "http://relaxng.org/ns/structure/1.0"
+namespace s = "http://www.ascc.net/xml/schematron"
+namespace db = "http://docbook.org/ns/docbook"
+default namespace = "http://docbook.org/ns/docbook"
+
+db.extension.blocks |= db.html.form
+db.extension.inlines |=
+   db.html.input
+ | db.html.button
+ | db.html.label
+ | db.html.select
+ | db.html.textarea
+ | db.html.fieldset
+
+# ======================================================================
+
+[
+   db:refname [ "html:form" ]
+   db:refpurpose [ "An HTML form" ]
+]
+div {
+
+   db.html.form.attlist =
+      db.html.attrs
+    & attribute action { xsd:anyURI }
+    & attribute method { "get" | "post" }?
+    & attribute onsubmit { text }?
+    & attribute onreset { text }?
+    & attribute enctype { text }?
+    & attribute accept { text }?
+    & attribute accept-charset { text }?
+
+   db.html.form =
+      element html:form {
+         db.html.form.attlist,
+         ( db.all.blocks
+          | db.html.input
+          | db.html.button
+          | db.html.label
+          | db.html.select
+          | db.html.textarea
+          | db.html.fieldset)+
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "html:input" ]
+   db:refpurpose [ "An input element in an HTML form" ]
+]
+div {
+
+   db.html.input.attlist =
+      db.html.attrs
+    & attribute type {
+       "text"
+     | "password"
+     | "checkbox"
+     | "radio"
+     | "submit"
+     | "reset"
+     | "file"
+     | "hidden"
+     | "image"
+     | "button" }?
+    & attribute name { text }?
+    & attribute value { text }?
+    & attribute checked { "checked" }?
+    & attribute disabled { "disabled" }?
+    & attribute readonly { "readonly" }?
+    & attribute size { text }?
+    & attribute maxlength { text }?
+    & attribute src { text }?
+    & attribute alt { text }?
+    & attribute usemap { text }?
+    & attribute tabindex { text }?
+    & attribute accesskey { text }?
+    & attribute onfocus { text }?
+    & attribute onblur { text }?
+    & attribute onselect { text }?
+    & attribute onchange { text }?
+
+   db.html.input =
+      element html:input {
+         db.html.input.attlist,
+         empty
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "html:button" ]
+   db:refpurpose [ "A button in an HTML form" ]
+]
+div {
+
+   db.html.button.attlist =
+      db.html.attrs
+    & attribute name { text }?
+    & attribute value { text }?
+    & attribute type { "button" | "submit" | "reset" }?
+    & attribute disabled { "disabled" }?
+    & attribute tabindex { text }?
+    & attribute accesskey { text }?
+    & attribute onfocus { text }?
+    & attribute onblur { text }?
+
+   db.html.button =
+      element html:button {
+         db.html.button.attlist,
+         db.all.inlines*
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "html:label" ]
+   db:refpurpose [ "A label in an HTML form" ]
+]
+div {
+
+   db.html.label.attlist =
+      db.html.attrs
+    & attribute accesskey { text }?
+    & attribute onfocus { text }?
+    & attribute onblur { text }?
+
+   db.html.label =
+      element html:label {
+         db.html.label.attlist,
+         db.all.inlines*
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "html:select" ]
+   db:refpurpose [ "A select element in an HTML form" ]
+]
+div {
+
+   db.html.select.attlist =
+      db.html.attrs
+    & attribute name { text }?
+    & attribute size { text }?
+    & attribute multiple { "multiple" }?
+    & attribute disabled { "disabled" }?
+    & attribute tabindex { text }?
+    & attribute onfocus { text }?
+    & attribute onblur { text }?
+    & attribute onchange { text }?
+
+   db.html.select =
+      element html:select {
+         db.html.select.attlist,
+         db.html.option+
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "html:option" ]
+   db:refpurpose [ "An option element in an HTML form" ]
+]
+div {
+
+   db.html.option.attlist =
+      db.html.attrs
+    & attribute selected { "selected" }?
+    & attribute disabled { "disabled" }?
+    & attribute value { text }?
+
+   db.html.option =
+      element html:option {
+         db.html.option.attlist,
+         text
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "html:textarea" ]
+   db:refpurpose [ "A textarea element in an HTML form" ]
+]
+div {
+
+   db.html.textarea.attlist =
+      db.html.attrs
+    & attribute name { text }?
+    & attribute rows { text }
+    & attribute cols { text }
+    & attribute disabled { "disabled" }?
+    & attribute readonly { "readonly" }?
+    & attribute tabindex { text }?
+    & attribute accesskey { text }?
+    & attribute onfocus { text }?
+    & attribute onblur { text }?
+    & attribute onselect { text }?
+    & attribute onchange { text }?
+
+   db.html.textarea =
+      element html:textarea {
+         db.html.textarea.attlist,
+         text
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "html:fieldset" ]
+   db:refpurpose [ "A fieldset element in an HTML form" ]
+]
+div {
+
+   db.html.fieldset.attlist =
+      db.html.attrs
+
+   db.html.fieldset =
+      element html:fieldset {
+         db.html.fieldset.attlist,
+         db.html.legend?,
+         (db.all.blocks
+          | db.html.input
+          | db.html.button
+          | db.html.label
+          | db.html.select
+          | db.html.textarea
+          | db.html.fieldset)+
+      }
+}
+
+# ======================================================================
+
+[
+   db:refname [ "html:legend" ]
+   db:refpurpose [ "A legend in an HTML form fieldset" ]
+]
+div {
+
+   db.html.legend.attlist =
+      db.html.attrs
+    & attribute accesskey { text }?
+
+   db.html.legend =
+      element html:legend {
+         db.html.legend.attlist,
+         db.all.inlines*
+      }
+}
diff --git a/docbook/relaxng/docbook/docbook/Makefile b/docbook/relaxng/docbook/docbook/Makefile
new file mode 100644 (file)
index 0000000..85618c3
--- /dev/null
@@ -0,0 +1,28 @@
+include _header.mak
+
+SRCS = docbook.rnc
+
+BINARY = docbook.rnd
+
+all:: docbook.rng docbook.rnc docbook.dtd
+
+$(_OUTTOP)/docbook/docbook.rng: src/annotations.rnc src/bibliography.rnc \
+             src/callouts.rnc src/calstbl.rnc src/dbforms.rnc \
+             src/docbook.rnc src/ebnf.rnc src/glossary.rnc \
+             src/hier.rnc src/htmlform.rnc src/htmltbl.rnc \
+             src/index.rnc src/math.rnc src/mathml.rnc \
+             src/msgset.rnc src/pool.rnc src/qandaset.rnc \
+             src/refentry.rnc src/refsect1.rnc src/sect1.rnc \
+             src/svg.rnc src/tasks.rnc src/toc.rnc \
+             src/xinclude.rnc src/xlink.rnc
+
+include _footer.mak
+
+docbook.rng: $(basename $(docbook_BINARY)).rnx
+       $(XSLTPROC) --output $@ $(TOOLS)/removedoc.xsl $<
+
+docbook.rnc: docbook.rng
+       $(RUNTRANG) $< $@
+
+docbook.dtd: $(basename $(docbook_BINARY)).dtx docbook.rnc
+       $(XSLTPROC) -output $@ $(TOOLS)/xml2dtd.xsl $<
diff --git a/docbook/relaxng/docbook/docbook/docbook.rnc b/docbook/relaxng/docbook/docbook/docbook.rnc
new file mode 100644 (file)
index 0000000..6f31f2c
--- /dev/null
@@ -0,0 +1,14 @@
+# This file is part of DocBook NG: The "Lillet" Release.
+
+# This schema is a "work-in-progress". It validates a DocBook-like grammar that
+# may, in some incarnation, form the basis for DocBook V.next. Or it may not.
+# At the moment, it's just an exploration by Norm. It has utterly no normative
+# value at all.
+#
+# Author: Norman Walsh, <ndw@nwalsh.com>
+# Source: Derived from DocBook XML V4.3
+# Release: $Id$
+#
+# ======================================================================
+
+include "../src/docbook.rnc"