Makefile.am 9.46 KB
Newer Older
shiqian's avatar
shiqian committed
1
2
# Automake file

3
4
ACLOCAL_AMFLAGS = -I m4

shiqian's avatar
shiqian committed
5
6
7
8
# Nonstandard package files for distribution
EXTRA_DIST = \
  CHANGES \
  CONTRIBUTORS \
9
  include/gtest/gtest-param-test.h.pump \
10
  include/gtest/internal/gtest-param-util-generated.h.pump \
11
  include/gtest/internal/gtest-tuple.h.pump \
12
  include/gtest/internal/gtest-type-util.h.pump \
13
  make/Makefile \
14
  scripts/fuse_gtest_files.py \
shiqian's avatar
shiqian committed
15
  scripts/gen_gtest_pred_impl.py \
zhanyong.wan's avatar
zhanyong.wan committed
16
  scripts/pump.py \
17
18
  scripts/test/Makefile

19
20
21
# gtest source files that we don't compile directly.  They are
# #included by gtest-all.cc.
GTEST_SRC = \
22
23
24
25
  src/gtest-death-test.cc \
  src/gtest-filepath.cc \
  src/gtest-internal-inl.h \
  src/gtest-port.cc \
26
  src/gtest-printers.cc \
27
  src/gtest-test-part.cc \
28
29
  src/gtest-typed-test.cc \
  src/gtest.cc
30

31
32
EXTRA_DIST += $(GTEST_SRC)

33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Sample files that we don't compile.
EXTRA_DIST += \
  samples/prime_tables.h \
  samples/sample2_unittest.cc \
  samples/sample3_unittest.cc \
  samples/sample4_unittest.cc \
  samples/sample5_unittest.cc \
  samples/sample6_unittest.cc \
  samples/sample7_unittest.cc \
  samples/sample8_unittest.cc \
  samples/sample9_unittest.cc

# C++ test files that we don't compile directly.
EXTRA_DIST += \
47
  test/gtest-death-test_ex_test.cc \
48
49
50
  test/gtest-death-test_test.cc \
  test/gtest-filepath_test.cc \
  test/gtest-linked_ptr_test.cc \
51
  test/gtest-listener_test.cc \
52
53
54
  test/gtest-message_test.cc \
  test/gtest-options_test.cc \
  test/gtest-param-test2_test.cc \
55
56
57
  test/gtest-param-test2_test.cc \
  test/gtest-param-test_test.cc \
  test/gtest-param-test_test.cc \
58
59
  test/gtest-param-test_test.h \
  test/gtest-port_test.cc \
60
  test/gtest-printers_test.cc \
61
  test/gtest-test-part_test.cc \
62
  test/gtest-tuple_test.cc \
63
  test/gtest-typed-test2_test.cc \
64
  test/gtest-typed-test_test.cc \
65
66
67
  test/gtest-typed-test_test.h \
  test/gtest-unittest-api_test.cc \
  test/gtest_break_on_failure_unittest_.cc \
68
  test/gtest_catch_exceptions_test_.cc \
69
70
  test/gtest_color_test_.cc \
  test/gtest_env_var_test_.cc \
71
  test/gtest_environment_test.cc \
72
73
74
  test/gtest_filter_unittest_.cc \
  test/gtest_help_test_.cc \
  test/gtest_list_tests_unittest_.cc \
75
76
  test/gtest_main_unittest.cc \
  test/gtest_no_test_unittest.cc \
77
  test/gtest_output_test_.cc \
78
79
80
  test/gtest_pred_impl_unittest.cc \
  test/gtest_prod_test.cc \
  test/gtest_repeat_test.cc \
81
  test/gtest_shuffle_test_.cc \
82
83
84
  test/gtest_sole_header_test.cc \
  test/gtest_stress_test.cc \
  test/gtest_throw_on_failure_ex_test.cc \
85
86
  test/gtest_throw_on_failure_test_.cc \
  test/gtest_uninitialized_test_.cc \
87
88
  test/gtest_unittest.cc \
  test/gtest_unittest.cc \
89
90
  test/gtest_xml_outfile1_test_.cc \
  test/gtest_xml_outfile2_test_.cc \
91
92
93
  test/gtest_xml_output_unittest_.cc \
  test/production.cc \
  test/production.h
94
95
96
97

# Python tests that we don't run.
EXTRA_DIST += \
  test/gtest_break_on_failure_unittest.py \
98
  test/gtest_catch_exceptions_test.py \
99
100
101
102
103
104
105
106
  test/gtest_color_test.py \
  test/gtest_env_var_test.py \
  test/gtest_filter_unittest.py \
  test/gtest_help_test.py \
  test/gtest_list_tests_unittest.py \
  test/gtest_output_test.py \
  test/gtest_output_test_golden_lin.txt \
  test/gtest_shuffle_test.py \
