1 #!/usr/bin/make -f 2 3 GTEST_INCLUDE_DIR = .. 4 GTEST_SRC = $(wildcard ./*.cc) 5 GTEST_OBJ = $(GTEST_SRC:.cc=.o) 6 7 GTEST_LIB = libgtest.a 8 9 $(GTEST_OBJ): %.o: %.cc 10 $(CXX) -o $@ -c $(CXXFLAGS) $(GTEST_DEFINES) -I$(GTEST_INCLUDE_DIR) $< 11 12 $(GTEST_LIB): $(GTEST_OBJ) 13 $(AR) rc $@ $^ 14 $(RANLIB) $@ 15 16 build: all 17 18 all: $(GTEST_LIB) 19 20 install: 21 22 clean: 23 rm -f $(GTEST_OBJ) $(GTEST_LIB) 24