SCHEMAS = cf-connector.rng cf-connector.xsd cf-connector.dtd

check: cf-connector.rng
	xmllint --noout --relaxng cf-connector.rng ../connectors/*.cf

# test-dtd doesn't work because wildcards can't be translated into DTD
test: test-rng test-xsd # test-dtd

schemas: $(SCHEMAS)

test-rng: test-rng-google
test-rng-%: %.cf cf-connector.rng
	xmllint --noout --relaxng cf-connector.rng $<
cf-connector.rng: cf-connector.rnc
	rm -f $@
	trang $< $@
	chmod ugo-w $@

test-xsd: test-xsd-google
test-xsd-%: %.cf cf-connector.xsd
	xmllint --noout --schema cf-connector.xsd $<
cf-connector.xsd: cf-connector.rnc
	rm -f $@
	trang $< $@
	chmod ugo-w $@

test-dtd: test-dtd-google
test-dtd-%: %.cf cf-connector.dtd
	xmllint --noout --dtdvalid cf-connector.dtd $<
cf-connector.dtd: cf-connector.rnc
	rm -f $@
	trang $< $@
	chmod ugo-w $@

clean:
	rm -f $(SCHEMAS)

