update golang build rules for go 1.3.3

Change-Id: I873d5f205bd0596ee3e0f992cfedb458be710e01
This commit is contained in:
Colin Cross 2014-10-22 10:55:28 -07:00
parent 5e3594f623
commit daf6499a4a

View file

@ -16,7 +16,6 @@ var (
pctx = blueprint.NewPackageContext("blueprint/bootstrap") pctx = blueprint.NewPackageContext("blueprint/bootstrap")
gcCmd = pctx.StaticVariable("gcCmd", "$goToolDir/${GoChar}g") gcCmd = pctx.StaticVariable("gcCmd", "$goToolDir/${GoChar}g")
packCmd = pctx.StaticVariable("packCmd", "$goToolDir/pack")
linkCmd = pctx.StaticVariable("linkCmd", "$goToolDir/${GoChar}l") linkCmd = pctx.StaticVariable("linkCmd", "$goToolDir/${GoChar}l")
// Ninja only reinvokes itself once when it regenerates a .ninja file. For // Ninja only reinvokes itself once when it regenerates a .ninja file. For
@ -44,18 +43,11 @@ var (
gc = pctx.StaticRule("gc", gc = pctx.StaticRule("gc",
blueprint.RuleParams{ blueprint.RuleParams{
Command: "GOROOT='$GoRoot' $gcCmd -o $out -p $pkgPath -complete " + Command: "GOROOT='$GoRoot' $gcCmd -o $out -p $pkgPath -complete " +
"$incFlags $in", "$incFlags -pack $in",
Description: "${GoChar}g $out", Description: "${GoChar}g $out",
}, },
"pkgPath", "incFlags") "pkgPath", "incFlags")
pack = pctx.StaticRule("pack",
blueprint.RuleParams{
Command: "GOROOT='$GoRoot' $packCmd grcP $prefix $out $in",
Description: "pack $out",
},
"prefix")
link = pctx.StaticRule("link", link = pctx.StaticRule("link",
blueprint.RuleParams{ blueprint.RuleParams{
Command: "GOROOT='$GoRoot' $linkCmd -o $out $libDirFlags $in", Command: "GOROOT='$GoRoot' $linkCmd -o $out $libDirFlags $in",
@ -259,9 +251,6 @@ func buildGoPackage(ctx blueprint.ModuleContext, pkgRoot string,
srcDir := srcDir(ctx) srcDir := srcDir(ctx)
srcFiles := pathtools.PrefixPaths(srcs, srcDir) srcFiles := pathtools.PrefixPaths(srcs, srcDir)
objDir := objDir(ctx)
objFile := filepath.Join(objDir, "_go_.$GoChar")
var incFlags []string var incFlags []string
deps := []string{"$gcCmd"} deps := []string{"$gcCmd"}
ctx.VisitDepsDepthFirstIf(isGoPackageProducer, ctx.VisitDepsDepthFirstIf(isGoPackageProducer,
@ -283,21 +272,11 @@ func buildGoPackage(ctx blueprint.ModuleContext, pkgRoot string,
ctx.Build(pctx, blueprint.BuildParams{ ctx.Build(pctx, blueprint.BuildParams{
Rule: gc, Rule: gc,
Outputs: []string{objFile}, Outputs: []string{archiveFile},
Inputs: srcFiles, Inputs: srcFiles,
Implicits: deps, Implicits: deps,
Args: gcArgs, Args: gcArgs,
}) })
ctx.Build(pctx, blueprint.BuildParams{
Rule: pack,
Outputs: []string{archiveFile},
Inputs: []string{objFile},
Implicits: []string{"$packCmd"},
Args: map[string]string{
"prefix": pkgRoot,
},
})
} }
func phonyGoTarget(ctx blueprint.ModuleContext, target string, srcs []string) { func phonyGoTarget(ctx blueprint.ModuleContext, target string, srcs []string) {