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