all: interfaces.h

togra.xml: togra.prexml togra_interfaces.xml togra_logo.xml \
	   togra_staticrender.xml togra_rendercontrol.xml togra_vector.xml \
	   togra_container.xml togra_transformcontainer.xml \
	   togra_transform.xml togra_vectorlist.xml togra_intlist.xml \
	   togra_extras.xml togra_interpolatedpath.xml \
	   togra_interpolations.xml togra_transforms.xml \
	   togra_statictexture.xml togra_floatlist.xml
	cp togra.prexml tmp.h
	gcc -E -P tmp.h -o togra.xml.tmp
	rm tmp.h
	egrep -v ^$$ togra.xml.tmp > togra.xml
	rm togra.xml.tmp

#
# NB: This is dodgy - tip makes more than just interfaces.h.  I didn't know
# any other way to only run all when one of togra.xml, tip.py or dictparser.py
# changed
#

interfaces.h: togra.xml tip.py dictparser.py
	python tip.py togra.xml

build_test:
	gcc -c -I . -I /usr/include/python2.3/ *.c -I ../include/ `pkg-config --cflags gtk+-2.0 gtkgl-2.0`

%_symboltest.so: %.c
	gcc -shared -I . -I /usr/include/python2.3/ $^ -o $@ -I ../include/ `pkg-config --cflags gtk+-2.0 gtkgl-2.0`


clean:
	rm -f togra.xml togra.xml.tmp *.c *.h *.o *.so
