Always pass --root to cpplint

Mac builds were sometimes flaky when running cpplint.py because
the .git directory is sometimes removed when the disk is almost
full, which causes cpplint.py to fail to autodetect the project
root.  Change "Pass --root to cpplint."
(I6d418979a9bdceefc7a2c19297a7cc9aacb3e83f) fixed a similar
problem when running inside of gitc, which doesn't have .git
directories, but use ANDROID_BUILD_TOP, which is only set if
lunch has been run.  It also didn't set --root for some of the
phony targets.

Bug: 34787652
Test: m -j cpplint-art-phony
Change-Id: Ie0eb9d9d038f56a661750bb0f782321aba314a37
diff --git a/build/Android.cpplint.mk b/build/Android.cpplint.mk
index f924a85..66ac897 100644
--- a/build/Android.cpplint.mk
+++ b/build/Android.cpplint.mk
@@ -18,7 +18,8 @@
 
 ART_CPPLINT := $(LOCAL_PATH)/tools/cpplint.py
 ART_CPPLINT_FILTER := --filter=-whitespace/line_length,-build/include,-readability/function,-readability/streams,-readability/todo,-runtime/references,-runtime/sizeof,-runtime/threadsafe_fn,-runtime/printf
-ART_CPPLINT_FLAGS := --quiet --root=$(ANDROID_BUILD_TOP)
+ART_CPPLINT_FLAGS := --root=$(TOP)
+ART_CPPLINT_QUIET := --quiet
 ART_CPPLINT_INGORED := \
     runtime/elf.h \
     runtime/openjdkjvmti/include/jvmti.h
@@ -32,12 +33,12 @@
 # "mm cpplint-art" to verify we aren't regressing
 .PHONY: cpplint-art
 cpplint-art:
-	$(ART_CPPLINT) $(ART_CPPLINT_FILTER) $(ART_CPPLINT_SRC)
+	$(ART_CPPLINT) $(ART_CPPLINT_FLAGS) $(ART_CPPLINT_FILTER) $(ART_CPPLINT_SRC)
 
 # "mm cpplint-art-all" to see all warnings
 .PHONY: cpplint-art-all
 cpplint-art-all:
-	$(ART_CPPLINT) $(ART_CPPLINT_SRC)
+	$(ART_CPPLINT) $(ART_CPPLINT_FLAGS) $(ART_CPPLINT_SRC)
 
 OUT_CPPLINT := $(TARGET_COMMON_OUT_ROOT)/cpplint
 
@@ -48,7 +49,7 @@
 art_cpplint_touch := $$(OUT_CPPLINT)/$$(subst /,__,$$(art_cpplint_file))
 
 $$(art_cpplint_touch): $$(art_cpplint_file) $(ART_CPPLINT) art/build/Android.cpplint.mk
-	$(hide) $(ART_CPPLINT) $(ART_CPPLINT_FLAGS) $(ART_CPPLINT_FILTER) $$<
+	$(hide) $(ART_CPPLINT) $(ART_CPPLINT_QUIET) $(ART_CPPLINT_FLAGS) $(ART_CPPLINT_FILTER) $$<
 	$(hide) mkdir -p $$(dir $$@)
 	$(hide) touch $$@