Put common code in a shared target rather than copying lines.

Change-Id: I4de28e5ff28f92e7c69ec8c72d8296c1cdbc4db4
diff --git a/test/hftest/BUILD.gn b/test/hftest/BUILD.gn
index 5f2469a..51968c1 100644
--- a/test/hftest/BUILD.gn
+++ b/test/hftest/BUILD.gn
@@ -24,19 +24,9 @@
 
   public_configs = [ ":hftest_config" ]
 
-  sources = [
-    "hftest.c",
-  ]
-
   deps = [
-    "//src:common",
-    "//src:dlog",
-    "//src:fdt",
-    "//src:memiter",
-    "//src/arch/${plat_arch}:entry",
-    "//src/arch/${plat_arch}/hftest:entry",
+    ":hftest_standalone",
     "//src/arch/${plat_arch}/hftest:hf_call",
-    "//src/arch/${plat_arch}/hftest:power_mgmt",
   ]
 }
 
@@ -65,6 +55,15 @@
 # Testing framework for a hypervisor.
 source_set("hftest_hypervisor") {
   testonly = true
+  public_configs = [ ":hftest_config" ]
+  deps = [
+    ":hftest_standalone",
+  ]
+}
+
+source_set("hftest_standalone") {
+  visibility = [ ":*" ]
+  testonly = true
 
   public_configs = [ ":hftest_config" ]