summaryrefslogtreecommitdiff
blob: acba37203c3785f2f2d53034e2f45b703354e1b9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
DTDS = devbook.dtd glsa.dtd metadata.dtd mirrors.dtd \
       projects.dtd repositories.dtd userinfo.dtd

RNCS = $(patsubst %.dtd,%.rnc,$(DTDS))

ifneq ($(PV),)
P=nxml-gentoo-schemas-$(PV)
else
P=nxml-gentoo-schemas-$(shell TZ=UTC date '+%Y%m%d')
endif

.PHONY: all dist clean
.PRECIOUS: $(RNCS) $(DTDS)

all: $(RNCS)

dist: Makefile LICENCE schemas.xml $(RNCS)
	tar -cJf $(P).tar.xz --transform='s%^%$(P)/%' $^

clean:
	rm -f *.dtd *.tar.xz

%.rnc: %.dtd
	trang -I dtd -O rnc $< $@

%.dtd:
	wget -N --no-verbose https://www.gentoo.org/dtd/$@

devbook.dtd:
	wget -N --no-verbose \
	  https://gitweb.gentoo.org/proj/devmanual.git/plain/$@