107
  test/gtest_test_utils.py \
108
109
110
  test/gtest_throw_on_failure_test.py \
  test/gtest_uninitialized_test.py \
  test/gtest_xml_outfiles_test.py \
111
112
  test/gtest_xml_output_unittest.py \
  test/gtest_xml_test_utils.py
shiqian's avatar
shiqian committed
113

114
115
# CMake script
EXTRA_DIST += \
116
117
  CMakeLists.txt \
  cmake/internal_utils.cmake
118

119
120
# MSVC project files
EXTRA_DIST += \
121
122
  msvc/gtest-md.sln \
  msvc/gtest-md.vcproj \
123
  msvc/gtest.sln \
124
  msvc/gtest.vcproj \
125
  msvc/gtest_main-md.vcproj \
126
  msvc/gtest_main.vcproj \
127
  msvc/gtest_prod_test-md.vcproj \
128
  msvc/gtest_prod_test.vcproj \
129
  msvc/gtest_unittest-md.vcproj \
zhanyong.wan's avatar
zhanyong.wan committed
130
  msvc/gtest_unittest.vcproj
131

132
133
134
135
136
137
# xcode project files
EXTRA_DIST += \
  xcode/Config/DebugProject.xcconfig \
  xcode/Config/FrameworkTarget.xcconfig \
  xcode/Config/General.xcconfig \
  xcode/Config/ReleaseProject.xcconfig \
138
  xcode/Config/StaticLibraryTarget.xcconfig \
139
  xcode/Config/TestTarget.xcconfig \
140
  xcode/Resources/Info.plist \
141
  xcode/Scripts/runtests.sh \
142
  xcode/Scripts/versiongenerate.py \
143
144
145
146
147
  xcode/gtest.xcodeproj/project.pbxproj

# xcode sample files
EXTRA_DIST += \
  xcode/Samples/FrameworkSample/Info.plist \
148
  xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj \
zhanyong.wan's avatar
zhanyong.wan committed
149
  xcode/Samples/FrameworkSample/runtests.sh \
150
151
  xcode/Samples/FrameworkSample/widget.cc \
  xcode/Samples/FrameworkSample/widget.h \
152
  xcode/Samples/FrameworkSample/widget_test.cc
153

154
155
# C++Builder project files
EXTRA_DIST += \
156
157
  codegear/gtest.cbproj \
  codegear/gtest.groupproj \
158
159
160
  codegear/gtest_all.cc \
  codegear/gtest_link.cc \
  codegear/gtest_main.cbproj \
161
  codegear/gtest_unittest.cbproj
162

shiqian's avatar
shiqian committed
163
164
165
166
167
168
169
170
171
# Distribute and install M4 macro
m4datadir = $(datadir)/aclocal
m4data_DATA = m4/gtest.m4
EXTRA_DIST += $(m4data_DATA)

# We define the global AM_CPPFLAGS as everything we compile includes from these
# directories.
AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/include

172
173
174
175
176
177
178
179
# Modifies compiler and linker flags for pthreads compatibility.
if HAVE_PTHREADS
  AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1
  AM_LIBS = @PTHREAD_LIBS@
else
  AM_CXXFLAGS = -DGTEST_HAS_PTHREAD=0
endif

shiqian's avatar
shiqian committed
180
181
182
# Build rules for libraries.
lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la

183
lib_libgtest_la_SOURCES = src/gtest-all.cc
shiqian's avatar
shiqian committed
184

185
186
187
188
189
190
191
192
193
194
195
pkginclude_HEADERS = \
  include/gtest/gtest-death-test.h \
  include/gtest/gtest-message.h \
  include/gtest/gtest-param-test.h \
  include/gtest/gtest-printers.h \
  include/gtest/gtest-spi.h \
  include/gtest/gtest-test-part.h \
  include/gtest/gtest-typed-test.h \
  include/gtest/gtest.h \
  include/gtest/gtest_pred_impl.h \
  include/gtest/gtest_prod.h
shiqian's avatar
shiqian committed
196
197
198
199
200
201

pkginclude_internaldir = $(pkgincludedir)/internal
pkginclude_internal_HEADERS = \
  include/gtest/internal/gtest-death-test-internal.h \
  include/gtest/internal/gtest-filepath.h \
  include/gtest/internal/gtest-internal.h \
202
203
204
  include/gtest/internal/gtest-linked_ptr.h \
  include/gtest/internal/gtest-param-util-generated.h \
  include/gtest/internal/gtest-param-util.h \
shiqian's avatar
shiqian committed
205
  include/gtest/internal/gtest-port.h \
