diff options
author | 2025-01-22 10:44:36 -0800 | |
---|---|---|
committer | 2025-01-22 10:44:36 -0800 | |
commit | 71e3e7a826242ebcd404dbfddcc07d3bbcea56a2 (patch) | |
tree | acc3e5bc113a5b5640fdb000d24247725d5ddb63 /android/module.go | |
parent | da481ebb2866117f03278654e0aed4dd8362f6bc (diff) |
`m <module>` builds default output files as well
`m <module>` previously only built the installed files and the
checkbuilded files. Also build the output files, because some modules
like genrules don't have any installed/checkbuilded files, only output
files, so before, they weren't able to be built with `m <module>`
Bug: 376727180
Test: m trusty-x86_64.lk.elf.gen
Change-Id: I8f4ce48f2c6c493b8a624b3be7b5238008272f90
Diffstat (limited to 'android/module.go')
-rw-r--r-- | android/module.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/android/module.go b/android/module.go index a58057e43..c81380eea 100644 --- a/android/module.go +++ b/android/module.go @@ -1655,6 +1655,7 @@ func (m *ModuleBase) generateVariantTarget(ctx *moduleContext) { func (m *ModuleBase) generateModuleTarget(ctx *moduleContext) { var allInstalledFiles InstallPaths var allCheckbuildTargets Paths + var alloutputFiles Paths ctx.VisitAllModuleVariantProxies(func(module ModuleProxy) { var checkbuildTarget Path var uncheckedModule bool @@ -1671,6 +1672,9 @@ func (m *ModuleBase) generateModuleTarget(ctx *moduleContext) { uncheckedModule = info.UncheckedModule skipAndroidMkProcessing = OtherModuleProviderOrDefault(ctx, module, CommonModuleInfoKey).SkipAndroidMkProcessing } + if outputFiles, err := outputFilesForModule(ctx, module, ""); err == nil { + alloutputFiles = append(alloutputFiles, outputFiles...) + } // A module's -checkbuild phony targets should // not be created if the module is not exported to make. // Those could depend on the build target and fail to compile @@ -1702,6 +1706,12 @@ func (m *ModuleBase) generateModuleTarget(ctx *moduleContext) { deps = append(deps, PathForPhony(ctx, name)) } + if len(alloutputFiles) > 0 { + name := namespacePrefix + ctx.ModuleName() + "-outputs" + ctx.Phony(name, alloutputFiles...) + deps = append(deps, PathForPhony(ctx, name)) + } + if len(deps) > 0 { suffix := "" if ctx.Config().KatiEnabled() { |