aboutsummaryrefslogtreecommitdiffstats
path: root/cc/gen.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2015-11-17 15:27:28 -0800
committerDan Willemsen <dwillemsen@google.com>2015-11-17 19:05:07 -0800
commitc94a768a2a6998a34f76212912ce4013a7be47f5 (patch)
tree0420066908ab1d2efaa14953a2a84282c18f4b33 /cc/gen.go
parent322a0a6b59dfe5d059b7075cd033dc0bcb49dc13 (diff)
downloadbuild_soong-c94a768a2a6998a34f76212912ce4013a7be47f5.tar.gz
build_soong-c94a768a2a6998a34f76212912ce4013a7be47f5.tar.bz2
build_soong-c94a768a2a6998a34f76212912ce4013a7be47f5.zip
Use Rule-local implicit dependencies
Depends on https://github.com/google/blueprint/pull/78 This uses the new CommandDeps field to move implicit dependencies embedded in the Command string next to the definition, instead of having to specify them in every BuildParam struct. This should make it easier to verify dependencies. Change-Id: I2711b160920e22fa962a436e1f7041272166f50f
Diffstat (limited to 'cc/gen.go')
-rw-r--r--cc/gen.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/cc/gen.go b/cc/gen.go
index 3bfe679d..be50d757 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -38,6 +38,7 @@ var (
blueprint.RuleParams{
Command: "BISON_PKGDATADIR=$yaccDataDir $yaccCmd -d $yaccFlags -o $cppFile $in && " +
"cp -f $hppFile $hFile",
+ CommandDeps: []string{"$yaccCmd"},
Description: "yacc $out",
},
"yaccFlags", "cppFile", "hppFile", "hFile")
@@ -45,6 +46,7 @@ var (
lex = pctx.StaticRule("lex",
blueprint.RuleParams{
Command: "$lexCmd -o$out $in",
+ CommandDeps: []string{"$lexCmd"},
Description: "lex $out",
})
)
@@ -57,10 +59,9 @@ func genYacc(ctx common.AndroidModuleContext, yaccFile, yaccFlags string) (cppFi
headerFile = pathtools.ReplaceExtension(cppFile, "h")
ctx.Build(pctx, blueprint.BuildParams{
- Rule: yacc,
- Outputs: []string{cppFile, headerFile},
- Inputs: []string{yaccFile},
- Implicits: []string{"$yaccCmd"},
+ Rule: yacc,
+ Outputs: []string{cppFile, headerFile},
+ Inputs: []string{yaccFile},
Args: map[string]string{
"yaccFlags": yaccFlags,
"cppFile": cppFile,
@@ -78,10 +79,9 @@ func genLex(ctx common.AndroidModuleContext, lexFile string) (cppFile string) {
cppFile = pathtools.ReplaceExtension(cppFile, "cpp")
ctx.Build(pctx, blueprint.BuildParams{
- Rule: lex,
- Outputs: []string{cppFile},
- Inputs: []string{lexFile},
- Implicits: []string{"$lexCmd"},
+ Rule: lex,
+ Outputs: []string{cppFile},
+ Inputs: []string{lexFile},
})
return cppFile