aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-05-11 00:27:49 -0700
committerDan Willemsen <dwillemsen@google.com>2016-05-11 00:38:00 -0700
commit174978cc5834844517fc58f396561f2b24f3a169 (patch)
treebcf7be91c56f71ce50b106b7890b8488ac722e7d
parentac6697420aebc6e7f98d5a73c8d4c525bf8de419 (diff)
downloadbuild_soong-174978cc5834844517fc58f396561f2b24f3a169.tar.gz
build_soong-174978cc5834844517fc58f396561f2b24f3a169.tar.bz2
build_soong-174978cc5834844517fc58f396561f2b24f3a169.zip
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
-rw-r--r--common/androidmk.go9
-rw-r--r--common/variable.go3
2 files changed, 9 insertions, 3 deletions
diff --git a/common/androidmk.go b/common/androidmk.go
index a16a652d..6a2ede06 100644
--- a/common/androidmk.go
+++ b/common/androidmk.go
@@ -26,6 +26,7 @@ import (
"android/soong"
"github.com/google/blueprint"
+ "github.com/google/blueprint/proptools"
)
func init() {
@@ -54,11 +55,13 @@ func AndroidMkSingleton() blueprint.Singleton {
type androidMkSingleton struct{}
func (c *androidMkSingleton) GenerateBuildActions(ctx blueprint.SingletonContext) {
- if !ctx.Config().(Config).EmbeddedInMake() {
+ config := ctx.Config().(Config)
+
+ if !config.EmbeddedInMake() {
return
}
- ctx.SetNinjaBuildDir(pctx, filepath.Join(ctx.Config().(Config).buildDir, ".."))
+ ctx.SetNinjaBuildDir(pctx, filepath.Join(config.buildDir, ".."))
var androidMkModulesList []AndroidModule
@@ -70,7 +73,7 @@ func (c *androidMkSingleton) GenerateBuildActions(ctx blueprint.SingletonContext
sort.Sort(AndroidModulesByName{androidMkModulesList, ctx})
- transMk := PathForOutput(ctx, "Android.mk")
+ transMk := PathForOutput(ctx, "Android"+proptools.String(config.ProductVariables.Make_suffix)+".mk")
if ctx.Failed() {
return
}
diff --git a/common/variable.go b/common/variable.go
index ae727617..7f8a6e62 100644
--- a/common/variable.go
+++ b/common/variable.go
@@ -52,6 +52,9 @@ type variableProperties struct {
var zeroProductVariables variableProperties
type productVariables struct {
+ // Suffix to add to generated Makefiles
+ Make_suffix *string `json:",omitempty"`
+
Platform_sdk_version *int `json:",omitempty"`
DeviceName *string `json:",omitempty"`