# Makefile created by Dan Willemsen(dan@csh.rit.edu) to
# compile tinyxml inside the touchlib distribution
#
# This Makefile should be resilient enough to use on both
# Mac OS X and Linux, but it has only been tested on OS X 

CFLAG = -O -g

AR = ar
ARFLAGS = -r
RANLIB = ranlib $@

all: lib/libtinyxml.a

clean:
	rm -f *.o lib/libtinyxml.a

lib/libtinyxml.a: tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o
	${AR} ${ARFLAGS} $@ tinystr.o tinyxml.o tinyxmlerror.o tinyxmlparser.o
	${RANLIB}

tinystr.o: tinystr.cpp tinystr.h
	g++ -c -o tinystr.o ${CFLAG} tinystr.cpp

tinyxml.o: tinyxml.cpp tinyxml.h tinystr.h
	g++ -c -o tinyxml.o ${CFLAG} tinyxml.cpp

tinyxmlerror.o: tinyxmlerror.cpp tinyxml.h tinystr.h
	g++ -c -o tinyxmlerror.o ${CFLAG} tinyxmlerror.cpp

tinyxmlparser.o: tinyxmlparser.cpp tinyxml.h tinystr.h
	g++ -c -o tinyxmlparser.o ${CFLAG} tinyxmlparser.cpp
