Finish common makefile conversions

Change-Id: I70aed95cf03edb5ddea955c910dcd9f3503c4654
diff --git a/Android.bp b/Android.bp
index 19f014a..945ce41 100644
--- a/Android.bp
+++ b/Android.bp
@@ -33,62 +33,54 @@
 }
 
 cc_defaults {
-    name: "cuttlefish_common",
+    name: "cuttlefish_base",
     gnu_extensions: false,
     header_libs: [
         "cuttlefish_common_headers",
         "cuttlefish_kernel_headers",
     ],
-    host_supported: true,
-    device_supported: true,
     target: {
         linux: {
             host_ldlibs: ["-lrt"],
             cflags: ["-DCUTTLEFISH_HOST"],
         },
-        darwin: {
+        // We don't need 32 bit host-side builds
+        // TODO(ghartman): linux_glibc on master
+        linux_x86: {
             enabled: false,
         },
-        android: {
-            enabled: true,
-        },
-        windows: {
-            enabled: false,
-        },
-    },
-}
-
-cc_defaults {
-    name: "cuttlefish_host",
-    gnu_extensions: false,
-    header_libs: [
-        "cuttlefish_common_headers",
-        "cuttlefish_kernel_headers",
-    ],
-    // Build only 64 bit Intel Linux host executables
-    device_supported: false,
-    compile_multilib: "64",
-    target: {
-        linux: {
-            host_ldlibs: ["-lrt"],
-            cflags: ["-DCUTTLEFISH_HOST"],
-        },
+        // We don't need Darwin host-side builds
         darwin: {
             enabled: false,
         },
     },
+    vendor: true,
 }
 
+// ARM code should not touch the VSoC window on an x86 CPU.
 cc_defaults {
     name: "cuttlefish_native_isa",
-    target : {
+    target: {
         android_arm: {
             enabled: false,
         },
     },
 }
 
-cc_library {
+cc_defaults {
+    name: "cuttlefish_host_only",
+    device_supported: false,
+    host_supported: true,
+    defaults: ["cuttlefish_base"],
+}
+
+cc_defaults {
+    name: "cuttlefish_host_and_guest",
+    host_supported: true,
+    defaults: ["cuttlefish_base"],
+}
+
+cc_library_shared {
     name: "vsoc_lib",
     srcs: [
         "common/vsoc/lib/compat.cpp",
@@ -100,21 +92,15 @@
         "common/vsoc/lib/wifi_exchange_layout.cpp",
         "common/vsoc/lib/wifi_exchange_view.cpp",
     ],
-    header_libs: [
-        "cuttlefish_glog"
-    ],
-    static_libs: [
+    header_libs: ["cuttlefish_glog"],
+    shared_libs: [
         "libcuttlefish_fs",
         "cuttlefish_auto_resources",
         "libbase",
     ],
-    shared_libs: [
-        "liblog",
-    ],
     target: {
+        //TODO(ghartman): linux_glibc on master
         linux: {
-            host_ldlibs: ["-lrt"],
-            cflags: ["-DCUTTLEFISH_HOST"],
             srcs: [
                 "host/vsoc/lib/host_lock.cpp",
                 "host/vsoc/lib/region_control.cpp",
@@ -129,7 +115,7 @@
             ],
         },
     },
-    defaults: ["cuttlefish_common", "cuttlefish_native_isa"],
+    defaults: ["cuttlefish_host_and_guest", "cuttlefish_native_isa"],
 }
 
 cc_library_host_static {
@@ -138,11 +124,11 @@
         "host/vsoc/gralloc/gralloc_buffer_region.cpp",
     ],
     header_libs: ["cuttlefish_glog"],
-    static_libs: [
+    shared_libs: [
         "vsoc_lib",
         "libbase",
     ],
-    defaults: ["cuttlefish_host"],
+    defaults: ["cuttlefish_host_only"],
 }
 
 cc_test_host {
@@ -150,19 +136,11 @@
     srcs: [
         "common/vsoc/lib/circqueue_test.cpp",
     ],
-    static_libs: [
+    shared_libs: [
         "vsoc_lib",
         "libbase",
     ],
-    target : {
-        linux_x86_64: {
-            static_libs: [
-                "libcuttlefish_host_config",
-        	"libgflags",
-            ],
-        },
-    },
-    defaults: ["cuttlefish_host"],
+    defaults: ["cuttlefish_host_only"],
 }
 
 cc_test_host {
@@ -170,14 +148,16 @@
     srcs: [
         "common/vsoc/lib/lock_test.cpp",
     ],
-    static_libs: [
+    shared_libs: [
         "vsoc_lib",
-        "libgtest_host",
-        "libbase",
-        "cuttlefish_auto_resources",
         "libcuttlefish_fs",
+        "cuttlefish_auto_resources",
+        "libbase",
     ],
-    defaults: ["cuttlefish_host"],
+    static_libs: [
+        "libgtest_host",
+    ],
+    defaults: ["cuttlefish_host_only"],
 }
 
 cc_test_host {
@@ -185,11 +165,11 @@
     srcs: [
         "common/vsoc/lib/graphics_test.cpp",
     ],
-    static_libs: [
+    shared_libs: [
         "vsoc_lib",
         "libbase",
     ],
-    defaults: ["cuttlefish_host"],
+    defaults: ["cuttlefish_host_only"],
 }
 
 cc_binary_host {
@@ -197,14 +177,16 @@
     srcs: [
         "host/vsoc/lib/host_region_e2e_test.cpp",
     ],
-    static_libs: [
+    shared_libs: [
         "vsoc_lib",
-        "libgtest_host",
-        "libbase",
-        "cuttlefish_auto_resources",
         "libcuttlefish_fs",
+        "cuttlefish_auto_resources",
+        "libbase",
+    ],
+    static_libs: [
         "libcuttlefish_host_config",
+        "libgtest_host",
         "libgflags",
     ],
-    defaults: ["cuttlefish_host"],
+    defaults: ["cuttlefish_host_only"],
 }