Makefile.am revision 13481
15245Sgblack@eecs.umich.edu# Automake file 25245Sgblack@eecs.umich.edu 35245Sgblack@eecs.umich.edu# Nonstandard package files for distribution. 45245Sgblack@eecs.umich.eduEXTRA_DIST = LICENSE 57087Snate@binkert.org 67087Snate@binkert.org# We may need to build our internally packaged gtest. If so, it will be 77087Snate@binkert.org# included in the 'subdirs' variable. 87087Snate@binkert.orgSUBDIRS = $(subdirs) 97087Snate@binkert.org 107087Snate@binkert.org# This is generated by the configure script, so clean it for distribution. 117087Snate@binkert.orgDISTCLEANFILES = scripts/gmock-config 127087Snate@binkert.org 135245Sgblack@eecs.umich.edu# We define the global AM_CPPFLAGS as everything we compile includes from these 147087Snate@binkert.org# directories. 157087Snate@binkert.orgAM_CPPFLAGS = $(GTEST_CPPFLAGS) -I$(srcdir)/include 167087Snate@binkert.org 177087Snate@binkert.org# Modifies compiler and linker flags for pthreads compatibility. 187087Snate@binkert.orgif HAVE_PTHREADS 197087Snate@binkert.org AM_CXXFLAGS = @PTHREAD_CFLAGS@ -DGTEST_HAS_PTHREAD=1 207087Snate@binkert.org AM_LIBS = @PTHREAD_LIBS@ 217087Snate@binkert.orgendif 225245Sgblack@eecs.umich.edu 237087Snate@binkert.org# Build rules for libraries. 245245Sgblack@eecs.umich.edulib_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la 255245Sgblack@eecs.umich.edu 265245Sgblack@eecs.umich.edulib_libgmock_la_SOURCES = src/gmock-all.cc 275245Sgblack@eecs.umich.edu 285245Sgblack@eecs.umich.edupkginclude_HEADERS = \ 295245Sgblack@eecs.umich.edu include/gmock/gmock-actions.h \ 305245Sgblack@eecs.umich.edu include/gmock/gmock-cardinalities.h \ 315245Sgblack@eecs.umich.edu include/gmock/gmock-generated-actions.h \ 325245Sgblack@eecs.umich.edu include/gmock/gmock-generated-function-mockers.h \ 335245Sgblack@eecs.umich.edu include/gmock/gmock-generated-matchers.h \ 345245Sgblack@eecs.umich.edu include/gmock/gmock-generated-nice-strict.h \ 355245Sgblack@eecs.umich.edu include/gmock/gmock-matchers.h \ 365245Sgblack@eecs.umich.edu include/gmock/gmock-more-actions.h \ 375245Sgblack@eecs.umich.edu include/gmock/gmock-more-matchers.h \ 385245Sgblack@eecs.umich.edu include/gmock/gmock-spec-builders.h \ 395245Sgblack@eecs.umich.edu include/gmock/gmock.h 405245Sgblack@eecs.umich.edu 415245Sgblack@eecs.umich.edupkginclude_internaldir = $(pkgincludedir)/internal 425245Sgblack@eecs.umich.edupkginclude_internal_HEADERS = \ 435245Sgblack@eecs.umich.edu include/gmock/internal/gmock-generated-internal-utils.h \ 445245Sgblack@eecs.umich.edu include/gmock/internal/gmock-internal-utils.h \ 455245Sgblack@eecs.umich.edu include/gmock/internal/gmock-port.h \ 465245Sgblack@eecs.umich.edu include/gmock/internal/custom/gmock-generated-actions.h \ 476216Snate@binkert.org include/gmock/internal/custom/gmock-matchers.h \ 485245Sgblack@eecs.umich.edu include/gmock/internal/custom/gmock-port.h 495245Sgblack@eecs.umich.edu 5013892Sgabeblack@google.comlib_libgmock_main_la_SOURCES = src/gmock_main.cc 517901Shestness@cs.utexas.edulib_libgmock_main_la_LIBADD = lib/libgmock.la 528832SAli.Saidi@ARM.com 535245Sgblack@eecs.umich.edu# Build rules for tests. Automake's naming for some of these variables isn't 545245Sgblack@eecs.umich.edu# terribly obvious, so this is a brief reference: 555245Sgblack@eecs.umich.edu# 565245Sgblack@eecs.umich.edu# TESTS -- Programs run automatically by "make check" 575245Sgblack@eecs.umich.edu# check_PROGRAMS -- Programs built by "make check" but not necessarily run 5813892Sgabeblack@google.com 595245Sgblack@eecs.umich.eduTESTS= 605245Sgblack@eecs.umich.educheck_PROGRAMS= 617912Shestness@cs.utexas.eduAM_LDFLAGS = $(GTEST_LDFLAGS) 628922Swilliam.wang@arm.com 635245Sgblack@eecs.umich.edu# This exercises all major components of Google Mock. It also 645245Sgblack@eecs.umich.edu# verifies that libgmock works. 655245Sgblack@eecs.umich.eduTESTS += test/gmock-spec-builders_test 668922Swilliam.wang@arm.comcheck_PROGRAMS += test/gmock-spec-builders_test 675245Sgblack@eecs.umich.edutest_gmock_spec_builders_test_SOURCES = test/gmock-spec-builders_test.cc 685245Sgblack@eecs.umich.edutest_gmock_spec_builders_test_LDADD = $(GTEST_LIBS) lib/libgmock.la 695245Sgblack@eecs.umich.edu 708832SAli.Saidi@ARM.com# This tests using Google Mock in multiple translation units. It also 715245Sgblack@eecs.umich.edu# verifies that libgmock_main and libgmock work. 728975Sandreas.hansson@arm.comTESTS += test/gmock_link_test 7310713Sandreas.hansson@arm.comcheck_PROGRAMS += test/gmock_link_test 745245Sgblack@eecs.umich.edutest_gmock_link_test_SOURCES = \ 755245Sgblack@eecs.umich.edu test/gmock_link2_test.cc \ 767912Shestness@cs.utexas.edu test/gmock_link_test.cc \ 777912Shestness@cs.utexas.edu test/gmock_link_test.h 785245Sgblack@eecs.umich.edutest_gmock_link_test_LDADD = $(GTEST_LIBS) lib/libgmock_main.la lib/libgmock.la 797912Shestness@cs.utexas.edu 809044SAli.Saidi@ARM.comif HAVE_PYTHON 817912Shestness@cs.utexas.edu # Tests that fused gmock files compile and work. 829701Sgedare@rtems.org TESTS += test/gmock_fused_test 837912Shestness@cs.utexas.edu check_PROGRAMS += test/gmock_fused_test 847912Shestness@cs.utexas.edu test_gmock_fused_test_SOURCES = \ 857912Shestness@cs.utexas.edu fused-src/gmock-gtest-all.cc \ 867912Shestness@cs.utexas.edu fused-src/gmock/gmock.h \ 877912Shestness@cs.utexas.edu fused-src/gmock_main.cc \ 887912Shestness@cs.utexas.edu fused-src/gtest/gtest.h \ 897912Shestness@cs.utexas.edu test/gmock_test.cc 907912Shestness@cs.utexas.edu test_gmock_fused_test_CPPFLAGS = -I"$(srcdir)/fused-src" 917912Shestness@cs.utexas.eduendif 927912Shestness@cs.utexas.edu 937912Shestness@cs.utexas.edu# Google Mock source files that we don't compile directly. 945245Sgblack@eecs.umich.eduGMOCK_SOURCE_INGLUDES = \ 957912Shestness@cs.utexas.edu src/gmock-cardinalities.cc \ 968832SAli.Saidi@ARM.com src/gmock-internal-utils.cc \ 977912Shestness@cs.utexas.edu src/gmock-matchers.cc \ 987912Shestness@cs.utexas.edu src/gmock-spec-builders.cc \ 997912Shestness@cs.utexas.edu src/gmock.cc 1007912Shestness@cs.utexas.edu 1017912Shestness@cs.utexas.eduEXTRA_DIST += $(GMOCK_SOURCE_INGLUDES) 1027912Shestness@cs.utexas.edu 1037912Shestness@cs.utexas.edu# C++ tests that we don't compile using autotools. 1047912Shestness@cs.utexas.eduEXTRA_DIST += \ 1057912Shestness@cs.utexas.edu test/gmock-actions_test.cc \ 1067912Shestness@cs.utexas.edu test/gmock_all_test.cc \ 1077912Shestness@cs.utexas.edu test/gmock-cardinalities_test.cc \ 1087912Shestness@cs.utexas.edu test/gmock_ex_test.cc \ 1097912Shestness@cs.utexas.edu test/gmock-generated-actions_test.cc \ 1107912Shestness@cs.utexas.edu test/gmock-generated-function-mockers_test.cc \ 1117912Shestness@cs.utexas.edu test/gmock-generated-internal-utils_test.cc \ 1127912Shestness@cs.utexas.edu test/gmock-generated-matchers_test.cc \ 1137912Shestness@cs.utexas.edu test/gmock-internal-utils_test.cc \ 11414096Smatthew.poremba@amd.com test/gmock-matchers_test.cc \ 1157912Shestness@cs.utexas.edu test/gmock-more-actions_test.cc \ 1167912Shestness@cs.utexas.edu test/gmock-nice-strict_test.cc \ 11712749Sgiacomo.travaglini@arm.com test/gmock-port_test.cc \ 11812749Sgiacomo.travaglini@arm.com test/gmock_stress_test.cc 11912749Sgiacomo.travaglini@arm.com 12012749Sgiacomo.travaglini@arm.com# Python tests, which we don't run using autotools. 12112749Sgiacomo.travaglini@arm.comEXTRA_DIST += \ 12214096Smatthew.poremba@amd.com test/gmock_leak_test.py \ 1237912Shestness@cs.utexas.edu test/gmock_leak_test_.cc \ 1247912Shestness@cs.utexas.edu test/gmock_output_test.py \ 1257912Shestness@cs.utexas.edu test/gmock_output_test_.cc \ 1267912Shestness@cs.utexas.edu test/gmock_output_test_golden.txt \ 1277912Shestness@cs.utexas.edu test/gmock_test_utils.py 1288953Sgblack@eecs.umich.edu 1297912Shestness@cs.utexas.edu# Nonstandard package files for distribution. 13014096Smatthew.poremba@amd.comEXTRA_DIST += \ 1317912Shestness@cs.utexas.edu CHANGES \ 1327912Shestness@cs.utexas.edu CONTRIBUTORS \ 1337912Shestness@cs.utexas.edu make/Makefile 1347912Shestness@cs.utexas.edu 13514096Smatthew.poremba@amd.com# Pump scripts for generating Google Mock headers. 1367912Shestness@cs.utexas.edu# TODO(chandlerc@google.com): automate the generation of *.h from *.h.pump. 1377912Shestness@cs.utexas.eduEXTRA_DIST += \ 1387912Shestness@cs.utexas.edu include/gmock/gmock-generated-actions.h.pump \ 1397912Shestness@cs.utexas.edu include/gmock/gmock-generated-function-mockers.h.pump \ 1407912Shestness@cs.utexas.edu include/gmock/gmock-generated-matchers.h.pump \ 1417912Shestness@cs.utexas.edu include/gmock/gmock-generated-nice-strict.h.pump \ 1427912Shestness@cs.utexas.edu include/gmock/internal/gmock-generated-internal-utils.h.pump \ 1437912Shestness@cs.utexas.edu include/gmock/internal/custom/gmock-generated-actions.h.pump 1447912Shestness@cs.utexas.edu 1457912Shestness@cs.utexas.edu# Script for fusing Google Mock and Google Test source files. 1467912Shestness@cs.utexas.eduEXTRA_DIST += scripts/fuse_gmock_files.py 1477912Shestness@cs.utexas.edu 1487912Shestness@cs.utexas.edu# The Google Mock Generator tool from the cppclean project. 1497912Shestness@cs.utexas.eduEXTRA_DIST += \ 1507912Shestness@cs.utexas.edu scripts/generator/LICENSE \ 1517912Shestness@cs.utexas.edu scripts/generator/README \ 1527912Shestness@cs.utexas.edu scripts/generator/README.cppclean \ 1537912Shestness@cs.utexas.edu scripts/generator/cpp/__init__.py \ 1547912Shestness@cs.utexas.edu scripts/generator/cpp/ast.py \ 1557912Shestness@cs.utexas.edu scripts/generator/cpp/gmock_class.py \ 1569542Sandreas.hansson@arm.com scripts/generator/cpp/keywords.py \ 1579542Sandreas.hansson@arm.com scripts/generator/cpp/tokenize.py \ 1587912Shestness@cs.utexas.edu scripts/generator/cpp/utils.py \ 1597912Shestness@cs.utexas.edu scripts/generator/gmock_gen.py 1607912Shestness@cs.utexas.edu 1617912Shestness@cs.utexas.edu# Script for diagnosing compiler errors in programs that use Google 1627912Shestness@cs.utexas.edu# Mock. 16312749Sgiacomo.travaglini@arm.comEXTRA_DIST += scripts/gmock_doctor.py 1647912Shestness@cs.utexas.edu 1658953Sgblack@eecs.umich.edu# CMake scripts. 16613784Sgabeblack@google.comEXTRA_DIST += \ 16713784Sgabeblack@google.com CMakeLists.txt 1687912Shestness@cs.utexas.edu 1697912Shestness@cs.utexas.edu# Microsoft Visual Studio 2005 projects. 1705245Sgblack@eecs.umich.eduEXTRA_DIST += \ 1715245Sgblack@eecs.umich.edu msvc/2005/gmock.sln \ 1725245Sgblack@eecs.umich.edu msvc/2005/gmock.vcproj \ 1738832SAli.Saidi@ARM.com msvc/2005/gmock_config.vsprops \ 1745245Sgblack@eecs.umich.edu msvc/2005/gmock_main.vcproj \ 1759701Sgedare@rtems.org msvc/2005/gmock_test.vcproj 1769701Sgedare@rtems.org 1779701Sgedare@rtems.org# Microsoft Visual Studio 2010 projects. 1789701Sgedare@rtems.orgEXTRA_DIST += \ 1799701Sgedare@rtems.org msvc/2010/gmock.sln \ 1809701Sgedare@rtems.org msvc/2010/gmock.vcxproj \ 18110654Sandreas.hansson@arm.com msvc/2010/gmock_config.props \ 18210654Sandreas.hansson@arm.com msvc/2010/gmock_main.vcxproj \ 18310654Sandreas.hansson@arm.com msvc/2010/gmock_test.vcxproj 18412088Sspwilson2@wisc.edu 18510654Sandreas.hansson@arm.comif HAVE_PYTHON 1867912Shestness@cs.utexas.edu# gmock_test.cc does not really depend on files generated by the 1878975Sandreas.hansson@arm.com# fused-gmock-internal rule. However, gmock_test.o does, and it is 18810713Sandreas.hansson@arm.com# important to include test/gmock_test.cc as part of this rule in order to 1897912Shestness@cs.utexas.edu# prevent compiling gmock_test.o until all dependent files have been 1905245Sgblack@eecs.umich.edu# generated. 1915245Sgblack@eecs.umich.edu$(test_gmock_fused_test_SOURCES): fused-gmock-internal 1925245Sgblack@eecs.umich.edu 1935245Sgblack@eecs.umich.edu# TODO(vladl@google.com): Find a way to add Google Tests's sources here. 1945245Sgblack@eecs.umich.edufused-gmock-internal: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \ 1955245Sgblack@eecs.umich.edu $(lib_libgmock_la_SOURCES) $(GMOCK_SOURCE_INGLUDES) \ 1965245Sgblack@eecs.umich.edu $(lib_libgmock_main_la_SOURCES) \ 1975245Sgblack@eecs.umich.edu scripts/fuse_gmock_files.py 1985245Sgblack@eecs.umich.edu mkdir -p "$(srcdir)/fused-src" 1995245Sgblack@eecs.umich.edu chmod -R u+w "$(srcdir)/fused-src" 2008832SAli.Saidi@ARM.com rm -f "$(srcdir)/fused-src/gtest/gtest.h" 2018832SAli.Saidi@ARM.com rm -f "$(srcdir)/fused-src/gmock/gmock.h" 2028832SAli.Saidi@ARM.com rm -f "$(srcdir)/fused-src/gmock-gtest-all.cc" 2038832SAli.Saidi@ARM.com "$(srcdir)/scripts/fuse_gmock_files.py" "$(srcdir)/fused-src" 2048832SAli.Saidi@ARM.com cp -f "$(srcdir)/src/gmock_main.cc" "$(srcdir)/fused-src" 2058832SAli.Saidi@ARM.com 2065245Sgblack@eecs.umich.edumaintainer-clean-local: 20713892Sgabeblack@google.com rm -rf "$(srcdir)/fused-src" 2088832SAli.Saidi@ARM.comendif 20912680Sgiacomo.travaglini@arm.com 21010654Sandreas.hansson@arm.com# Death tests may produce core dumps in the build directory. In case 21112088Sspwilson2@wisc.edu# this happens, clean them to keep distcleancheck happy. 2125245Sgblack@eecs.umich.eduCLEANFILES = core 2135245Sgblack@eecs.umich.edu 2145245Sgblack@eecs.umich.edu# Disables 'make install' as installing a compiled version of Google 2155245Sgblack@eecs.umich.edu# Mock can lead to undefined behavior due to violation of the 2165245Sgblack@eecs.umich.edu# One-Definition Rule. 217 218install-exec-local: 219 echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system." 220 false 221 222install-data-local: 223 echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system." 224 false 225