Revert "Export non-apex variants of modules to make"

Revert submission 2462194-androidmk_for_apex_dependencies

Reason for revert: DroidMonitor-triggered revert due to breakage https://android-build.googleplex.com/builds/quarterdeck?branch=aosp-master&target=full-eng&lkgb=9723453&lkbb=9724944&fkbb=9723508, bug b/272663333.

Reverted changes: /q/submissionid:2462194-androidmk_for_apex_dependencies

Bug: 272663333
Change-Id: I847fa910a8d54de19954f56fe92a80a9bcd0ee18
diff --git a/cc/cc.go b/cc/cc.go
index e592cc5..0e88c56 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -609,6 +609,7 @@
 	inSanitizerDir() bool
 	hostToolPath() android.OptionalPath
 	relativeInstallPath() string
+	makeUninstallable(mod *Module)
 	installInRoot() bool
 }
 
@@ -3534,6 +3535,14 @@
 	return c.InRecovery()
 }
 
+func (c *Module) MakeUninstallable() {
+	if c.installer == nil {
+		c.ModuleBase.MakeUninstallable()
+		return
+	}
+	c.installer.makeUninstallable(c)
+}
+
 func (c *Module) HostToolPath() android.OptionalPath {
 	if c.installer == nil {
 		return android.OptionalPath{}
diff --git a/cc/installer.go b/cc/installer.go
index c3618b7..e2c0e7b 100644
--- a/cc/installer.go
+++ b/cc/installer.go
@@ -121,6 +121,10 @@
 	return String(installer.Properties.Relative_install_path)
 }
 
+func (installer *baseInstaller) makeUninstallable(mod *Module) {
+	mod.ModuleBase.MakeUninstallable()
+}
+
 func (installer *baseInstaller) installInRoot() bool {
 	return Bool(installer.Properties.Install_in_root)
 }
diff --git a/cc/library.go b/cc/library.go
index 6891f5b..e73af81 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -2424,6 +2424,17 @@
 	return nil
 }
 
+func (library *libraryDecorator) makeUninstallable(mod *Module) {
+	if library.static() && library.buildStatic() && !library.buildStubs() {
+		// If we're asked to make a static library uninstallable we don't do
+		// anything since AndroidMkEntries always sets LOCAL_UNINSTALLABLE_MODULE
+		// for these entries. This is done to still get the make targets for NOTICE
+		// files from notice_files.mk, which other libraries might depend on.
+		return
+	}
+	mod.ModuleBase.MakeUninstallable()
+}
+
 func (library *libraryDecorator) getPartition() string {
 	return library.path.Partition()
 }
diff --git a/cc/prebuilt.go b/cc/prebuilt.go
index 9ac812c..bb517ea 100644
--- a/cc/prebuilt.go
+++ b/cc/prebuilt.go
@@ -214,7 +214,7 @@
 			// without the prefix hack below.
 			if p.hasStubsVariants() && !p.buildStubs() && !ctx.Host() &&
 				!strings.HasPrefix(ctx.baseModuleName(), "libclang_rt.") {
-				ctx.Module().SkipInstall()
+				ctx.Module().MakeUninstallable()
 			}
 
 			return outputFile