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