From: Norman Walsh Date: Fri, 22 Apr 2005 15:59:17 +0000 (+0000) Subject: Simplify build X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b2febbb0c82eea55572628f07bade6ce3416c30f;p=docbook-dsssl Simplify build --- diff --git a/docbook/relaxng/simple/Makefile b/docbook/relaxng/simple/Makefile index b723d142f..afd103011 100644 --- a/docbook/relaxng/simple/Makefile +++ b/docbook/relaxng/simple/Makefile @@ -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* diff --git a/docbook/relaxng/simple/build/Makefile b/docbook/relaxng/simple/build/Makefile index 8e6abfb5d..a01a3a8cf 100644 --- a/docbook/relaxng/simple/build/Makefile +++ b/docbook/relaxng/simple/build/Makefile @@ -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 index 34f072079..000000000 --- a/docbook/relaxng/simple/build/rnx/.cvsignore +++ /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 index 67cbbb53f..000000000 --- a/docbook/relaxng/simple/build/rnx/Makefile +++ /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