Add option to skip building the run tests in buildbot-build.sh.

With the run test compilation moved to the build step
(https://r.android.com/1794531), it takes a lot longer. Add an option
to skip it, in case the caller doesn't intend to run the run tests.

This unearthed a few missing dependencies in system/lib(64) when
building gtests only. One reason it's necessary to add them here is
that prebuilts don't retain the source shared_lib dependencies.

Test: art/tools/buildbot-build.sh --installclean \
        --skip-run-tests-build && \
      art/tools/buildbot-teardown-device.sh && \
      art/tools/buildbot-cleanup-device.sh && \
      art/tools/buildbot-setup-device.sh && \
      art/tools/buildbot-sync.sh && \
      art/tools/run-gtests.sh && \
      m TARGET_BUILD_UNBUNDLED=true test-art-host-gtest
  on master-art
Test: art/tools/buildbot-build.sh --installclean && \
      art/tools/buildbot-teardown-device.sh && \
      art/tools/buildbot-cleanup-device.sh && \
      art/tools/buildbot-setup-device.sh && \
      art/tools/buildbot-sync.sh && \
      art/test/testrunner/testrunner.py --target --64 --optimizing && \
      art/test/testrunner/testrunner.py --host --64 --optimizing
  on master-art
Bug: 147814778
Change-Id: Iff15ccdc1113d19289176447fc42a40a3005bfd1
diff --git a/Android.mk b/Android.mk
index 0b456c9..58f1aec 100644
--- a/Android.mk
+++ b/Android.mk
@@ -738,11 +738,21 @@
 ########################################################################
 # Rules for building all dependencies for tests.
 
-.PHONY: build-art-host-tests
-build-art-host-tests:   build-art-host $(TEST_ART_RUN_TEST_DEPENDENCIES) $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES) $(ART_TEST_HOST_GTEST_DEPENDENCIES)
+.PHONY: build-art-host-gtests build-art-host-run-tests build-art-host-tests
 
-.PHONY: build-art-target-tests
-build-art-target-tests:   build-art-target $(TEST_ART_RUN_TEST_DEPENDENCIES) $(ART_TEST_TARGET_RUN_TEST_DEPENDENCIES) $(ART_TEST_TARGET_GTEST_DEPENDENCIES)
+build-art-host-gtests: build-art-host $(ART_TEST_HOST_GTEST_DEPENDENCIES)
+
+build-art-host-run-tests: build-art-host $(TEST_ART_RUN_TEST_DEPENDENCIES) $(ART_TEST_HOST_RUN_TEST_DEPENDENCIES)
+
+build-art-host-tests: build-art-host-gtests build-art-host-run-tests
+
+.PHONY: build-art-target-gtests build-art-target-run-tests build-art-target-tests
+
+build-art-target-gtests: build-art-target $(ART_TEST_TARGET_GTEST_DEPENDENCIES)
+
+build-art-target-run-tests: build-art-target $(TEST_ART_RUN_TEST_DEPENDENCIES) $(ART_TEST_TARGET_RUN_TEST_DEPENDENCIES)
+
+build-art-target-tests: build-art-target-gtests build-art-target-run-tests
 
 ########################################################################
 # targets to switch back and forth from libdvm to libart