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)) ifdef ($(PV),) PN=nxml-gentoo-schemas-$(PV) else PN=nxml-gentoo-schemas-$(shell date '+%Y%m%d') endif TARBALL=$(PN).tar.bz2 .SUFFIXES: .dtd .rnc .dep .PHONY: depend all clean .PRECIOUS: $(RNCS) $(DTDS) .INTERMEDIATE: $(DTDDEPS) all: .depend $(TARBALL) depend: .depend clean: rm -f *.dtd *.dep *.dtd .depend .depend: $(DTDDEPS) cat *.dep > $@ $(TARBALL): Makefile LICENCE DONATING schemas.xml $(RNCS) mkdir -p $(PN) cp $^ $(PN) tar jcf $@ $(PN) .dtd.dep: echo > $@ sed -n -e '/ENTITY/s||\1|p' $< | \ while read dep; do \ echo "$(patsubst %.dtd,%.rnc,$<): $$dep.rnc $$dep.dtd" >> $@ || exit 1; \ echo "$(TARBALL): $$dep.rnc" >> $@ || exit 1; \ $(MAKE) "$$dep.dep" || exit 1; \ done .dtd.rnc: trang -I dtd -O rnc $< $@ %.dtd: wget -N --no-verbose http://www.gentoo.org/dtd/$@ -include .depend