aboutsummaryrefslogtreecommitdiffstats
path: root/cc/gen.go
diff options
context:
space:
mode:
authorDan Willemsen <dwillemsen@google.com>2016-11-02 20:43:13 -0700
committerDan Willemsen <dwillemsen@google.com>2016-11-02 21:19:11 -0700
commit21ec49068f7be873e963dd8dc5cff610539540c5 (patch)
treec99797f9e04319a88c26d8bf189d740f63744dcd /cc/gen.go
parenteb716e25590a50541c5c2b3be81ae0468ac35690 (diff)
downloadbuild_soong-21ec49068f7be873e963dd8dc5cff610539540c5.tar.gz
build_soong-21ec49068f7be873e963dd8dc5cff610539540c5.tar.bz2
build_soong-21ec49068f7be873e963dd8dc5cff610539540c5.zip
Add subdir to GenPath
We were emulating this for proto files, standardize it and make the other generators use it as well. Test: Compare out/soong/build.ninja before/after change Test: mmma -j system/tools/hidl Change-Id: I1888c7b981749060a398387bbb9b481270bf6d75
Diffstat (limited to 'cc/gen.go')
-rw-r--r--cc/gen.go10
1 files changed, 5 insertions, 5 deletions
diff --git a/cc/gen.go b/cc/gen.go
index 14518956..9d3a67cf 100644
--- a/cc/gen.go
+++ b/cc/gen.go
@@ -48,7 +48,7 @@ var (
)
func genYacc(ctx android.ModuleContext, yaccFile android.Path, outFile android.ModuleGenPath, yaccFlags string) (headerFile android.ModuleGenPath) {
- headerFile = android.GenPathWithExt(ctx, yaccFile, "h")
+ headerFile = android.GenPathWithExt(ctx, "yacc", yaccFile, "h")
ctx.ModuleBuild(pctx, android.ModuleBuildParams{
Rule: yacc,
@@ -80,19 +80,19 @@ func genSources(ctx android.ModuleContext, srcFiles android.Paths,
for i, srcFile := range srcFiles {
switch srcFile.Ext() {
case ".y":
- cFile := android.GenPathWithExt(ctx, srcFile, "c")
+ cFile := android.GenPathWithExt(ctx, "yacc", srcFile, "c")
srcFiles[i] = cFile
deps = append(deps, genYacc(ctx, srcFile, cFile, buildFlags.yaccFlags))
case ".yy":
- cppFile := android.GenPathWithExt(ctx, srcFile, "cpp")
+ cppFile := android.GenPathWithExt(ctx, "yacc", srcFile, "cpp")
srcFiles[i] = cppFile
deps = append(deps, genYacc(ctx, srcFile, cppFile, buildFlags.yaccFlags))
case ".l":
- cFile := android.GenPathWithExt(ctx, srcFile, "c")
+ cFile := android.GenPathWithExt(ctx, "lex", srcFile, "c")
srcFiles[i] = cFile
genLex(ctx, srcFile, cFile)
case ".ll":
- cppFile := android.GenPathWithExt(ctx, srcFile, "cpp")
+ cppFile := android.GenPathWithExt(ctx, "lex", srcFile, "cpp")
srcFiles[i] = cppFile
genLex(ctx, srcFile, cppFile)
case ".proto":