OLD | NEW |
(Empty) | |
| 1 # A Makefile for fusing Google Mock and building a sample test against it. |
| 2 # |
| 3 # SYNOPSIS: |
| 4 # |
| 5 # make [all] - makes everything. |
| 6 # make TARGET - makes the given target. |
| 7 # make check - makes everything and runs the built sample test. |
| 8 # make clean - removes all files generated by make. |
| 9 |
| 10 # Points to the root of fused Google Mock, relative to where this file is. |
| 11 FUSED_GMOCK_DIR = output |
| 12 |
| 13 # Paths to the fused gmock files. |
| 14 FUSED_GTEST_H = $(FUSED_GMOCK_DIR)/gtest/gtest.h |
| 15 FUSED_GMOCK_H = $(FUSED_GMOCK_DIR)/gmock/gmock.h |
| 16 FUSED_GMOCK_GTEST_ALL_CC = $(FUSED_GMOCK_DIR)/gmock-gtest-all.cc |
| 17 |
| 18 # Where to find the gmock_test.cc. |
| 19 GMOCK_TEST_CC = ../../test/gmock_test.cc |
| 20 |
| 21 # Where to find gmock_main.cc. |
| 22 GMOCK_MAIN_CC = ../../src/gmock_main.cc |
| 23 |
| 24 # Flags passed to the preprocessor. |
| 25 CPPFLAGS += -I$(FUSED_GMOCK_DIR) |
| 26 |
| 27 # Flags passed to the C++ compiler. |
| 28 CXXFLAGS += -g |
| 29 |
| 30 all : gmock_test |
| 31 |
| 32 check : all |
| 33 ./gmock_test |
| 34 |
| 35 clean : |
| 36 rm -rf $(FUSED_GMOCK_DIR) gmock_test *.o |
| 37 |
| 38 $(FUSED_GTEST_H) : |
| 39 ../fuse_gmock_files.py $(FUSED_GMOCK_DIR) |
| 40 |
| 41 $(FUSED_GMOCK_H) : |
| 42 ../fuse_gmock_files.py $(FUSED_GMOCK_DIR) |
| 43 |
| 44 $(FUSED_GMOCK_GTEST_ALL_CC) : |
| 45 ../fuse_gmock_files.py $(FUSED_GMOCK_DIR) |
| 46 |
| 47 gmock-gtest-all.o : $(FUSED_GTEST_H) $(FUSED_GMOCK_H) $(FUSED_GMOCK_GTEST_ALL_CC
) |
| 48 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(FUSED_GMOCK_GTEST_ALL_CC) |
| 49 |
| 50 gmock_main.o : $(FUSED_GTEST_H) $(FUSED_GMOCK_H) $(GMOCK_MAIN_CC) |
| 51 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GMOCK_MAIN_CC) |
| 52 |
| 53 gmock_test.o : $(FUSED_GTEST_H) $(FUSED_GMOCK_H) $(GMOCK_TEST_CC) |
| 54 $(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(GMOCK_TEST_CC) |
| 55 |
| 56 gmock_test : gmock_test.o gmock-gtest-all.o gmock_main.o |
| 57 $(CXX) $(CPPFLAGS) $(CXXFLAGS) $^ -o $@ |
OLD | NEW |