Make binaries executable

Split InstallFileName into InstallExecutable that does chmod +x
after copying the file.  Also remove InstallFile and rename
InstallFileName to InstallFile.

Test: m -j checkbuild
Change-Id: Id41ad4eafe521f6cd5d8cc250b7747ecb3da8dfc
diff --git a/cc/installer.go b/cc/installer.go
index 7bedc56..027d191 100644
--- a/cc/installer.go
+++ b/cc/installer.go
@@ -76,7 +76,7 @@
 }
 
 func (installer *baseInstaller) install(ctx ModuleContext, file android.Path) {
-	installer.path = ctx.InstallFile(installer.installDir(ctx), file)
+	installer.path = ctx.InstallFile(installer.installDir(ctx), file.Base(), file)
 }
 
 func (installer *baseInstaller) inData() bool {
diff --git a/cc/ndk_headers.go b/cc/ndk_headers.go
index 5fa3232..140cc2f 100644
--- a/cc/ndk_headers.go
+++ b/cc/ndk_headers.go
@@ -122,7 +122,7 @@
 	srcFiles := ctx.ExpandSources(m.properties.Srcs, nil)
 	for _, header := range srcFiles {
 		installDir := getHeaderInstallDir(ctx, header, m.properties.From, m.properties.To)
-		installedPath := ctx.InstallFile(installDir, header)
+		installedPath := ctx.InstallFile(installDir, header.Base(), header)
 		installPath := installDir.Join(ctx, header.Base())
 		if installPath != installedPath {
 			panic(fmt.Sprintf(
diff --git a/cc/ndk_library.go b/cc/ndk_library.go
index fc7cd91..a408fc5 100644
--- a/cc/ndk_library.go
+++ b/cc/ndk_library.go
@@ -341,7 +341,7 @@
 
 	installDir := getNdkInstallBase(ctx).Join(ctx, fmt.Sprintf(
 		"platforms/android-%s/arch-%s/usr/%s", apiLevel, arch, libDir))
-	stub.installPath = ctx.InstallFile(installDir, path).String()
+	stub.installPath = ctx.InstallFile(installDir, path.Base(), path).String()
 }
 
 func newStubLibrary() *Module {
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index 089ce28..9fca053 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -125,7 +125,7 @@
 		outputFile := android.PathForModuleOut(ctx, fileName)
 
 		ctx.ModuleBuild(pctx, android.ModuleBuildParams{
-			Rule:        android.Cp,
+			Rule:        android.CpExecutable,
 			Description: "prebuilt",
 			Output:      outputFile,
 			Input:       p.Prebuilt.SingleSourcePath(ctx),