Support custom suffixes on Makefile outputs
This way Make can use different output files for different targets, and switch between them without having to reparse all the makefiles. Change-Id: I00001a09d79025772d966f443ab9f130e35f4720
This commit is contained in:
@@ -26,6 +26,7 @@ import (
|
|||||||
"android/soong"
|
"android/soong"
|
||||||
|
|
||||||
"github.com/google/blueprint"
|
"github.com/google/blueprint"
|
||||||
|
"github.com/google/blueprint/proptools"
|
||||||
)
|
)
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
@@ -54,11 +55,13 @@ func AndroidMkSingleton() blueprint.Singleton {
|
|||||||
type androidMkSingleton struct{}
|
type androidMkSingleton struct{}
|
||||||
|
|
||||||
func (c *androidMkSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
func (c *androidMkSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
|
||||||
if !ctx.Config().(Config).EmbeddedInMake() {
|
config := ctx.Config().(Config)
|
||||||
|
|
||||||
|
if !config.EmbeddedInMake() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.SetNinjaBuildDir(pctx, filepath.Join(ctx.Config().(Config).buildDir, ".."))
|
ctx.SetNinjaBuildDir(pctx, filepath.Join(config.buildDir, ".."))
|
||||||
|
|
||||||
var androidMkModulesList []AndroidModule
|
var androidMkModulesList []AndroidModule
|
||||||
|
|
||||||
@@ -70,7 +73,7 @@ func (c *androidMkSingleton) GenerateBuildActions(ctx blueprint.SingletonContext
|
|||||||
|
|
||||||
sort.Sort(AndroidModulesByName{androidMkModulesList, ctx})
|
sort.Sort(AndroidModulesByName{androidMkModulesList, ctx})
|
||||||
|
|
||||||
transMk := PathForOutput(ctx, "Android.mk")
|
transMk := PathForOutput(ctx, "Android"+proptools.String(config.ProductVariables.Make_suffix)+".mk")
|
||||||
if ctx.Failed() {
|
if ctx.Failed() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@@ -52,6 +52,9 @@ type variableProperties struct {
|
|||||||
var zeroProductVariables variableProperties
|
var zeroProductVariables variableProperties
|
||||||
|
|
||||||
type productVariables struct {
|
type productVariables struct {
|
||||||
|
// Suffix to add to generated Makefiles
|
||||||
|
Make_suffix *string `json:",omitempty"`
|
||||||
|
|
||||||
Platform_sdk_version *int `json:",omitempty"`
|
Platform_sdk_version *int `json:",omitempty"`
|
||||||
|
|
||||||
DeviceName *string `json:",omitempty"`
|
DeviceName *string `json:",omitempty"`
|
||||||
|
Reference in New Issue
Block a user