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

3
4
# TODO(chandlerc@google.com): automate the generation of *.h from *.h.pump.

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-tuple.h.pump \
11
  include/gtest/internal/gtest-type-util.h.pump \
12
  include/gtest/internal/gtest-param-util-generated.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
19
20
21
22
23
24
25
26
  scripts/test/Makefile

# gtest source files that we don't compile directly.
EXTRA_DIST += \
  src/gtest.cc \
  src/gtest-death-test.cc \
  src/gtest-filepath.cc \
  src/gtest-internal-inl.h \
  src/gtest-port.cc \
  src/gtest-test-part.cc \
27
  src/gtest-typed-test.cc
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85

# 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 += \
  test/gtest-death-test_test.cc \
  test/gtest_environment_test.cc \
  test/gtest-filepath_test.cc \
  test/gtest-linked_ptr_test.cc \
  test/gtest-message_test.cc \
  test/gtest_no_test_unittest.cc \
  test/gtest-options_test.cc \
  test/gtest-param-test_test.cc \
  test/gtest-param-test2_test.cc \
  test/gtest-param-test_test.h \
  test/gtest-port_test.cc \
  test/gtest_pred_impl_unittest.cc \
  test/gtest_prod_test.cc \
  test/production.cc \
  test/production.h \
  test/gtest_repeat_test.cc \
  test/gtest_sole_header_test.cc \
  test/gtest_stress_test.cc \
  test/gtest-test-part_test.cc \
  test/gtest_throw_on_failure_ex_test.cc \
  test/gtest-typed-test_test.cc \
  test/gtest-typed-test2_test.cc \
  test/gtest-typed-test_test.h \
  test/gtest_unittest.cc \
  test/gtest-unittest-api_test.cc \
  test/gtest-listener_test.cc \
  test/gtest_main_unittest.cc \
  test/gtest_unittest.cc \
  test/gtest-tuple_test.cc \
  test/gtest-param-test_test.cc \
  test/gtest-param-test2_test.cc \
  test/gtest_break_on_failure_unittest_.cc \
  test/gtest_color_test_.cc \
  test/gtest_env_var_test_.cc \
  test/gtest_filter_unittest_.cc \
  test/gtest_help_test_.cc \
  test/gtest_list_tests_unittest_.cc \
  test/gtest_output_test_.cc \
  test/gtest_shuffle_test_.cc \
  test/gtest_throw_on_failure_test_.cc \
  test/gtest_uninitialized_test_.cc \
  test/gtest_xml_outfile1_test_.cc \
  test/gtest_xml_outfile2_test_.cc \
zhanyong.wan's avatar
zhanyong.wan committed
86
  test/gtest_xml_output_unittest_.cc
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107

# Python tests that we don't run.
EXTRA_DIST += \
  test/gtest_test_utils.py \
  test/gtest_xml_test_utils.py \
  test/gtest_break_on_failure_unittest.py \
  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_output_test_golden_win.txt \
  test/gtest_shuffle_test.py \
  test/gtest_throw_on_failure_test.py \
  test/gtest_uninitialized_test.py \
  test/gtest_xml_outfiles_test.py \
  test/gtest_xml_output_unittest.py \
  test/run_tests_util.py \
  test/run_tests_util_test.py
shiqian's avatar
shiqian committed
108

109
110
111
112
# CMake script
EXTRA_DIST += \
  CMakeLists.txt

113
114
# MSVC project files
EXTRA_DIST += \
115
  msvc/gtest-md.sln \
116
  msvc/gtest.sln \
117
  msvc/gtest-md.vcproj \
118
  msvc/gtest.vcproj \
119
  msvc/gtest_main-md.vcproj \
120
  msvc/gtest_main.vcproj \
121
  msvc/gtest_prod_test-md.vcproj \
122
  msvc/gtest_prod_test.vcproj \
123
  msvc/gtest_unittest-md.vcproj \
zhanyong.wan's avatar
zhanyong.wan committed
124
  msvc/gtest_unittest.vcproj
125

126
127
128
129
130
131
# xcode project files
EXTRA_DIST += \
  xcode/Config/DebugProject.xcconfig \
  xcode/Config/FrameworkTarget.xcconfig \
  xcode/Config/General.xcconfig \
  xcode/Config/ReleaseProject.xcconfig \
