blob: 0afce2f86ce9c72441b045f7994e4a6ba2ceeb23 [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.
4EXTRA_DIST =
5
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 \
37 include/gmock/gmock-spec-builders.h \
38 include/gmock/gmock.h
shiqiane35fdd92008-12-10 05:08:54 +000039
40pkginclude_internaldir = $(pkgincludedir)/internal
41pkginclude_internal_HEADERS = \
42 include/gmock/internal/gmock-generated-internal-utils.h \
43 include/gmock/internal/gmock-internal-utils.h \
44 include/gmock/internal/gmock-port.h
45
46lib_libgmock_main_la_SOURCES = src/gmock_main.cc
47lib_libgmock_main_la_LIBADD = lib/libgmock.la
48
49# Build rules for tests. Automake's naming for some of these variables isn't
50# terribly obvious, so this is a brief reference:
51#
52# TESTS -- Programs run automatically by "make check"
53# check_PROGRAMS -- Programs built by "make check" but not necessarily run
54
55TESTS=
shiqiane35fdd92008-12-10 05:08:54 +000056check_PROGRAMS=
57AM_LDFLAGS = $(GTEST_LDFLAGS)
58
zhanyong.wan284b54d2009-12-18 08:00:42 +000059# This exercises all major components of Google Mock. It also
60# verifies that libgmock works.
61TESTS += test/gmock-spec-builders_test
62check_PROGRAMS += test/gmock-spec-builders_test
63test_gmock_spec_builders_test_SOURCES = test/gmock-spec-builders_test.cc
64test_gmock_spec_builders_test_LDADD = $(GTEST_LIBS) lib/libgmock.la
shiqiane35fdd92008-12-10 05:08:54 +000065
zhanyong.wan284b54d2009-12-18 08:00:42 +000066# This tests using Google Mock in multiple translation units. It also
zhanyong.wan8e687532011-04-07 07:19:40 +000067# verifies that libgmock_main and libgmock work.
shiqiane35fdd92008-12-10 05:08:54 +000068TESTS += test/gmock_link_test
69check_PROGRAMS += test/gmock_link_test
zhanyong.wanccedc1c2010-08-09 22:46:12 +000070test_gmock_link_test_SOURCES = \
71 test/gmock_link2_test.cc \
72 test/gmock_link_test.cc \
73 test/gmock_link_test.h
zhanyong.wan8e687532011-04-07 07:19:40 +000074test_gmock_link_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la lib/libgmock.la
shiqiane35fdd92008-12-10 05:08:54 +000075
vladloseva63da042011-04-21 21:56:01 +000076if HAVE_PYTHON
77 # Tests that fused gmock files compile and work.
78 TESTS += test/gmock_fused_test
79 check_PROGRAMS += test/gmock_fused_test
80 test_gmock_fused_test_SOURCES = \
81 fused-src/gmock-gtest-all.cc \
82 fused-src/gmock/gmock.h \
83 fused-src/gmock_main.cc \
84 fused-src/gtest/gtest.h \
85 test/gmock_test.cc
86 test_gmock_fused_test_CPPFLAGS = -I"$(srcdir)/fused-src"
87endif
zhanyong.wand19f5862010-04-14 16:26:57 +000088
zhanyong.wan284b54d2009-12-18 08:00:42 +000089# Google Mock source files that we don't compile directly.
zhanyong.wand19f5862010-04-14 16:26:57 +000090GMOCK_SOURCE_INGLUDES = \
zhanyong.wan284b54d2009-12-18 08:00:42 +000091 src/gmock-cardinalities.cc \
92 src/gmock-internal-utils.cc \
93 src/gmock-matchers.cc \
zhanyong.wanccedc1c2010-08-09 22:46:12 +000094 src/gmock-spec-builders.cc \
95 src/gmock.cc
shiqiane35fdd92008-12-10 05:08:54 +000096
zhanyong.wand19f5862010-04-14 16:26:57 +000097EXTRA_DIST += $(GMOCK_SOURCE_INGLUDES)
98
zhanyong.wan284b54d2009-12-18 08:00:42 +000099# C++ tests that we don't compile using autotools.
100EXTRA_DIST += \
zhanyong.wan284b54d2009-12-18 08:00:42 +0000101 test/gmock-actions_test.cc \
102 test/gmock-cardinalities_test.cc \
103 test/gmock-generated-actions_test.cc \
104 test/gmock-generated-function-mockers_test.cc \
105 test/gmock-generated-internal-utils_test.cc \
106 test/gmock-generated-matchers_test.cc \
107 test/gmock-internal-utils_test.cc \
108 test/gmock-matchers_test.cc \
109 test/gmock-more-actions_test.cc \
110 test/gmock-nice-strict_test.cc \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000111 test/gmock-port_test.cc \
112 test/gmock_all_test.cc
zhanyong.wana18423e2009-07-22 23:58:19 +0000113
zhanyong.wan284b54d2009-12-18 08:00:42 +0000114# Python tests, which we don't run using autotools.
115EXTRA_DIST += \
zhanyong.wan284b54d2009-12-18 08:00:42 +0000116 test/gmock_leak_test.py \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000117 test/gmock_leak_test_.cc \
zhanyong.wan284b54d2009-12-18 08:00:42 +0000118 test/gmock_output_test.py \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000119 test/gmock_output_test_.cc \
120 test/gmock_output_test_golden.txt \
121 test/gmock_test_utils.py
shiqiane35fdd92008-12-10 05:08:54 +0000122
123# Nonstandard package files for distribution.
124EXTRA_DIST += \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000125 CHANGES \
126 CONTRIBUTORS \
127 make/Makefile
shiqiane35fdd92008-12-10 05:08:54 +0000128
129# Pump scripts for generating Google Mock headers.
130# TODO(chandlerc@google.com): automate the generation of *.h from *.h.pump.
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000131EXTRA_DIST += \
132 include/gmock/gmock-generated-actions.h.pump \
133 include/gmock/gmock-generated-function-mockers.h.pump \
134 include/gmock/gmock-generated-matchers.h.pump \
135 include/gmock/gmock-generated-nice-strict.h.pump \
136 include/gmock/internal/gmock-generated-internal-utils.h.pump
shiqiane35fdd92008-12-10 05:08:54 +0000137
zhanyong.wan56fe7462009-04-09 03:01:25 +0000138# Script for fusing Google Mock and Google Test source files.
zhanyong.wan33605ba2010-04-22 23:37:47 +0000139EXTRA_DIST += scripts/fuse_gmock_files.py
zhanyong.wan56fe7462009-04-09 03:01:25 +0000140
shiqiane35fdd92008-12-10 05:08:54 +0000141# The Google Mock Generator tool from the cppclean project.
142EXTRA_DIST += \
vladlosev5aa8dd92011-09-09 07:06:32 +0000143 scripts/generator/LICENSE \
zhanyong.wanccedc1c2010-08-09 22:46:12 +0000144 scripts/generator/README \
145 scripts/generator/README.cppclean \
146 scripts/generator/cpp/__init__.py \
147 scripts/generator/cpp/ast.py \
148 scripts/generator/cpp/gmock_class.py \
149 scripts/generator/cpp/keywords.py \
150 scripts/generator/cpp/tokenize.py \
151 scripts/generator/cpp/utils.py \
152 scripts/generator/gmock_gen.py
shiqiane35fdd92008-12-10 05:08:54 +0000153
zhanyong.wan62a35fb2011-02-24 21:59:54 +0000154# CMake scripts.
155EXTRA_DIST += \
156 CMakeLists.txt
157
shiqianc6cece72008-12-10 07:50:41 +0000158# Microsoft Visual Studio 2005 projects.
159EXTRA_DIST += \
vladlosevb3e90422011-02-12 01:56:45 +0000160 msvc/2005/gmock.sln \
161 msvc/2005/gmock.vcproj \
162 msvc/2005/gmock_config.vsprops \
163 msvc/2005/gmock_main.vcproj \
164 msvc/2005/gmock_test.vcproj
165
166# Microsoft Visual Studio 2010 projects.
167EXTRA_DIST += \
168 msvc/2010/gmock.sln \
169 msvc/2010/gmock.vcxproj \
170 msvc/2010/gmock_config.props \
171 msvc/2010/gmock_main.vcxproj \
172 msvc/2010/gmock_test.vcxproj
zhanyong.wand19f5862010-04-14 16:26:57 +0000173
vladloseva63da042011-04-21 21:56:01 +0000174if HAVE_PYTHON
zhanyong.wand19f5862010-04-14 16:26:57 +0000175# gmock_test.cc does not really depend on files generated by the
176# fused-gmock-internal rule. However, gmock_test.o does, and it is
177# important to include test/gmock_test.cc as part of this rule in order to
178# prevent compiling gmock_test.o until all dependent files have been
179# generated.
180$(test_gmock_fused_test_SOURCES): fused-gmock-internal
181
182# TODO(vladl@google.com): Find a way to add Google Tests's sources here.
183fused-gmock-internal: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
184 $(lib_libgmock_la_SOURCES) $(GMOCK_SOURCE_INGLUDES) \
185 $(lib_libgmock_main_la_SOURCES) \
186 scripts/fuse_gmock_files.py
187 mkdir -p "$(srcdir)/fused-src"
188 chmod -R u+w "$(srcdir)/fused-src"
189 rm -f "$(srcdir)/fused-src/gtest/gtest.h"
190 rm -f "$(srcdir)/fused-src/gmock/gmock.h"
191 rm -f "$(srcdir)/fused-src/gmock-gtest-all.cc"
192 "$(srcdir)/scripts/fuse_gmock_files.py" "$(srcdir)/fused-src"
193 cp -f "$(srcdir)/src/gmock_main.cc" "$(srcdir)/fused-src"
194
195maintainer-clean-local:
196 rm -rf "$(srcdir)/fused-src"
vladloseva63da042011-04-21 21:56:01 +0000197endif
zhanyong.wand19f5862010-04-14 16:26:57 +0000198
199# Death tests may produce core dumps in the build directory. In case
200# this happens, clean them to keep distcleancheck happy.
201CLEANFILES = core
zhanyong.wan52277c92011-04-07 07:37:28 +0000202
203# Disables 'make install' as installing a compiled version of Google
204# Mock can lead to undefined behavior due to violation of the
205# One-Definition Rule.
206
207install-exec-local:
208 echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system."
209 false
210
211install-data-local:
212 echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system."
213 false