Makefile.am 7.4 KB

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