]> granicus.if.org Git - docbook-dsssl/commitdiff
Simplify build
authorNorman Walsh <ndw@nwalsh.com>
Fri, 22 Apr 2005 15:59:17 +0000 (15:59 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 22 Apr 2005 15:59:17 +0000 (15:59 +0000)
docbook/relaxng/simple/Makefile
docbook/relaxng/simple/build/Makefile
docbook/relaxng/simple/build/rnx/.cvsignore [deleted file]
docbook/relaxng/simple/build/rnx/Makefile [deleted file]

index b723d142f07716eb53e87ecf93d59277892d90a9..afd1030113297df38f94d1aecb1e65808e3c832c 100644 (file)
@@ -1,44 +1,49 @@
-.SUFFIXES: .rnc .rng .rnx
+VPATH=src
+
+.SUFFIXES: .rnc .rng .rnx .dtx .dtd
 .PHONY: tests html
 
 DOCBOOK=../docbook
 TOOLS=../tools
 RNGFILES=$(wildcard build/*.rng)
 
-all:
-       $(MAKE) TOOLS=../../$(TOOLS) DOCBOOK=../../$(DOCBOOK) -C build/rnx
-       $(MAKE) TOOLS=../$(TOOLS) DOCBOOK=../$(DOCBOOK) -C build
-       $(MAKE) sdocbook.rng sdocbook.dtd
+all: sdocbook.rng sdocbook.dtd
 
 # ============================================================
-
-sdocbook.rng: $(RNGFILES)
-       $(MAKE) TOOLS=../$(TOOLS) -C build $@
-       mv build/$@ .
-       perl $(TOOLS)/trimgrammar.pl -o ,$@ $@
+#
+# 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.
+
+sdocbook.rng: src/sdocbook.rnc
+
+.rnc.rng:
+       $(MAKE) -C build $@
+       perl $(TOOLS)/trimgrammar.pl -o ,$@ build/$@
        saxon ,$@ $(TOOLS)/trimgrammar.xsl $@ use.extensions=1
-       trang $@ sdocbook.rnc
+       trang $@ `basename $<`
+       sleep 2
+       touch $@
        rm -f ,$@
 
-sdocbook-rng.xml: sdocbook.rng $(TOOLS)/rngdocxml.xsl
+.rng.rnx:
        xsltproc -output $@ $(TOOLS)/rngdocxml.xsl $<
 
-sdocbook-dtd.xml: sdocbook-rng.xml $(TOOLS)/doc2dtd.xsl
+.rnx.dtx:
        xsltproc -output $@ $(TOOLS)/doc2dtd.xsl $<
 
-sdocbook.dtd: sdocbook-dtd.xml $(TOOLS)/xml2dtd.xsl
+.dtx.dtd:
        xsltproc -output $@ $(TOOLS)/xml2dtd.xsl $<
 
-diff: sdocbook.rng
-       saxon -8b $< alphalist-rng.xsl alphalist
-       diff dtdlist alphalist | more
-
-# ============================================================
-
-html: sdocbook-rng.xml
-       saxon $< $(TOOLS)/html.xsl /dev/null
-
 # ============================================================
 
 clean:
-       rm -f *-dtd.xml *-rng.xml
+       rm -f sdocbook*
index 8e6abfb5db1a33be22fe397163ecd6d2908add74..a01a3a8cf12e3c69cc4ada10b1c6658655770e09 100644 (file)
@@ -1,26 +1,22 @@
-VPATH=rnx
+VPATH=../src
 
 TOOLS=../../tools
 
-RNXFILES=$(subst rnx/,,$(wildcard rnx/*.rnx))
-RNGFILES=$(subst .rnx,.rng,$(RNXFILES))
-
 AUGMENT=$(TOOLS)/augment.xsl
 INCLUDE=$(TOOLS)/include.xsl
 CLEANUP=$(TOOLS)/cleanup.pl
 
-.SUFFIXES: .rng .rnx
+.SUFFIXES: .rng .rnc
 
-all: $(RNGFILES)
+all:
+       @echo Make what?
 
-.rnx.rng:
-       saxon $< $(INCLUDE) ,$@ use.extensions=1
+.rnc.rng:
+       trang -O rng $< $@
+       saxon $@ $(INCLUDE) ,$@ use.extensions=1
        saxon ,$@ $(AUGMENT) $@ use.extensions=1
        perl -i $(CLEANUP) $@
        rm -f ,$@
 
-.rnc.rnx:
-       trang -O rng $< $@
-
 clean:
        rm -f *.rng
diff --git a/docbook/relaxng/simple/build/rnx/.cvsignore b/docbook/relaxng/simple/build/rnx/.cvsignore
deleted file mode 100644 (file)
index 34f0720..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.rnx
diff --git a/docbook/relaxng/simple/build/rnx/Makefile b/docbook/relaxng/simple/build/rnx/Makefile
deleted file mode 100644 (file)
index 67cbbb5..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-VPATH=../../src
-
-RNCFILES=$(subst ../../src/,,$(wildcard ../../src/*.rnc))
-RNXFILES=$(subst .rnc,.rnx,$(RNCFILES))
-
-.SUFFIXES: .rnc .rnx
-
-all: $(RNXFILES)
-       echo "Made $(RNXFILES)"
-       echo "From $(RNCFILES)"
-
-.rnc.rnx:
-       trang -O rng $< $@
-
-clean:
-       rm -f *.rnx *.rng