summaryrefslogtreecommitdiff
path: root/Makefile
blob: b67a99829bc79eb4c8b32f38b5e0063e0ec05889 (plain) (blame)
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
# for pipefail
SHELL=/bin/bash
.SECONDARY:
.DELETE_ON_ERROR:

check:
	git diff --exit-code

XMLS = $(shell find -type f -name '*.xml')
check: check-xml
check-xml: $(patsubst %.xml,out/%.xml.ok,${XMLS})
	find -name '*.xml.ok' -delete
	find -name '*.xml.out' -delete
out/%.xml.ok: %.xml out/%.xml.out
	diff -u $^
	touch $@
out/%.xml.out: %.xml
	mkdir -p ${@D}
	set -e -o pipefail; \
	xmllint --format --schema tools/tmw.xsd $< 2>&1 > $@ | grep -v 'Skipping import of schema' 1>&2

check: xsd
xsd:
	xmllint --format --schema tools/dl/XMLSchema.xsd tools/tmw.xsd > tmw-formatted.xsd
	diff tools/tmw.xsd tmw-formatted.xsd
	rm tmw-formatted.xsd