1 # Automake file 2 3 # Nonstandard package files for distribution. 4 EXTRA_DIST = 5 6 # We may need to build our internally packaged gtest. If so, it will be 7 # included in the 'subdirs' variable. 8 SUBDIRS = $(subdirs) 9 10 # Scripts and utilities to be installed by 'make install'. 11 dist_bin_SCRIPTS = scripts/gmock_doctor.py 12 bin_SCRIPTS = scripts/gmock-config 13 14 # This is generated by the configure script, so clean it for distribution. 15 DISTCLEANFILES = scripts/gmock-config 16 17 # We define the global AM_CPPFLAGS as everything we compile includes from these 18 # directories. 19 AM_CPPFLAGS = $(GTEST_CPPFLAGS) -I$(srcdir)/include 20 21 # Modifies compiler and linker flags for pthreads compatibility. 22 if HAVE_PTHREADS 23 AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1 24 AM_LIBS = @PTHREAD_LIBS@ 25 endif 26 27 # Build rules for libraries. 28 lib_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la 29 30 lib_libgmock_la_SOURCES = src/gmock-all.cc 31 32 pkginclude_HEADERS = \ 33 include/gmock/gmock-actions.h \ 34 include/gmock/gmock-cardinalities.h \ 35 include/gmock/gmock-generated-actions.h \ 36 include/gmock/gmock-generated-function-mockers.h \ 37 include/gmock/gmock-generated-matchers.h \ 38 include/gmock/gmock-generated-nice-strict.h \ 39 include/gmock/gmock-matchers.h \ 40 include/gmock/gmock-more-actions.h \ 41 include/gmock/gmock-spec-builders.h \ 42 include/gmock/gmock.h 43 44 pkginclude_internaldir = $(pkgincludedir)/internal 45 pkginclude_internal_HEADERS = \ 46 include/gmock/internal/gmock-generated-internal-utils.h \ 47 include/gmock/internal/gmock-internal-utils.h \ 48 include/gmock/internal/gmock-port.h 49 50 lib_libgmock_main_la_SOURCES = src/gmock_main.cc 51 lib_libgmock_main_la_LIBADD = lib/libgmock.la 52 53 # Build rules for tests. Automake's naming for some of these variables isn't 54 # terribly obvious, so this is a brief reference: 55 # 56 # TESTS -- Programs run automatically by "make check" 57 # check_PROGRAMS -- Programs built by "make check" but not necessarily run 58 59 TESTS= 60 check_PROGRAMS= 61 AM_LDFLAGS = $(GTEST_LDFLAGS) 62 63 # This exercises all major components of Google Mock. It also 64 # verifies that libgmock works. 65 TESTS += test/gmock-spec-builders_test 66 check_PROGRAMS += test/gmock-spec-builders_test 67 test_gmock_spec_builders_test_SOURCES = test/gmock-spec-builders_test.cc 68 test_gmock_spec_builders_test_LDADD = $(GTEST_LIBS) lib/libgmock.la 69 70 # This tests using Google Mock in multiple translation units. It also 71 # verifies that libgmock_main works. 72 TESTS += test/gmock_link_test 73 check_PROGRAMS += test/gmock_link_test 74 test_gmock_link_test_SOURCES = \ 75 test/gmock_link2_test.cc \ 76 test/gmock_link_test.cc \ 77 test/gmock_link_test.h 78 test_gmock_link_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la 79 80 # Tests that fused gmock files compile and work. 81 TESTS += test/gmock_fused_test 82 check_PROGRAMS += test/gmock_fused_test 83 test_gmock_fused_test_SOURCES = \ 84 fused-src/gmock-gtest-all.cc \ 85 fused-src/gmock/gmock.h \ 86 fused-src/gmock_main.cc \ 87 fused-src/gtest/gtest.h \ 88 test/gmock_test.cc 89 test_gmock_fused_test_CPPFLAGS = -I"$(srcdir)/fused-src" 90 91 # Google Mock source files that we don't compile directly. 92 GMOCK_SOURCE_INGLUDES = \ 93 src/gmock-cardinalities.cc \ 94 src/gmock-internal-utils.cc \ 95 src/gmock-matchers.cc \ 96 src/gmock-spec-builders.cc \ 97 src/gmock.cc 98 99 EXTRA_DIST += $(GMOCK_SOURCE_INGLUDES) 100 101 # C++ tests that we don't compile using autotools. 102 EXTRA_DIST += \ 103 test/gmock-actions_test.cc \ 104 test/gmock-cardinalities_test.cc \ 105 test/gmock-generated-actions_test.cc \ 106 test/gmock-generated-function-mockers_test.cc \ 107 test/gmock-generated-internal-utils_test.cc \ 108 test/gmock-generated-matchers_test.cc \ 109 test/gmock-internal-utils_test.cc \ 110 test/gmock-matchers_test.cc \ 111 test/gmock-more-actions_test.cc \ 112 test/gmock-nice-strict_test.cc \ 113 test/gmock-port_test.cc \ 114 test/gmock_all_test.cc 115 116 # Python tests, which we don't run using autotools. 117 EXTRA_DIST += \ 118 test/gmock_leak_test.py \ 119 test/gmock_leak_test_.cc \ 120 test/gmock_output_test.py \ 121 test/gmock_output_test_.cc \ 122 test/gmock_output_test_golden.txt \ 123 test/gmock_test_utils.py 124 125 # Nonstandard package files for distribution. 126 EXTRA_DIST += \ 127 CHANGES \ 128 CONTRIBUTORS \ 129 make/Makefile 130 131 # Pump scripts for generating Google Mock headers. 132 # TODO(chandlerc (a] google.com): automate the generation of *.h from *.h.pump. 133 EXTRA_DIST += \ 134 include/gmock/gmock-generated-actions.h.pump \ 135 include/gmock/gmock-generated-function-mockers.h.pump \ 136 include/gmock/gmock-generated-matchers.h.pump \ 137 include/gmock/gmock-generated-nice-strict.h.pump \ 138 include/gmock/internal/gmock-generated-internal-utils.h.pump 139 140 # Script for fusing Google Mock and Google Test source files. 141 EXTRA_DIST += scripts/fuse_gmock_files.py 142 143 # The Google Mock Generator tool from the cppclean project. 144 EXTRA_DIST += \ 145 scripts/generator/COPYING \ 146 scripts/generator/README \ 147 scripts/generator/README.cppclean \ 148 scripts/generator/cpp/__init__.py \ 149 scripts/generator/cpp/ast.py \ 150 scripts/generator/cpp/gmock_class.py \ 151 scripts/generator/cpp/keywords.py \ 152 scripts/generator/cpp/tokenize.py \ 153 scripts/generator/cpp/utils.py \ 154 scripts/generator/gmock_gen.py 155 156 # CMake scripts. 157 EXTRA_DIST += \ 158 CMakeLists.txt 159 160 # Microsoft Visual Studio 2005 projects. 161 EXTRA_DIST += \ 162 msvc/2005/gmock.sln \ 163 msvc/2005/gmock.vcproj \ 164 msvc/2005/gmock_config.vsprops \ 165 msvc/2005/gmock_main.vcproj \ 166 msvc/2005/gmock_test.vcproj 167 168 # Microsoft Visual Studio 2010 projects. 169 EXTRA_DIST += \ 170 msvc/2010/gmock.sln \ 171 msvc/2010/gmock.vcxproj \ 172 msvc/2010/gmock_config.props \ 173 msvc/2010/gmock_main.vcxproj \ 174 msvc/2010/gmock_test.vcxproj 175 176 # gmock_test.cc does not really depend on files generated by the 177 # fused-gmock-internal rule. However, gmock_test.o does, and it is 178 # important to include test/gmock_test.cc as part of this rule in order to 179 # prevent compiling gmock_test.o until all dependent files have been 180 # generated. 181 $(test_gmock_fused_test_SOURCES): fused-gmock-internal 182 183 # TODO(vladl (a] google.com): Find a way to add Google Tests's sources here. 184 fused-gmock-internal: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \ 185 $(lib_libgmock_la_SOURCES) $(GMOCK_SOURCE_INGLUDES) \ 186 $(lib_libgmock_main_la_SOURCES) \ 187 scripts/fuse_gmock_files.py 188 mkdir -p "$(srcdir)/fused-src" 189 chmod -R u+w "$(srcdir)/fused-src" 190 rm -f "$(srcdir)/fused-src/gtest/gtest.h" 191 rm -f "$(srcdir)/fused-src/gmock/gmock.h" 192 rm -f "$(srcdir)/fused-src/gmock-gtest-all.cc" 193 "$(srcdir)/scripts/fuse_gmock_files.py" "$(srcdir)/fused-src" 194 cp -f "$(srcdir)/src/gmock_main.cc" "$(srcdir)/fused-src" 195 196 maintainer-clean-local: 197 rm -rf "$(srcdir)/fused-src" 198 199 # Death tests may produce core dumps in the build directory. In case 200 # this happens, clean them to keep distcleancheck happy. 201 CLEANFILES = core 202