aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
authorkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-04-21 21:00:39 +0000
committerkenton@google.com <kenton@google.com@630680e5-0e50-0410-840e-4b1c322b438d>2009-04-21 21:00:39 +0000
commit37ad00d2c4409b4b3d629e1b0ae32bb814cec740 (patch)
tree17a6af5bb668de01220cecfa9cebb0c9ab55dfe9 /Makefile.am
parenta6de64aef3e75dd0e0b2540280037139ef3d0066 (diff)
downloadprotobuf-37ad00d2c4409b4b3d629e1b0ae32bb814cec740.tar.gz
protobuf-37ad00d2c4409b4b3d629e1b0ae32bb814cec740.tar.bz2
protobuf-37ad00d2c4409b4b3d629e1b0ae32bb814cec740.zip
Update bundled gtest to latest version (1.3.0) and include it as a
nested autoconf package rather than as raw source. This way we can trivially update it again in the future. Actually, this change doesn't even include gtest in protobuf's SVN. Instead, we auto-download it when autogen.sh is invoked. Note that it will be included in release distributions, though. TODO: * Add a configure option to use the system's installed gtest rather than the bundled copy. Apparently the gtest maintainers are working on some general-purpose autoconf macros which will do this automagically. * Update MSVC project files.
Diffstat (limited to 'Makefile.am')
-rw-r--r--Makefile.am28
1 files changed, 27 insertions, 1 deletions
diff --git a/Makefile.am b/Makefile.am
index b4ceacd4..c7aadc60 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,33 @@ ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign
-SUBDIRS = src
+# Build . before src so that our all-local and clean-local hooks kicks in at
+# the right time.
+SUBDIRS = . src
+
+# Always include gtest in distributions.
+DIST_SUBDIRS = $(subdirs) src
+
+# Build gtest before we build protobuf tests. We don't add gtest to SUBDIRS
+# because then "make check" would also build and run all of gtest's own tests,
+# which takes a lot of time and is generally not useful to us. Also, we don't
+# want "make install" to recurse into gtest since we don't want to overwrite
+# the installed version of gtest if there is one.
+check-local:
+ @echo "Making lib/libgtest.a lib/libgtest_main.a in gtest"
+ @cd gtest && $(MAKE) $(AM_MAKEFLAGS) lib/libgtest.la lib/libgtest_main.la
+
+# We would like to clean gtest when "make clean" is invoked. But we have to
+# be careful because clean-local is also invoked during "make distclean", but
+# "make distclean" already recurses into gtest because it's listed among the
+# DIST_SUBDIRS. distclean will delete gtest/Makefile, so if we then try to
+# cd to the directory again and "make clean" it will fail. So, check that the
+# Makefile exists before recursing.
+clean-local:
+ @if test -e gtest/Makefile; then \
+ echo "Making clean in gtest"; \
+ cd gtest && $(MAKE) $(AM_MAKEFLAGS) clean; \
+ fi
EXTRA_DIST = \
autogen.sh \