132
  xcode/Config/StaticLibraryTarget.xcconfig \
133
  xcode/Config/TestTarget.xcconfig \
134
135
  xcode/Resources/Info.plist \
  xcode/Scripts/versiongenerate.py \
136
  xcode/Scripts/runtests.sh \
137
138
139
140
141
  xcode/gtest.xcodeproj/project.pbxproj

# xcode sample files
EXTRA_DIST += \
  xcode/Samples/FrameworkSample/Info.plist \
zhanyong.wan's avatar
zhanyong.wan committed
142
  xcode/Samples/FrameworkSample/runtests.sh \
143
144
145
146
147
  xcode/Samples/FrameworkSample/widget_test.cc \
  xcode/Samples/FrameworkSample/widget.cc \
  xcode/Samples/FrameworkSample/widget.h \
  xcode/Samples/FrameworkSample/WidgetFramework.xcodeproj/project.pbxproj

148
149
150
151
152
153
154
155
156
# C++Builder project files
EXTRA_DIST += \
  codegear/gtest_all.cc \
  codegear/gtest_link.cc \
  codegear/gtest.cbproj \
  codegear/gtest_main.cbproj \
  codegear/gtest_unittest.cbproj \
  codegear/gtest.groupproj

shiqian's avatar
shiqian committed
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
# TODO(wan@google.com): integrate scripts/gen_gtest_pred_impl.py into
#   the build system such that a user can specify the maximum predicate
#   arity here and have the script automatically generate the
#   corresponding .h and .cc files.

# Scripts and utilities
bin_SCRIPTS = scripts/gtest-config
CLEANFILES = $(bin_SCRIPTS)

# 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

175
176
177
178
179
180
181
182
# 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
183
184
185
# Build rules for libraries.
lib_LTLIBRARIES = lib/libgtest.la lib/libgtest_main.la

186
lib_libgtest_la_SOURCES = src/gtest-all.cc
shiqian's avatar
shiqian committed
187
188
189
190

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

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 \
203
204
205
  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
206
  include/gtest/internal/gtest-port.h \
207
  include/gtest/internal/gtest-string.h \
208
  include/gtest/internal/gtest-tuple.h \
209
  include/gtest/internal/gtest-type-util.h
shiqian's avatar
shiqian committed
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235

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

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

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
241
242
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 \
                                 samples/libsamples.la

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

249
250
251
252
253
# This tests most constructs of gtest and verifies that libgtest_main
# works.
TESTS += test/gtest_all_test
check_PROGRAMS += test/gtest_all_test
test_gtest_all_test_SOURCES = test/gtest_all_test.cc
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
test_gtest_all_test_LDADD = lib/libgtest_main.la

# Tests that fused gtest files compile and work.
TESTS += test/gtest_fused_test
check_PROGRAMS += test/gtest_fused_test
test_gtest_fused_test_SOURCES = fused-src/gtest/gtest-all.cc \
                                fused-src/gtest/gtest_main.cc \
                                fused-src/gtest/gtest.h \
                                samples/sample1.cc samples/sample1_unittest.cc
test_gtest_fused_test_CPPFLAGS = -I"$(srcdir)/fused-src"

# 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.
$(srcdir)/fused-src/gtest/gtest-all.cc: fused-gtest-internal

$(srcdir)/fused-src/gtest/gtest.h: fused-gtest-internal

fused-gtest-internal: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
                      $(lib_libgtest_la_SOURCES) \
                      scripts/fuse_gtest_files.py
	mkdir -p "$(srcdir)/fused-src/gtest"
	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"

$(srcdir)/fused-src/gtest/gtest_main.cc: src/gtest_main.cc
	mkdir -p "$(srcdir)/fused-src/gtest"
	chmod -R u+w "$(srcdir)/fused-src"
	cp -f "$(srcdir)/src/gtest_main.cc" "$(srcdir)/fused-src/gtest"

maintainer-clean-local:
	chmod -R u+w "$(srcdir)/fused-src"
	rm -rf "$(srcdir)/fused-src/gtest"