]> granicus.if.org Git - docbook-dsssl/commitdiff
Much simpler build mechanics
authorNorman Walsh <ndw@nwalsh.com>
Fri, 22 Apr 2005 15:43:48 +0000 (15:43 +0000)
committerNorman Walsh <ndw@nwalsh.com>
Fri, 22 Apr 2005 15:43:48 +0000 (15:43 +0000)
docbook/relaxng/docbook/Makefile
docbook/relaxng/docbook/build/Makefile

index caa032ad50970c297b5638ffd6c4b8cafb75f660..b5ae9cabbf9b98fbbf6e5d820d4d71684f341739 100644 (file)
@@ -1,35 +1,54 @@
 VPATH=src
 
-.SUFFIXES: .rnc .rng .rnx
+.SUFFIXES: .rnc .rng .rnx .dtx .dtd
 .PHONY: tests html
 
-RNCFILES=$(subst $(VPATH)/,,$(wildcard $(VPATH)/*.rnc))
+RNCFILES=$(wildcard $(VPATH)/*.rnc)
 TOOLS=../tools
 
 all: docbook.rng docbook.dtd
 
 # ============================================================
-
-tests:
-       mkdir -p tests tests/passed
-       cd tests && ../$(TOOLS)/runtests
-
-# ============================================================
+#
+# 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)
+
+.rnc.rng:
        $(MAKE) -C build $@
+       cp build/$@ .
        trang $@ docbook.rnc
+       sleep 2
+       touch $@
 
-docbook-rng.xml: docbook.rng $(TOOLS)/rngdocxml.xsl
+.rng.rnx:
        xsltproc -output $@ $(TOOLS)/rngdocxml.xsl $<
 
-docbook-dtd.xml: docbook-rng.xml $(TOOLS)/doc2dtd.xsl
+.rnx.dtx:
        xsltproc -output $@ $(TOOLS)/doc2dtd.xsl $<
 
-docbook.dtd: docbook-dtd.xml $(TOOLS)/xml2dtd.xsl
+.dtx.dtd:
        xsltproc -output $@ $(TOOLS)/xml2dtd.xsl $<
 
 # ============================================================
 
+tests:
+       mkdir -p tests tests/passed
+       cd tests && ../$(TOOLS)/runtests
+
+# ============================================================
+
 clean:
-       rm -f *-rng.xml *-dtd.xml
\ No newline at end of file
+       rm -f docbook*
+
+# EOF
index 583a7b4dc9caebfd3f1490f9c3f0b4f047fd85d6..b580d1ad1747afffc17634626eec9b17d9b8a0df 100644 (file)
@@ -1,53 +1,28 @@
-VPATH=../src ../tests/customizations
+VPATH=../src
 
 RNCFILES=$(subst ../src/,,$(wildcard ../src/*.rnc))
-RNXFILES=$(subst .rnc,.rnx,$(RNCFILES))
-MODULES=$(filter-out docbook.rnx,$(filter-out sdocbook.rnx,$(filter-out slides-ng.rnx,$(filter-out website-ng.rnx,$(RNXFILES)))))
 
-TMPDIR=/tmp/
-TMPFILE=$(TMPDIR)cleanup.rng
 TOOLS=../../tools
 AUGMENT=$(TOOLS)/augment.xsl
 INCLUDE=$(TOOLS)/include.xsl
-EXPAND=$(TOOLS)/expand.xsl
-GROUP=$(TOOLS)/group.xsl
-FLATTEN=$(TOOLS)/flatten.xsl
-CLASSIFY=$(TOOLS)/classify.xsl
 CLEANUP=$(TOOLS)/cleanup.pl
 
-.SUFFIXES: .rnc .rng .rnx
+.SUFFIXES: .rnc .rng
 
-docbook.rng: docbook.rnx $(AUGMENT) $(INCLUDE) $(CLEANUP)
+all: docbook.rng
 
-docbook-dtd.rng: docbook-dtd.rnx $(AUGMENT) $(INCLUDE) $(CLEANUP)
+# Make sure that docbook.rng depends on all the things that could influence
+# it. That's *all* the RNC files, not just docbook.rnc, and the stylesheets
+# and cleanup script(s).
+#
+docbook.rng: $(RNCFILES) $(AUGMENT) $(INCLUDE) $(CLEANUP)
 
-docbook.rnx: $(MODULES)
-
-dbsmall.rng: dbsmall.rnx $(AUGMENT) $(INCLUDE) $(CLEANUP)
-
-dbsmall.rnx: $(MODULES)
-
-dbastro.rng: dbastro.rnx $(AUGMENT) $(INCLUDE) $(CLEANUP)
-
-sdocbook.rng: sdocbook.rnx $(AUGMENT) $(INCLUDE) $(CLEANUP)
-
-slides-ng.rng: slides-ng.rnx $(AUGMENT) $(INCLUDE) $(CLEANUP)
-
-website-ng.rng: website-ng.rnx $(AUGMENT) $(INCLUDE) $(CLEANUP)
-
-dbastro.rnx: $(MODULES)
-
-.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) $@
-       cp $@ ..
-
-#      rm -f ,$@
-
-.rnc.rnx:
-       trang -O rng $< $@
+       rm -f ,$@
 
 clean:
-       rm -f *.rnx *.rng
-
+       rm -f *.rng