testdir = ./tests
basefiles = ./misc.cpp
gxxpaths = -I$(testdir)/gtest-1.6.0/include -L$(testdir)/gtest-1.6.0
gxxargs = -Wall -g3 -O0 $(gxxpaths) $(basefiles)
libs = -lgtest -lpthread

test: $(basefiles) $(testdir)/pair-tests.cpp $(testdir)/vector-tests.cpp
	g++ $(gxxargs) $(testdir)/pair-tests.cpp -o pair-tests $(libs);\
	g++ $(gxxargs) $(testdir)/vector-tests.cpp -o vector-tests $(libs)

gtest:
	cd $(testdir);\
	unzip -o ./gtest-1.6.0.zip;\
	cd ./gtest-1.6.0;\
	./configure;\
	make;\
	cmake .;\
	g++ -I./include -I./ -c ./src/gtest-all.cc;\
	ar -rv libgtest.a gtest-all.o


# Cleaning up

clean:
	rm -f ./main ./screen-example ./*.o ./pair-tests ./vector-tests
