Update NEWS
[purplehaze.git] / test / unit / Makefile
blob50d8194904601b0bda990d374096f2124adaa74c
1 include ../../configure.mk
3 CXXFLAGS += -I ${GTEST}/include
4 GTEST = 'gtest-1.6.0'
6 SOURCES = $(shell find ../.. -name '*.cpp' ! -name 'main.cpp' | sort)
7 OBJECTS = $(SOURCES:.cpp=.o)
8 EXECUTABLE = test_purplehaze
10 .PHONY: all test clean
12 all: $(SOURCES) $(EXECUTABLE)
14 $(EXECUTABLE): libgtest.a $(OBJECTS)
15 $(CXX) $(CXXFLAGS) -o $@ $(OBJECTS) libgtest.a
17 .cpp.o:
18 $(CXX) $(CXXFLAGS) -c -o $@ $<
20 libgtest.a:
21 curl -s -C - http://googletest.googlecode.com/files/$(GTEST).zip > $(GTEST).zip
22 unzip $(GTEST).zip
23 $(CXX) -I ${GTEST}/include -I ${GTEST} $(CXXFLAGS) -c ${GTEST}/src/gtest-all.cc
24 $(AR) -rv libgtest.a gtest-all.o
26 test:
27 ./$(EXECUTABLE)
29 clean:
30 $(RM) $(OBJECTS) $(EXECUTABLE)
31 $(RM) -r *gtest*