TEX_SVG=Minotauros.svg MinotaurosNoseRing.svg MinotaurosBell.svg MinotaurosSkull.svg MinotaurosClub.svg

dist/.textures: $(TEX_SVG)
	inkscape --export-png=Minotauros.png --export-area=0:0:512:512 --export-dpi=90 --export-background-opacity=0.0 Minotauros.svg
	inkscape --export-png=MinotaurosNoseRing.png --export-area=0:0:256:256 --export-dpi=90 --export-background-opacity=0.0 MinotaurosNoseRing.svg
	inkscape --export-png=MinotaurosBell.png --export-area=0:0:256:256 --export-dpi=90 --export-background-opacity=0.0 MinotaurosBell.svg
	inkscape --export-png=MinotaurosSkull.png --export-area=0:0:64:64 --export-dpi=90 --export-background-opacity=0.0 MinotaurosSkull.svg
	inkscape --export-png=MinotaurosClub.png --export-area=0:0:256:256 --export-dpi=90 --export-background-opacity=0.0 MinotaurosClub.svg
	mkdir dist; echo
	touch dist/.textures

clean:
	rm -rf dist

dist/.obj: minotauros20130619.blend $(TEX_SVG)
	make dist/.textures
	mkdir dist/obj ; echo
	cp minotauros20130619.blend dist/obj
	cp Minotauros.png dist/obj
	cp MinotaurosNoseRing.png dist/obj
	cp MinotaurosBell.png dist/obj
	cp MinotaurosSkull.png dist/obj
	cp MinotaurosClub.png dist/obj
	cd dist/obj; sh $(DEVUTIL)/blend2obj.sh minotauros20130619.blend minotauros20130619.obj ; echo
	cd dist/obj; zip minotauros20130619.zip *.mtl *.obj *.png
	touch dist/.obj

dist/.ogre: minotauros20130619.blend $(TEX_SVG)
	make dist/.textures
	mkdir dist/ogre ; echo
	cd dist/ogre; sh $(DEVUTIL)/blend2ogre.sh $(DEVDATA)/minotauros20130619/minotauros20130619.blend ./minotauros20130619.scene ; echo
	if [ ! -f dist/ogre/Minotauros.mesh.xml ]; then exit -1; fi
	if [ ! -f dist/ogre/Minotauros.skeleton.xml ]; then exit -1; fi
	if [ ! -f dist/ogre/Minotauros.material ]; then exit -1; fi
	if [ ! -f dist/ogre/Minotauros.png ]; then exit -1; fi
	cd dist/ogre; rm MinotaurosNoseRing.skeleton.xml
	cd dist/ogre; xqilla -u -i MinotaurosNoseRing.mesh.xml $(DEVDATA)/del-skeleton.xq
	if [ ! -f dist/ogre/MinotaurosNoseRing.mesh.xml ]; then exit -1; fi
	if [ ! -f dist/ogre/MinotaurosNoseRing.material ]; then exit -1; fi
	if [ ! -f dist/ogre/MinotaurosNoseRing.png ]; then exit -1; fi
	cd dist/ogre; rm MinotaurosBell.skeleton.xml
	cd dist/ogre; xqilla -u -i MinotaurosBell.mesh.xml $(DEVDATA)/del-skeleton.xq
	if [ ! -f dist/ogre/MinotaurosBell.mesh.xml ]; then exit -1; fi
	if [ ! -f dist/ogre/MinotaurosBell.material ]; then exit -1; fi
	if [ ! -f dist/ogre/MinotaurosBell.png ]; then exit -1; fi
	cd dist/ogre; rm MinotaurosSkull.skeleton.xml
	cd dist/ogre; xqilla -u -i MinotaurosSkull.mesh.xml $(DEVDATA)/del-skeleton.xq
	if [ ! -f dist/ogre/MinotaurosSkull.mesh.xml ]; then exit -1; fi
	if [ ! -f dist/ogre/MinotaurosSkull.material ]; then exit -1; fi
	if [ ! -f dist/ogre/MinotaurosSkull.png ]; then exit -1; fi
	cd dist/ogre; rm MinotaurosClub.skeleton.xml
	cd dist/ogre; xqilla -u -i MinotaurosClub.mesh.xml $(DEVDATA)/del-skeleton.xq
	if [ ! -f dist/ogre/MinotaurosClub.mesh.xml ]; then exit -1; fi
	if [ ! -f dist/ogre/MinotaurosClub.material ]; then exit -1; fi
	if [ ! -f dist/ogre/MinotaurosClub.png ]; then exit -1; fi
	touch dist/.ogre