206
  include/gtest/internal/gtest-string.h \
207
  include/gtest/internal/gtest-tuple.h \
208
  include/gtest/internal/gtest-type-util.h
shiqian's avatar
shiqian committed
209
210
211
212
213
214
215
216
217
218
219
220
221

lib_libgtest_main_la_SOURCES = src/gtest_main.cc
lib_libgtest_main_la_LIBADD = lib/libgtest.la

# Bulid rules for samples and tests. Automake's naming for some of
# these variables isn't terribly obvious, so this is a brief
# reference:
#
# TESTS -- Programs run automatically by "make check"
# check_PROGRAMS -- Programs built by "make check" but not necessarily run

noinst_LTLIBRARIES = samples/libsamples.la

222
223
224
225
226
227
228
229
samples_libsamples_la_SOURCES = \
  samples/sample1.cc \
  samples/sample1.h \
  samples/sample2.cc \
  samples/sample2.h \
  samples/sample3-inl.h \
  samples/sample4.cc \
  samples/sample4.h
shiqian's avatar
shiqian committed
230
231
232
233
234
235

TESTS=
TESTS_ENVIRONMENT = GTEST_SOURCE_DIR="$(srcdir)/test" \
                    GTEST_BUILD_DIR="$(top_builddir)/test"
check_PROGRAMS=

236
# A simple sample on using gtest.
shiqian's avatar
shiqian committed
237
238
239
240
TESTS += samples/sample1_unittest
check_PROGRAMS += samples/sample1_unittest
samples_sample1_unittest_SOURCES = samples/sample1_unittest.cc
samples_sample1_unittest_LDADD = lib/libgtest_main.la \
241
                                 lib/libgtest.la \
shiqian's avatar
shiqian committed
242
243
                                 samples/libsamples.la

244
# Another sample.  It also verifies that libgtest works.
245
246
247
248
TESTS += samples/sample10_unittest
check_PROGRAMS += samples/sample10_unittest
samples_sample10_unittest_SOURCES = samples/sample10_unittest.cc
samples_sample10_unittest_LDADD = lib/libgtest.la
249

250
# This tests most constructs of gtest and verifies that libgtest_main
251
# and libgtest work.
252
253
254
TESTS += test/gtest_all_test
check_PROGRAMS += test/gtest_all_test
test_gtest_all_test_SOURCES = test/gtest_all_test.cc
255
256
test_gtest_all_test_LDADD = lib/libgtest_main.la \
                            lib/libgtest.la
257
258

# Tests that fused gtest files compile and work.
259
260
FUSED_GTEST_SRC = \
  fused-src/gtest/gtest-all.cc \
261
262
  fused-src/gtest/gtest.h \
  fused-src/gtest/gtest_main.cc
263

264
if HAVE_PYTHON
265
266
267
TESTS += test/fused_gtest_test
check_PROGRAMS += test/fused_gtest_test
test_fused_gtest_test_SOURCES = $(FUSED_GTEST_SRC) \
268
                                samples/sample1.cc samples/sample1_unittest.cc
269
test_fused_gtest_test_CPPFLAGS = -I"$(srcdir)/fused-src"
270
271
272
273

# Build rules for putting fused Google Test files into the distribution
# package. The user can also create those files by manually running
# scripts/fuse_gtest_files.py.
274
$(test_fused_gtest_test_SOURCES): fused-gtest
275

276
277
278
279
fused-gtest: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
             $(GTEST_SRC) src/gtest-all.cc src/gtest_main.cc \
             scripts/fuse_gtest_files.py
	mkdir -p "$(srcdir)/fused-src"
280
281
282
283
	chmod -R u+w "$(srcdir)/fused-src"
	rm -f "$(srcdir)/fused-src/gtest/gtest-all.cc"
	rm -f "$(srcdir)/fused-src/gtest/gtest.h"
	"$(srcdir)/scripts/fuse_gtest_files.py" "$(srcdir)/fused-src"
284
	cp -f "$(srcdir)/src/gtest_main.cc" "$(srcdir)/fused-src/gtest/"
285
286

maintainer-clean-local:
287
	rm -rf "$(srcdir)/fused-src"
288
endif
289
290
291

# Death tests may produce core dumps in the build directory. In case
# this happens, clean them to keep distcleancheck happy.
zhanyong.wan's avatar
zhanyong.wan committed
292
293
294
295
296
297
298
299
300
301
302
303
304
CLEANFILES = core

# Disables 'make install' as installing a compiled version of Google
# Test can lead to undefined behavior due to violation of the
# One-Definition Rule.

install-exec-local:
	echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
	false

install-data-local:
	echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
	false