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