Use an environment variable instead of what's in the make cmd goals.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164992 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Makefile b/Makefile
index 288f3d4..6eec517 100644
--- a/Makefile
+++ b/Makefile
@@ -27,7 +27,7 @@
   DIRS := $(filter-out tools docs, $(DIRS))
   OPTIONAL_DIRS :=
 endif
-ifeq ($(MAKECMDGOALS),clang-only)
+ifeq ($(BUILD_CLANG_ONLY),YES)
   DIRS := $(filter-out tools docs unittests, $(DIRS))
 	tools/driver tools/libclang
   OPTIONAL_DIRS :=