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

This reverts commit 502da3987a488307ffab5b5b2cedc119892e40d6.

Reason for revert: b/274195633

```
In file included from out/soong/installs-aosp_cf_x86_pasan.mk:134984:
In file included from out/soong/Android-aosp_cf_x86_pasan.mk:981696:
In file included from build/make/core/soong_cc_rust_prebuilt.mk:76:
build/make/core/base_rules.mk:342: error: packages/modules/Uwb/service/uci/jni: MODULE.TARGET.SHARED_LIBRARIES.libuwb_uci_jni_rust already defined by packages/modules/Uwb/service/uci/jni.
```

Change-Id: Ic1ea6969e54c23a7d126eb0fb47ab6f2e44ee965
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 574c4c3..27f0623 100644
--- a/cc/library.go
+++ b/cc/library.go
@@ -2439,6 +2439,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 c237d75..5b7ba43 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