root := ../../..

include $(root)/build/cxx/rules.make

xsd_cxx_suffix := -parser-templates
include $(root)/build/xsd/parser-rules.make


override XSDFLAGS += --generate-inline \
--namespace-regex '%.* http://www.w3.org/2001/XMLSchema%xml_schema::parser%' \
--namespace-regex '%.* http://www.codesynthesis.com/library%library::parser::templates%'


# Build
#
driver: driver.o

library-parser-templates.hxx \
library-parser-templates.ixx \
library-parser-templates.txx: library.xsd


driver.o: driver.cxx library.hxx library-parser.hxx \
  library-parser-templates.hxx library-parser-templates.ixx \
  library-parser-templates.txx


# Test.
#
.PHONY: test
test: driver library.xml
	./driver library.xml


# Clean.
#
.PHONY: clean
clean:
	rm -f library-parser-templates.?xx driver.o driver

