]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/googletest/googletest/Makefile.am
MFC r345203,r345205,r345353,r345645,r345708,r345709,r345735,r345770,r346574,r346576:
[FreeBSD/FreeBSD.git] / contrib / googletest / googletest / Makefile.am
1 # Automake file
2
3 ACLOCAL_AMFLAGS = -I m4
4
5 # Nonstandard package files for distribution
6 EXTRA_DIST = \
7   CHANGES \
8   CONTRIBUTORS \
9   LICENSE \
10   include/gtest/gtest-param-test.h.pump \
11   include/gtest/internal/gtest-param-util-generated.h.pump \
12   include/gtest/internal/gtest-tuple.h.pump \
13   include/gtest/internal/gtest-type-util.h.pump \
14   make/Makefile \
15   scripts/fuse_gtest_files.py \
16   scripts/gen_gtest_pred_impl.py \
17   scripts/pump.py \
18   scripts/test/Makefile
19
20 # gtest source files that we don't compile directly.  They are
21 # #included by gtest-all.cc.
22 GTEST_SRC = \
23   src/gtest-death-test.cc \
24   src/gtest-filepath.cc \
25   src/gtest-internal-inl.h \
26   src/gtest-port.cc \
27   src/gtest-printers.cc \
28   src/gtest-test-part.cc \
29   src/gtest-typed-test.cc \
30   src/gtest.cc
31
32 EXTRA_DIST += $(GTEST_SRC)
33
34 # Sample files that we don't compile.
35 EXTRA_DIST += \
36   samples/prime_tables.h \
37   samples/sample1_unittest.cc \
38   samples/sample2_unittest.cc \
39   samples/sample3_unittest.cc \
40   samples/sample4_unittest.cc \
41   samples/sample5_unittest.cc \
42   samples/sample6_unittest.cc \
43   samples/sample7_unittest.cc \
44   samples/sample8_unittest.cc \
45   samples/sample9_unittest.cc
46
47 # C++ test files that we don't compile directly.
48 EXTRA_DIST += \
49   test/gtest-death-test_ex_test.cc \
50   test/gtest-death-test_test.cc \
51   test/gtest-filepath_test.cc \
52   test/gtest-linked_ptr_test.cc \
53   test/gtest-listener_test.cc \
54   test/gtest-message_test.cc \
55   test/gtest-options_test.cc \
56   test/googletest-param-test2-test.cc \
57   test/googletest-param-test2-test.cc \
58   test/googletest-param-test-test.cc \
59   test/googletest-param-test-test.cc \
60   test/gtest-param-test_test.h \
61   test/gtest-port_test.cc \
62   test/gtest_premature_exit_test.cc \
63   test/gtest-printers_test.cc \
64   test/gtest-test-part_test.cc \
65   test/googletest-tuple-test.cc \
66   test/gtest-typed-test2_test.cc \
67   test/gtest-typed-test_test.cc \
68   test/gtest-typed-test_test.h \
69   test/gtest-unittest-api_test.cc \
70   test/googletest-break-on-failure-unittest_.cc \
71   test/googletest-catch-exceptions-test_.cc \
72   test/googletest-color-test_.cc \
73   test/googletest-env-var-test_.cc \
74   test/gtest_environment_test.cc \
75   test/googletest-filter-unittest_.cc \
76   test/gtest_help_test_.cc \
77   test/googletest-list-tests-unittest_.cc \
78   test/gtest_main_unittest.cc \
79   test/gtest_no_test_unittest.cc \
80   test/googletest-output-test_.cc \
81   test/gtest_pred_impl_unittest.cc \
82   test/gtest_prod_test.cc \
83   test/gtest_repeat_test.cc \
84   test/googletest-shuffle-test_.cc \
85   test/gtest_sole_header_test.cc \
86   test/gtest_stress_test.cc \
87   test/gtest_throw_on_failure_ex_test.cc \
88   test/googletest-throw-on-failure-test_.cc \
89   test/googletest-uninitialized-test_.cc \
90   test/gtest_unittest.cc \
91   test/gtest_unittest.cc \
92   test/gtest_xml_outfile1_test_.cc \
93   test/gtest_xml_outfile2_test_.cc \
94   test/gtest_xml_output_unittest_.cc \
95   test/production.cc \
96   test/production.h
97
98 # Python tests that we don't run.
99 EXTRA_DIST += \
100   test/googletest-break-on-failure-unittest.py \
101   test/googletest-catch-exceptions-test.py \
102   test/googletest-color-test.py \
103   test/googletest-env-var-test.py \
104   test/googletest-filter-unittest.py \
105   test/gtest_help_test.py \
106   test/googletest-list-tests-unittest.py \
107   test/googletest-output-test.py \
108   test/googletest-output-test_golden_lin.txt \
109   test/googletest-shuffle-test.py \
110   test/gtest_test_utils.py \
111   test/googletest-throw-on-failure-test.py \
112   test/googletest-uninitialized-test.py \
113   test/gtest_xml_outfiles_test.py \
114   test/gtest_xml_output_unittest.py \
115   test/gtest_xml_test_utils.py
116
117 # CMake script
118 EXTRA_DIST += \
119   CMakeLists.txt \
120   cmake/internal_utils.cmake
121
122 # MSVC project files
123 EXTRA_DIST += \
124   msvc/2010/gtest-md.sln \
125   msvc/2010/gtest-md.vcxproj \
126   msvc/2010/gtest.sln \
127   msvc/2010/gtest.vcxproj \
128   msvc/2010/gtest_main-md.vcxproj \
129   msvc/2010/gtest_main.vcxproj \
130   msvc/2010/gtest_prod_test-md.vcxproj \
131   msvc/2010/gtest_prod_test.vcxproj \
132   msvc/2010/gtest_unittest-md.vcxproj \
133   msvc/2010/gtest_unittest.vcxproj
134
135 # xcode project files
136 EXTRA_DIST += \
137   xcode/Config/DebugProject.xcconfig \
138   xcode/Config/FrameworkTarget.xcconfig \
139   xcode/Config/General.xcconfig \
140   xcode/Config/ReleaseProject.xcconfig \
141   xcode/Config/StaticLibraryTarget.xcconfig \
142   xcode/Config/TestTarget.xcconfig \
143   xcode/Resources/Info.plist \
144   xcode/Scripts/runtests.sh \
145   xcode/Scripts/versiongenerate.py \
146   xcode/gtest.xcodeproj/project.pbxproj
147
148 # xcode sample files
149 EXTRA_DIST += \
150   xcode/Samples/FrameworkSample/Info.plist \
151   xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj \
152   xcode/Samples/FrameworkSample/runtests.sh \
153   xcode/Samples/FrameworkSample/widget.cc \
154   xcode/Samples/FrameworkSample/widget.h \
155   xcode/Samples/FrameworkSample/widget_test.cc
156
157 # C++Builder project files
158 EXTRA_DIST += \
159   codegear/gtest.cbproj \
160   codegear/gtest.groupproj \
161   codegear/gtest_all.cc \
162   codegear/gtest_link.cc \
163   codegear/gtest_main.cbproj \
164   codegear/gtest_unittest.cbproj
165
166 # Distribute and install M4 macro
167 m4datadir = $(datadir)/aclocal
168 m4data_DATA = m4/gtest.m4
169 EXTRA_DIST += $(m4data_DATA)
170
171 # We define the global AM_CPPFLAGS as everything we compile includes from these
172 # directories.
173 AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/include
174
175 # Modifies compiler and linker flags for pthreads compatibility.
176 if HAVE_PTHREADS
177   AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1
178   AM_LIBS = @PTHREAD_LIBS@
179 else
180   AM_CXXFLAGS = -DGTEST_HAS_PTHREAD=0
181 endif
182
183 # Build rules for libraries.
184 lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la
185
186 lib_libgtest_la_SOURCES = src/gtest-all.cc
187
188 pkginclude_HEADERS = \
189   include/gtest/gtest-death-test.h \
190   include/gtest/gtest-message.h \
191   include/gtest/gtest-param-test.h \
192   include/gtest/gtest-printers.h \
193   include/gtest/gtest-spi.h \
194   include/gtest/gtest-test-part.h \
195   include/gtest/gtest-typed-test.h \
196   include/gtest/gtest.h \
197   include/gtest/gtest_pred_impl.h \
198   include/gtest/gtest_prod.h
199
200 pkginclude_internaldir = $(pkgincludedir)/internal
201 pkginclude_internal_HEADERS = \
202   include/gtest/internal/gtest-death-test-internal.h \
203   include/gtest/internal/gtest-filepath.h \
204   include/gtest/internal/gtest-internal.h \
205   include/gtest/internal/gtest-linked_ptr.h \
206   include/gtest/internal/gtest-param-util-generated.h \
207   include/gtest/internal/gtest-param-util.h \
208   include/gtest/internal/gtest-port.h \
209   include/gtest/internal/gtest-port-arch.h \
210   include/gtest/internal/gtest-string.h \
211   include/gtest/internal/gtest-tuple.h \
212   include/gtest/internal/gtest-type-util.h \
213   include/gtest/internal/custom/gtest.h \
214   include/gtest/internal/custom/gtest-port.h \
215   include/gtest/internal/custom/gtest-printers.h
216
217 lib_libgtest_main_la_SOURCES = src/gtest_main.cc
218 lib_libgtest_main_la_LIBADD = lib/libgtest.la
219
220 # Build rules for samples and tests. Automake's naming for some of
221 # these variables isn't terribly obvious, so this is a brief
222 # reference:
223 #
224 # TESTS -- Programs run automatically by "make check"
225 # check_PROGRAMS -- Programs built by "make check" but not necessarily run
226
227 TESTS=
228 TESTS_ENVIRONMENT = GTEST_SOURCE_DIR="$(srcdir)/test" \
229                     GTEST_BUILD_DIR="$(top_builddir)/test"
230 check_PROGRAMS=
231
232 # A simple sample on using gtest.
233 TESTS += samples/sample1_unittest \
234     samples/sample2_unittest \
235     samples/sample3_unittest \
236     samples/sample4_unittest \
237     samples/sample5_unittest \
238     samples/sample6_unittest \
239     samples/sample7_unittest \
240     samples/sample8_unittest \
241     samples/sample9_unittest \
242     samples/sample10_unittest
243 check_PROGRAMS += samples/sample1_unittest \
244     samples/sample2_unittest \
245     samples/sample3_unittest \
246     samples/sample4_unittest \
247     samples/sample5_unittest \
248     samples/sample6_unittest \
249     samples/sample7_unittest \
250     samples/sample8_unittest \
251     samples/sample9_unittest \
252     samples/sample10_unittest
253
254 samples_sample1_unittest_SOURCES = samples/sample1_unittest.cc samples/sample1.cc
255 samples_sample1_unittest_LDADD = lib/libgtest_main.la \
256                                  lib/libgtest.la
257 samples_sample2_unittest_SOURCES = samples/sample2_unittest.cc samples/sample2.cc
258 samples_sample2_unittest_LDADD = lib/libgtest_main.la \
259                                  lib/libgtest.la
260 samples_sample3_unittest_SOURCES = samples/sample3_unittest.cc
261 samples_sample3_unittest_LDADD = lib/libgtest_main.la \
262                                  lib/libgtest.la
263 samples_sample4_unittest_SOURCES = samples/sample4_unittest.cc samples/sample4.cc
264 samples_sample4_unittest_LDADD = lib/libgtest_main.la \
265                                  lib/libgtest.la
266 samples_sample5_unittest_SOURCES = samples/sample5_unittest.cc samples/sample1.cc
267 samples_sample5_unittest_LDADD = lib/libgtest_main.la \
268                                  lib/libgtest.la
269 samples_sample6_unittest_SOURCES = samples/sample6_unittest.cc
270 samples_sample6_unittest_LDADD = lib/libgtest_main.la \
271                                  lib/libgtest.la
272 samples_sample7_unittest_SOURCES = samples/sample7_unittest.cc
273 samples_sample7_unittest_LDADD = lib/libgtest_main.la \
274                                  lib/libgtest.la
275 samples_sample8_unittest_SOURCES = samples/sample8_unittest.cc
276 samples_sample8_unittest_LDADD = lib/libgtest_main.la \
277                                  lib/libgtest.la
278
279 # Also verify that libgtest works by itself.
280 samples_sample9_unittest_SOURCES = samples/sample9_unittest.cc
281 samples_sample9_unittest_LDADD = lib/libgtest.la
282 samples_sample10_unittest_SOURCES = samples/sample10_unittest.cc
283 samples_sample10_unittest_LDADD = lib/libgtest.la
284
285 # This tests most constructs of gtest and verifies that libgtest_main
286 # and libgtest work.
287 TESTS += test/gtest_all_test
288 check_PROGRAMS += test/gtest_all_test
289 test_gtest_all_test_SOURCES = test/gtest_all_test.cc
290 test_gtest_all_test_LDADD = lib/libgtest_main.la \
291                             lib/libgtest.la
292
293 TESTS += test/gtest_skip_in_environment_setup_test
294 check_PROGRAMS += test/gtest_skip_in_environment_setup_test
295 test_gtest_skip_in_environment_setup_test_SOURCES = test/gtest_skip_in_environment_setup_test.cc
296 test_gtest_skip_in_environment_setup_test_LDADD= lib/libgtest_main.la \
297                                                  lib/libgtest.la
298
299 # Tests that fused gtest files compile and work.
300 FUSED_GTEST_SRC = \
301   fused-src/gtest/gtest-all.cc \
302   fused-src/gtest/gtest.h \
303   fused-src/gtest/gtest_main.cc
304
305 if HAVE_PYTHON
306 TESTS += test/fused_gtest_test
307 check_PROGRAMS += test/fused_gtest_test
308 test_fused_gtest_test_SOURCES = $(FUSED_GTEST_SRC) \
309                                 samples/sample1.cc samples/sample1_unittest.cc
310 test_fused_gtest_test_CPPFLAGS = -I"$(srcdir)/fused-src"
311
312 # Build rules for putting fused Google Test files into the distribution
313 # package. The user can also create those files by manually running
314 # scripts/fuse_gtest_files.py.
315 $(test_fused_gtest_test_SOURCES): fused-gtest
316
317 fused-gtest: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
318              $(GTEST_SRC) src/gtest-all.cc src/gtest_main.cc \
319              scripts/fuse_gtest_files.py
320         mkdir -p "$(srcdir)/fused-src"
321         chmod -R u+w "$(srcdir)/fused-src"
322         rm -f "$(srcdir)/fused-src/gtest/gtest-all.cc"
323         rm -f "$(srcdir)/fused-src/gtest/gtest.h"
324         "$(srcdir)/scripts/fuse_gtest_files.py" "$(srcdir)/fused-src"
325         cp -f "$(srcdir)/src/gtest_main.cc" "$(srcdir)/fused-src/gtest/"
326
327 maintainer-clean-local:
328         rm -rf "$(srcdir)/fused-src"
329 endif
330
331 # Death tests may produce core dumps in the build directory. In case
332 # this happens, clean them to keep distcleancheck happy.
333 CLEANFILES = core
334
335 # Disables 'make install' as installing a compiled version of Google
336 # Test can lead to undefined behavior due to violation of the
337 # One-Definition Rule.
338
339 install-exec-local:
340         echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
341         false
342
343 install-data-local:
344         echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
345         false