blob: 9adbc5163dd7191a14a887a384fb5d6d2956b44d [file] [log] [blame]
zhanyong.wan5905ba02010-02-24 17:21:37 +00001# Automake file
2
shiqiane35fdd92008-12-10 05:08:54 +00003# Nonstandard package files for distribution.
vladlosev40fa8ff2013-01-31 19:53:54 +00004EXTRA_DIST = LICENSE
shiqiane35fdd92008-12-10 05:08:54 +00005
shiqiana92e4962008-12-10 18:34:33 +00006# We may need to build our internally packaged gtest. If so, it will be
7# included in the 'subdirs' variable.
8SUBDIRS = $(subdirs)
9
shiqian281b1d22008-12-11 00:13:55 +000010# This is generated by the configure script, so clean it for distribution.
11DISTCLEANFILES = scripts/gmock-config
shiqiane35fdd92008-12-10 05:08:54 +000012
13# We define the global AM_CPPFLAGS as everything we compile includes from these
14# directories.
15AM_CPPFLAGS = $(GTEST_CPPFLAGS) -I$(srcdir)/include
16
zhanyong.wan5905ba02010-02-24 17:21:37 +000017# Modifies compiler and linker flags for pthreads compatibility.
18if HAVE_PTHREADS
19 AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1
20 AM_LIBS = @PTHREAD_LIBS@
21endif
22
shiqiane35fdd92008-12-10 05:08:54 +000023# Build rules for libraries.
24lib_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la
25
zhanyong.wan284b54d2009-12-18 08:00:42 +000026lib_libgmock_la_SOURCES = src/gmock-all.cc
shiqiane35fdd92008-12-10 05:08:54 +000027
zhanyong.wanccedc1c2010-08-09 22:46:12 +000028pkginclude_HEADERS = \
29 include/gmock/gmock-actions.h \
30 include/gmock/gmock-cardinalities.h \
31 include/gmock/gmock-generated-actions.h \
32 include/gmock/gmock-generated-function-mockers.h \
33 include/gmock/gmock-generated-matchers.h \
34 include/gmock/gmock-generated-nice-strict.h \
35 include/gmock/gmock-matchers.h \
36 include/gmock/gmock-more-actions.h \
zhanyong.wan35da8142013-08-27 21:04:16 +000037 include/gmock/gmock-more-matchers.h \
zhanyong.wanccedc1c2010-08-09 22:46:12 +000038 include/gmock/gmock-spec-builders.h \
39 include/gmock/gmock.h
shiqiane35fdd92008-12-10 05:08:54 +000040
41pkginclude_internaldir = $(pkgincludedir)/internal
42pkginclude_internal_HEADERS = \
43 include/gmock/internal/gmock-generated-internal-utils.h \
44 include/gmock/internal/gmock-internal-utils.h \
Martin Maly210392e2015-09-19 23:10:58 -070045 include/gmock/internal/gmock-port.h \
46 include/gmock/internal/custom/gmock-generated-actions.h \
47 include/gmock/internal/custom/gmock-matchers.h \
48 include/gmock/internal/custom/gmock-port.h
shiqiane35fdd92008-12-10 05:08:54 +000049
50lib_libgmock_main_la_SOURCES = src/gmock_main.cc
51lib_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
59TESTS=
shiqiane35fdd92008-12-10 05:08:54 +000060check_PROGRAMS=
61AM_LDFLAGS = $(GTEST_LDFLAGS)
62
zhanyong.wan284b54d2009-12-18 08:00:42 +000063# This exercises all major components of Google Mock. It also
64# verifies that libgmock works.
65TESTS += test/gmock-spec-builders_test
66check_PROGRAMS += test/gmock-spec-builders_test
67test_gmock_spec_builders_test_SOURCES = test/gmock-spec-builders_test.cc
68test_gmock_spec_builders_test_LDADD = $(GTEST_LIBS) lib/libgmock.la
shiqiane35fdd92008-12-10 05:08:54 +000069
zhanyong.wan284b54d2009-12-18 08:00:42 +000070# This tests using Google Mock in multiple translation units. It also
zhanyong.wan8e687532011-04-07 07:19:40 +000071# verifies that libgmock_main and libgmock work.
shiqiane35fdd92008-12-10 05:08:54 +000072TESTS += test/gmock_link_test
73check_PROGRAMS += test/gmock_link_test
zhanyong.wanccedc1c2010-08-09 22:46:12 +000074test_gmock_link_test_SOURCES = \
75 test/gmock_link2_test.cc \
76 test/gmock_link_test.cc \
77 test/gmock_link_test.h
zhanyong.wan8e687532011-04-07 07:19:40 +000078test_gmock_link_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la lib/libgmock.la
shiqiane35fdd92008-12-10 05:08:54 +000079
vladloseva63da042011-04-21 21:56:01 +000080if HAVE_PYTHON
81 # Tests that fused gmock files compile and work.
82 TESTS += test/gmock_fused_test
83 check_PROGRAMS += test/gmock_fused_test
84 test_gmock_fused_test_SOURCES = \
85 fused-src/gmock-gtest-all.cc \
86 fused-src/gmock/gmock.h \
87 fused-src/gmock_main.cc \
88 fused-src/gtest/gtest.h \
89 test/gmock_test.cc
90 test_gmock_fused_test_CPPFLAGS = -I"$(srcdir)/fused-src"
91endif
zhanyong.wand19f5862010-04-14 16:26:57 +000092
zhanyong.wan284b54d2009-12-18 08:00:42 +000093# Google Mock source files that we don't compile directly.
zhanyong.wand19f5862010-04-14 16:26:57 +000094GMOCK_SOURCE_INGLUDES = \
zhanyong.wan284b54d2009-12-18 08:00:42 +000095 src/gmock-cardinalities.cc \
96 src/gmock-internal-utils.cc \
97 src/gmock-matchers.cc \
zhanyong.wanccedc1c2010-08-09 22:46:12 +000098 src/gmock-spec-builders.cc \
99 src/gmock.cc
shiqiane35fdd92008-12-10 05:08:54 +0000100
zhanyong.wand19f5862010-04-14 16:26:57 +0000101EXTRA_DIST += $(GMOCK_SOURCE_INGLUDES)
102
zhanyong.wan284b54d2009-12-18 08:00:42 +0000103# C++ tests that we don't compile using autotools.
104EXTRA_DIST += \
zhanyong.wan284b54d2009-12-18 08:00:42 +0000105 test/gmock-actions_test.cc \
zhanyong.wan778358e2013-08-27 21:31:58 +0000106 test/gmock_all_test.cc \
zhanyong.wan284b54d2009-12-18 08:00:42 +0000107 test/gmock-cardinalities_test.cc \
zhanyong.wan778358e2013-08-27 21:31:58 +0000108 test/gmock_ex_test.cc \
zhanyong.wan284b54d2009-12-18 08:00:42 +0000109 test/gmock-generated-actions_test.cc \
110 test/gmock-generated-function-mockers_test.cc \
111 test/gmock-generated-internal-utils_test.cc \
112 test/gmock-generated-matchers_test.cc \
113 test/gmock-internal-utils_test.cc \
114 test/gmock-matchers_test.cc \
115 test/gmock-more-actions_test.cc \
116 test/gmock-nice-strict_test.cc \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000117 test/gmock-port_test.cc \
zhanyong.wan778358e2013-08-27 21:31:58 +0000118 test/gmock_stress_test.cc
zhanyong.wana18423e2009-07-22 23:58:19 +0000119
zhanyong.wan284b54d2009-12-18 08:00:42 +0000120# Python tests, which we don't run using autotools.
121EXTRA_DIST += \
zhanyong.wan284b54d2009-12-18 08:00:42 +0000122 test/gmock_leak_test.py \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000123 test/gmock_leak_test_.cc \
zhanyong.wan284b54d2009-12-18 08:00:42 +0000124 test/gmock_output_test.py \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000125 test/gmock_output_test_.cc \
126 test/gmock_output_test_golden.txt \
127 test/gmock_test_utils.py
shiqiane35fdd92008-12-10 05:08:54 +0000128
129# Nonstandard package files for distribution.
130EXTRA_DIST += \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000131 CHANGES \
132 CONTRIBUTORS \
133 make/Makefile
shiqiane35fdd92008-12-10 05:08:54 +0000134
135# Pump scripts for generating Google Mock headers.
136# TODO(chandlerc@google.com): automate the generation of *.h from *.h.pump.
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000137EXTRA_DIST += \
138 include/gmock/gmock-generated-actions.h.pump \
139 include/gmock/gmock-generated-function-mockers.h.pump \
140 include/gmock/gmock-generated-matchers.h.pump \
141 include/gmock/gmock-generated-nice-strict.h.pump \
Martin Maly210392e2015-09-19 23:10:58 -0700142 include/gmock/internal/gmock-generated-internal-utils.h.pump \
143 include/gmock/internal/custom/gmock-generated-actions.h.pump
shiqiane35fdd92008-12-10 05:08:54 +0000144
zhanyong.wan56fe7462009-04-09 03:01:25 +0000145# Script for fusing Google Mock and Google Test source files.
zhanyong.wan33605ba2010-04-22 23:37:47 +0000146EXTRA_DIST += scripts/fuse_gmock_files.py
zhanyong.wan56fe7462009-04-09 03:01:25 +0000147
shiqiane35fdd92008-12-10 05:08:54 +0000148# The Google Mock Generator tool from the cppclean project.
149EXTRA_DIST += \
vladlosev5aa8dd92011-09-09 07:06:32 +0000150 scripts/generator/LICENSE \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000151 scripts/generator/README \
152 scripts/generator/README.cppclean \
153 scripts/generator/cpp/__init__.py \
154 scripts/generator/cpp/ast.py \
155 scripts/generator/cpp/gmock_class.py \
156 scripts/generator/cpp/keywords.py \
157 scripts/generator/cpp/tokenize.py \
158 scripts/generator/cpp/utils.py \
159 scripts/generator/gmock_gen.py
shiqiane35fdd92008-12-10 05:08:54 +0000160
zhanyong.wan88080ee2013-11-21 18:38:42 +0000161# Script for diagnosing compiler errors in programs that use Google
162# Mock.
163EXTRA_DIST += scripts/gmock_doctor.py
164
zhanyong.wan62a35fb2011-02-24 21:59:54 +0000165# CMake scripts.
166EXTRA_DIST += \
167 CMakeLists.txt
168
shiqianc6cece72008-12-10 07:50:41 +0000169# Microsoft Visual Studio 2005 projects.
170EXTRA_DIST += \
vladlosevb3e90422011-02-12 01:56:45 +0000171 msvc/2005/gmock.sln \
172 msvc/2005/gmock.vcproj \
173 msvc/2005/gmock_config.vsprops \
174 msvc/2005/gmock_main.vcproj \
175 msvc/2005/gmock_test.vcproj
176
177# Microsoft Visual Studio 2010 projects.
178EXTRA_DIST += \
179 msvc/2010/gmock.sln \
180 msvc/2010/gmock.vcxproj \
181 msvc/2010/gmock_config.props \
182 msvc/2010/gmock_main.vcxproj \
183 msvc/2010/gmock_test.vcxproj
zhanyong.wand19f5862010-04-14 16:26:57 +0000184
vladloseva63da042011-04-21 21:56:01 +0000185if HAVE_PYTHON
zhanyong.wand19f5862010-04-14 16:26:57 +0000186# gmock_test.cc does not really depend on files generated by the
187# fused-gmock-internal rule. However, gmock_test.o does, and it is
188# important to include test/gmock_test.cc as part of this rule in order to
189# prevent compiling gmock_test.o until all dependent files have been
190# generated.
191$(test_gmock_fused_test_SOURCES): fused-gmock-internal
192
193# TODO(vladl@google.com): Find a way to add Google Tests's sources here.
194fused-gmock-internal: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
195 $(lib_libgmock_la_SOURCES) $(GMOCK_SOURCE_INGLUDES) \
196 $(lib_libgmock_main_la_SOURCES) \
197 scripts/fuse_gmock_files.py
198 mkdir -p "$(srcdir)/fused-src"
199 chmod -R u+w "$(srcdir)/fused-src"
200 rm -f "$(srcdir)/fused-src/gtest/gtest.h"
201 rm -f "$(srcdir)/fused-src/gmock/gmock.h"
202 rm -f "$(srcdir)/fused-src/gmock-gtest-all.cc"
203 "$(srcdir)/scripts/fuse_gmock_files.py" "$(srcdir)/fused-src"
204 cp -f "$(srcdir)/src/gmock_main.cc" "$(srcdir)/fused-src"
205
206maintainer-clean-local:
207 rm -rf "$(srcdir)/fused-src"
vladloseva63da042011-04-21 21:56:01 +0000208endif
zhanyong.wand19f5862010-04-14 16:26:57 +0000209
210# Death tests may produce core dumps in the build directory. In case
211# this happens, clean them to keep distcleancheck happy.
212CLEANFILES = core
zhanyong.wan52277c92011-04-07 07:37:28 +0000213
214# Disables 'make install' as installing a compiled version of Google
215# Mock can lead to undefined behavior due to violation of the
216# One-Definition Rule.
217
218install-exec-local:
219 echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system."
220 false
221
222install-data-local:
223 echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system."
224 false