XSD_PYS =
XSD_PYS += src/ee/xml/types.py

all: env/pip.cookie $(XSD_PYS)

env/bin/pip:
	virtualenv -p python3 env

env/pip.cookie: requirements.txt env/bin/pip
	env/bin/pip install -r requirements.txt
	env/bin/pip install -e .
	@touch env/pip.cookie

src/ee/xml/__init__.py:
	touch $@

define xsd-to-py
	env/bin/generateDS.py \
	    -f \
	    --no-dates \
	    --no-versions \
	    --output-directory=src/ee/xml \
	    -o $@ \
	    -m $<
endef

$(XSDS): env/pip.cookie src/ee/xml/__init__.py
src/ee/xml/types.py: xsd/ee.xsd
	$(xsd-to-py)