Always write makefile for ${TARGET_RELEASE}

When writing all makefiles, we also need to write the makefile for
${TARGET_RELEASE}.  We can skip writing it a second time if it is not
an alias.

Bug: 328495189
Test: manual, TH
Change-Id: Ia5d1955f419312c76eb9c8a33b1c8a6bcc5efe0b
This commit is contained in:
LaMont Jones
2024-05-08 09:13:13 -07:00
parent d02d710570
commit 992011ea77

View File

@@ -83,19 +83,23 @@ func main() {
// We were told to guard operation and either we have no build flag, or it is False.
// Write an empty file so that release_config.mk will use the old process.
os.WriteFile(makefilePath, []byte{}, 0644)
} else if allMake {
return
}
// Write the makefile where release_config.mk is going to look for it.
err = configs.WriteMakefile(makefilePath, targetRelease)
if err != nil {
panic(err)
}
if allMake {
// Write one makefile per release config, using the canonical release name.
for k, _ := range configs.ReleaseConfigs {
if k != targetRelease {
makefilePath = filepath.Join(outputDir, fmt.Sprintf("release_config-%s-%s.mk", product, k))
err = configs.WriteMakefile(makefilePath, k)
if err != nil {
panic(err)
}
}
} else {
err = configs.WriteMakefile(makefilePath, targetRelease)
if err != nil {
panic(err)
}
}
if json {