Clean up installing

Use the config to get paths to install to, allow installing
a file to a different file name than the intermediate file,
and allow dependencies between installed files.

Change-Id: I37ac32d2fa1458150b6d54f6ec9cdac70a0259e8
diff --git a/config/config.go b/config/config.go
index 6cb61e4..4e9cbf1 100644
--- a/config/config.go
+++ b/config/config.go
@@ -19,6 +19,7 @@
 	"encoding/json"
 	"fmt"
 	"os"
+	"path/filepath"
 	"runtime"
 )
 
@@ -168,3 +169,29 @@
 func (c *Config) EnvDeps() map[string]string {
 	return c.envDeps
 }
+
+// DeviceName returns the name of the current device target
+// TODO: take an AndroidModuleContext to select the device name for multi-device builds
+func (c *Config) DeviceName() string {
+	return "unset"
+}
+
+// DeviceOut returns the path to out directory for device targets
+func (c *Config) DeviceOut() string {
+	return filepath.Join("target/product", c.DeviceName())
+}
+
+// HostOut returns the path to out directory for host targets
+func (c *Config) HostOut() string {
+	return filepath.Join("host", c.PrebuiltOS())
+}
+
+// HostBin returns the path to bin directory for host targets
+func (c *Config) HostBin() string {
+	return filepath.Join(c.HostOut(), "bin")
+}
+
+// HostBinTool returns the path to a host tool in the bin directory for host targets
+func (c *Config) HostBinTool(tool string) (string, error) {
+	return filepath.Join(c.HostBin(), tool), nil
+}