aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
diff options
context:
space:
mode:
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 \