From d2e95fb295c900af3c054a65fcac8227b128a5da Mon Sep 17 00:00:00 2001 From: Dan Willemsen Date: Wed, 20 Sep 2017 14:30:50 -0700 Subject: [PATCH] Fix mma/mmma when soong is not embedded in make Now `mma --skip-make` works. Test: mmma --skip-make external/googletest Change-Id: I86cccefc3c5174773d185c6e16bc52fe2c2010b3 --- android/module.go | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/android/module.go b/android/module.go index bacf66634..1809b0889 100644 --- a/android/module.go +++ b/android/module.go @@ -926,7 +926,7 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx blueprint.SingletonConte checkbuildDeps := []string{} mmTarget := func(dir string) string { - return filepath.Join("mm", dir) + return "MODULES-IN-" + strings.Replace(filepath.Clean(dir), "/", "-", -1) } modulesInDir := make(map[string][]string) @@ -961,6 +961,11 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx blueprint.SingletonConte Optional: true, }) + // Make will generate the MODULES-IN-* targets + if ctx.Config().(Config).EmbeddedInMake() { + return + } + // Ensure ancestor directories are in modulesInDir dirs := sortedKeys(modulesInDir) for _, dir := range dirs { @@ -983,8 +988,9 @@ func (c *buildTargetSingleton) GenerateBuildActions(ctx blueprint.SingletonConte } } - // Create a mm/ target that depends on all modules in a directory, and depends - // on the mm/* targets of all of its subdirectories that contain Android.bp files. + // Create a MODULES-IN- target that depends on all modules in a directory, and + // depends on the MODULES-IN-* targets of all of its subdirectories that contain Android.bp + // files. for _, dir := range dirs { ctx.Build(pctx, blueprint.BuildParams{ Rule: blueprint.Phony,