root := ../../..

include $(root)/build/cxx/rules.make
include $(root)/build/xsd/parser-rules.make

override XSDFLAGS += --generate-polymorphic

# Build
#
driver: driver.o schema-pskel.o schema-pimpl.o

driver.o: driver.cxx schema-pimpl.hxx schema-pskel.hxx
schema-pimpl.o: schema-pimpl.cxx schema-pimpl.hxx schema-pskel.hxx
schema-pskel.o: schema-pskel.cxx schema-pskel.hxx

schema-pskel.hxx schema-pskel.cxx: schema.xsd


# Test.
#
.PHONY: test
test: driver person.xml superman.xml batman.xml
	./driver person.xml
	./driver superman.xml
	./driver batman.xml

# Clean.
#
.PHONY: clean
clean:
	rm -f schema-pskel.?xx schema-pimpl.o schema-pskel.o driver.o driver
