diff --git a/src/com/google/doclava/Doclava.java b/src/com/google/doclava/Doclava.java
index b7e06cb..4bdf245 100644
--- a/src/com/google/doclava/Doclava.java
+++ b/src/com/google/doclava/Doclava.java
@@ -80,6 +80,9 @@
 
   public static JSilver jSilver = null;
 
+  private static boolean gmsRef = false;
+  private static boolean gcmRef = false;
+
   public static boolean checkLevel(int level) {
     return (showLevel & level) == level;
   }
@@ -173,7 +176,7 @@
       } else if (a[0].equals("-keeplist")) {
         keepListFile = a[1];
       } else if (a[0].equals("-proguard")) {
-          proguardFile = a[1];
+        proguardFile = a[1];
       } else if (a[0].equals("-proofread")) {
         proofreadFile = a[1];
       } else if (a[0].equals("-todo")) {
@@ -280,7 +283,13 @@
       writeAssets();
 
       // Navigation tree
-      NavTree.writeNavTree(javadocDir);
+       String refPrefix = new String();
+      if(gmsRef){
+        refPrefix = "gms-";
+      } else if(gcmRef){
+        refPrefix = "gcm-";
+      }
+      NavTree.writeNavTree(javadocDir, refPrefix);
 
       // Write yaml tree.
       if (yamlNavFile != null){
@@ -288,7 +297,7 @@
       }
 
       // Packages Pages
-      writePackages(javadocDir + "packages" + htmlExtension);
+      writePackages(javadocDir + refPrefix + "packages" + htmlExtension);
 
       // Classes
       writeClassLists();
@@ -550,9 +559,16 @@
     if (option.equals("-yaml")) {
       return 2;
     }
+    if (option.equals("-gmsref")) {
+      gmsRef = true;
+      return 1;
+    }
+    if (option.equals("-gcmref")) {
+      gcmRef = true;
+      return 1;
+    }
     return 0;
   }
-
   public static boolean validOptions(String[][] options, DocErrorReporter r) {
     for (String[] a : options) {
       if (a[0].equals("-error") || a[0].equals("-warning") || a[0].equals("-hide")) {
@@ -641,7 +657,11 @@
       if (allHidden) {
         continue;
       }
-
+      if(gmsRef){
+          data.setValue("reference.gms", "true");
+      } else if(gcmRef){
+          data.setValue("reference.gcm", "true");
+      }
       data.setValue("reference", "1");
       data.setValue("reference.apilevels", sinceTagger.hasVersions() ? "1" : "0");
       data.setValue("docs.packages." + i + ".name", s);
diff --git a/src/com/google/doclava/NavTree.java b/src/com/google/doclava/NavTree.java
index 5323213..aa02d7c 100644
--- a/src/com/google/doclava/NavTree.java
+++ b/src/com/google/doclava/NavTree.java
@@ -25,12 +25,12 @@
 
 public class NavTree {
 
-  public static void writeNavTree(String dir) {
+  public static void writeNavTree(String dir, String refPrefix) {
     List<Node> children = new ArrayList<Node>();
     for (PackageInfo pkg : Doclava.choosePackages()) {
       children.add(makePackageNode(pkg));
     }
-    Node node = new Node("Reference", dir + "packages.html", children, null);
+    Node node = new Node("Reference", dir + refPrefix + "packages.html", children, null);
 
     StringBuilder buf = new StringBuilder();
     if (false) {
@@ -45,7 +45,13 @@
 
     Data data = Doclava.makeHDF();
     data.setValue("reference_tree", buf.toString());
-    ClearPage.write(data, "navtree_data.cs", "navtree_data.js");
+    if (refPrefix == "gms-"){
+      ClearPage.write(data, "gms_navtree_data.cs", "gms_navtree_data.js");
+    } else if (refPrefix == "gcm-"){
+      ClearPage.write(data, "gcm_navtree_data.cs", "gcm_navtree_data.js");
+    } else {
+      ClearPage.write(data, "navtree_data.cs", "navtree_data.js");
+    }
   }
 
   /**
