summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-11-21 22:45:18 +0100
committerDiego 'Flameeyes' Pettenò <flameeyes@gmail.com>2007-11-21 22:45:18 +0100
commit923fc1e1fb2d6b7d15ecbf2dbc640a044cfd9f2b (patch)
tree497f2bc448cd4fa50b65cf1de5fbb99ab814513c
parentAdd .gitignore to ignore all the intermediate files. (diff)
downloadnxml-gentoo-schemas-923fc1e1fb2d6b7d15ecbf2dbc640a044cfd9f2b.tar.gz
nxml-gentoo-schemas-923fc1e1fb2d6b7d15ecbf2dbc640a044cfd9f2b.tar.bz2
nxml-gentoo-schemas-923fc1e1fb2d6b7d15ecbf2dbc640a044cfd9f2b.zip
Add the Makefile to automatise building of the rnc files.
-rw-r--r--Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..cd39586
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,37 @@
+DTDS = book.dtd gleps.dtd glsa.dtd guide.dtd metadata.dtd metadoc.dtd \
+ project.dtd staffing-needs.dtd userinfo.dtd
+
+DTDDEPS = $(patsubst %.dtd,%.dep,$(DTDS))
+RNCS = $(patsubst %.dtd,%.rnc,$(DTDS))
+
+.SUFFIXES: .dtd .rnc .dep
+.PHONY: depend all clean
+
+all: .depend $(RNCS)
+
+depend: .depend
+
+clean:
+ -rm *.dtd *.dep .depend
+
+.depend: $(DTDDEPS)
+ cat *.dep > $@
+
+.dtd.dep:
+ echo > $@
+ sed -n -e '/ENTITY/s|<!ENTITY % \w\+ SYSTEM "\(.*\)\.dtd">|\1|p' $< | \
+ while read dep; do \
+ echo "$(patsubst %.dtd,%,$<).rnc: $$dep.rnc" >> $@ || exit 1; \
+ $(MAKE) "$$dep.dep" || exit 1; \
+ done
+
+.dtd.rnc:
+ trang -I dtd -O rnc $< $@
+
+%.dtd:
+ wget --no-verbose http://www.gentoo.org/dtd/$@
+
+-include .depend
+
+# This cannot be calculcated at buildtime
+#common.dtd: funnychars.dtd