Remove BINMODE make variable. Use COMPILATION_MODE instead.

--
MOS_MIGRATED_REVID=131591324
diff --git a/site/versions/master/docs/bazel-user-manual.html b/site/versions/master/docs/bazel-user-manual.html
index 3480529..481a293 100644
--- a/site/versions/master/docs/bazel-user-manual.html
+++ b/site/versions/master/docs/bazel-user-manual.html
@@ -2996,8 +2996,8 @@
 </p>
 
 <pre>
-  % bazel info --show_make_env -c opt BINMODE
-  -opt
+  % bazel info --show_make_env -c opt COMPILATION_MODE
+  opt
 </pre>
 
 <p>
diff --git a/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm b/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm
index 35448ed..35454f9 100644
--- a/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm
+++ b/src/main/java/com/google/devtools/build/docgen/templates/be/make-variables.vm
@@ -107,10 +107,6 @@
 <p><strong>Tool option Variables</strong></p>
 
 <ul><!--  keep alphabetically sorted  -->
-  <li><code>BINMODE</code>: "-dbg" or "-opt"
-
-    . (<i>When using Bazel's <code>-c fastbuild</code> option,
-      this variable has the value <code>-dbg</code>.</i>) </li>
   <li><code>CC_FLAGS</code>: A minimal set of flags for the C compiler to be
     used by genrules. In particular, it contains flags to select the correct
     architecture if CC supports multiple architectures. </li>
diff --git a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
index 921f1b8..4340be6 100644
--- a/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
+++ b/src/main/java/com/google/devtools/build/lib/analysis/config/BuildConfiguration.java
@@ -1300,15 +1300,7 @@
       fragment.addGlobalMakeVariables(globalMakeEnvBuilder);
     }
 
-    // Lots of packages in third_party assume that BINMODE expands to either "-dbg", or "-opt". So
-    // for backwards compatibility we preserve that invariant, setting BINMODE to "-dbg" rather than
-    // "-fastbuild" if the compilation mode is "fastbuild".
-    // We put the real compilation mode in a new variable COMPILATION_MODE.
     globalMakeEnvBuilder.put("COMPILATION_MODE", options.compilationMode.toString());
-    globalMakeEnvBuilder.put("BINMODE", "-"
-        + ((options.compilationMode == CompilationMode.FASTBUILD)
-        ? "dbg"
-        : options.compilationMode.toString()));
     /*
      * Attention! Document these in the build-encyclopedia
      */