cxx = clang++
testdir = tests
basefiles = spq.cpp
gtest_name = gtest-1.7.0
gtest_incl = -I$(testdir)/$(gtest_name)/include -L$(testdir)/$(gtest_name)
libs = -lgtest -lpthread

test: $(basefiles) $(testdir)/spq_tests.cpp
	$(cxx) -g -std=c++11 -O0 -DDEBUG -Wall $(testdir)/spq_tests.cpp $(basefiles) $(gtest_incl) -o spq_tests -lgtest -lpthread

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

clean:
	rm -fr ./spq_tests ./spq_tests.dSYM

