Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 1 | // Copyright 2015 Google Inc. All rights reserved. |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | package cc |
| 16 | |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 17 | import ( |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 18 | "path/filepath" |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 19 | "strings" |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 20 | |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 21 | "github.com/google/blueprint" |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 22 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 23 | "android/soong/android" |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 24 | ) |
| 25 | |
| 26 | func init() { |
Dan Willemsen | e1240db | 2016-11-03 14:28:51 -0700 | [diff] [blame] | 27 | pctx.HostBinToolVariable("aidlCmd", "aidl-cpp") |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 28 | pctx.HostBinToolVariable("syspropCmd", "sysprop_cpp") |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 29 | } |
| 30 | |
| 31 | var ( |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 32 | sysprop = pctx.AndroidStaticRule("sysprop", |
| 33 | blueprint.RuleParams{ |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 34 | Command: "$syspropCmd --header-dir=$headerOutDir --public-header-dir=$publicOutDir " + |
Inseob Kim | c0907f1 | 2019-02-08 21:00:45 +0900 | [diff] [blame] | 35 | "--source-dir=$srcOutDir --include-name=$includeName $in", |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 36 | CommandDeps: []string{"$syspropCmd"}, |
| 37 | }, |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 38 | "headerOutDir", "publicOutDir", "srcOutDir", "includeName") |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 39 | |
Dan Willemsen | 4f1c3d4 | 2017-09-09 01:15:26 -0700 | [diff] [blame] | 40 | windmc = pctx.AndroidStaticRule("windmc", |
| 41 | blueprint.RuleParams{ |
| 42 | Command: "$windmcCmd -r$$(dirname $out) -h$$(dirname $out) $in", |
| 43 | CommandDeps: []string{"$windmcCmd"}, |
| 44 | }, |
| 45 | "windmcCmd") |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 46 | ) |
| 47 | |
Dan Willemsen | 4e0aa23 | 2019-04-10 22:59:54 -0700 | [diff] [blame] | 48 | type YaccProperties struct { |
| 49 | // list of module-specific flags that will be used for .y and .yy compiles |
| 50 | Flags []string |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 51 | |
Dan Willemsen | 4e0aa23 | 2019-04-10 22:59:54 -0700 | [diff] [blame] | 52 | // whether the yacc files will produce a location.hh file |
| 53 | Gen_location_hh *bool |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 54 | |
Dan Willemsen | 4e0aa23 | 2019-04-10 22:59:54 -0700 | [diff] [blame] | 55 | // whether the yacc files will product a position.hh file |
| 56 | Gen_position_hh *bool |
| 57 | } |
| 58 | |
| 59 | func genYacc(ctx android.ModuleContext, rule *android.RuleBuilder, yaccFile android.Path, |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 60 | outFile android.ModuleGenPath, props *YaccProperties, |
| 61 | tools map[string]android.Path) (headerFiles android.Paths) { |
Dan Willemsen | 4e0aa23 | 2019-04-10 22:59:54 -0700 | [diff] [blame] | 62 | |
| 63 | outDir := android.PathForModuleGen(ctx, "yacc") |
| 64 | headerFile := android.GenPathWithExt(ctx, "yacc", yaccFile, "h") |
| 65 | ret := android.Paths{headerFile} |
| 66 | |
| 67 | cmd := rule.Command() |
| 68 | |
| 69 | // Fix up #line markers to not use the sbox temporary directory |
| 70 | sedCmd := "sed -i.bak 's#__SBOX_OUT_DIR__#" + outDir.String() + "#'" |
| 71 | rule.Command().Text(sedCmd).Input(outFile) |
| 72 | rule.Command().Text(sedCmd).Input(headerFile) |
| 73 | |
| 74 | var flags []string |
| 75 | if props != nil { |
| 76 | flags = props.Flags |
| 77 | |
| 78 | if Bool(props.Gen_location_hh) { |
| 79 | locationHeader := outFile.InSameDir(ctx, "location.hh") |
| 80 | ret = append(ret, locationHeader) |
| 81 | cmd.ImplicitOutput(locationHeader) |
| 82 | rule.Command().Text(sedCmd).Input(locationHeader) |
| 83 | } |
| 84 | if Bool(props.Gen_position_hh) { |
| 85 | positionHeader := outFile.InSameDir(ctx, "position.hh") |
| 86 | ret = append(ret, positionHeader) |
| 87 | cmd.ImplicitOutput(positionHeader) |
| 88 | rule.Command().Text(sedCmd).Input(positionHeader) |
| 89 | } |
| 90 | } |
| 91 | |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 92 | bison, ok := tools["bison"] |
| 93 | if !ok { |
| 94 | ctx.ModuleErrorf("Unable to find bison") |
| 95 | } |
| 96 | m4, ok := tools["m4"] |
| 97 | if !ok { |
| 98 | ctx.ModuleErrorf("Unable to find m4") |
| 99 | } |
| 100 | |
| 101 | cmd.FlagWithInput("M4=", m4). |
| 102 | Tool(bison). |
Dan Willemsen | 4e0aa23 | 2019-04-10 22:59:54 -0700 | [diff] [blame] | 103 | Flag("-d"). |
| 104 | Flags(flags). |
| 105 | FlagWithOutput("--defines=", headerFile). |
| 106 | Flag("-o").Output(outFile).Input(yaccFile) |
| 107 | |
| 108 | return ret |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 109 | } |
| 110 | |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 111 | func genAidl(ctx android.ModuleContext, rule *android.RuleBuilder, aidlFile android.Path, |
| 112 | outFile, depFile android.ModuleGenPath, aidlFlags string) android.Paths { |
Dan Willemsen | e1240db | 2016-11-03 14:28:51 -0700 | [diff] [blame] | 113 | |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 114 | aidlPackage := strings.TrimSuffix(aidlFile.Rel(), aidlFile.Base()) |
| 115 | baseName := strings.TrimSuffix(aidlFile.Base(), aidlFile.Ext()) |
Daniel Norman | 10b7435 | 2019-09-24 17:39:58 -0700 | [diff] [blame] | 116 | shortName := baseName |
| 117 | // TODO(b/111362593): aidl_to_cpp_common.cpp uses heuristics to figure out if |
| 118 | // an interface name has a leading I. Those same heuristics have been |
| 119 | // moved here. |
| 120 | if len(baseName) >= 2 && baseName[0] == 'I' && |
| 121 | strings.ToUpper(baseName)[1] == baseName[1] { |
| 122 | shortName = strings.TrimPrefix(baseName, "I") |
| 123 | } |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 124 | |
| 125 | outDir := android.PathForModuleGen(ctx, "aidl") |
| 126 | headerI := outDir.Join(ctx, aidlPackage, baseName+".h") |
| 127 | headerBn := outDir.Join(ctx, aidlPackage, "Bn"+shortName+".h") |
| 128 | headerBp := outDir.Join(ctx, aidlPackage, "Bp"+shortName+".h") |
| 129 | |
Jiyong Park | 2907459 | 2019-07-07 16:27:47 +0900 | [diff] [blame] | 130 | baseDir := strings.TrimSuffix(aidlFile.String(), aidlFile.Rel()) |
| 131 | if baseDir != "" { |
| 132 | aidlFlags += " -I" + baseDir |
| 133 | } |
| 134 | |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 135 | cmd := rule.Command() |
Colin Cross | ee94d6a | 2019-07-08 17:08:34 -0700 | [diff] [blame] | 136 | cmd.BuiltTool(ctx, "aidl-cpp"). |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 137 | FlagWithDepFile("-d", depFile). |
| 138 | Flag("--ninja"). |
| 139 | Flag(aidlFlags). |
| 140 | Input(aidlFile). |
| 141 | OutputDir(). |
| 142 | Output(outFile). |
| 143 | ImplicitOutputs(android.WritablePaths{ |
| 144 | headerI, |
| 145 | headerBn, |
| 146 | headerBp, |
| 147 | }) |
| 148 | |
| 149 | return android.Paths{ |
| 150 | headerI, |
| 151 | headerBn, |
| 152 | headerBp, |
| 153 | } |
Dan Willemsen | e1240db | 2016-11-03 14:28:51 -0700 | [diff] [blame] | 154 | } |
| 155 | |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 156 | func genLex(ctx android.ModuleContext, rule *android.RuleBuilder, lexFile android.Path, |
| 157 | outFile android.ModuleGenPath, tools map[string]android.Path) { |
| 158 | |
| 159 | flex, ok := tools["flex"] |
| 160 | if !ok { |
| 161 | ctx.ModuleErrorf("Unable to find flex") |
| 162 | } |
| 163 | m4, ok := tools["m4"] |
| 164 | if !ok { |
| 165 | ctx.ModuleErrorf("Unable to find m4") |
| 166 | } |
| 167 | |
| 168 | rule.Command(). |
| 169 | FlagWithInput("M4=", m4). |
| 170 | Tool(flex). |
| 171 | FlagWithOutput("-o", outFile). |
| 172 | Input(lexFile) |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 173 | } |
| 174 | |
Inseob Kim | ed2641f | 2020-02-19 10:42:41 +0900 | [diff] [blame] | 175 | func genSysprop(ctx android.ModuleContext, syspropFile android.Path) (android.Path, android.Paths) { |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 176 | headerFile := android.PathForModuleGen(ctx, "sysprop", "include", syspropFile.Rel()+".h") |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 177 | publicHeaderFile := android.PathForModuleGen(ctx, "sysprop/public", "include", syspropFile.Rel()+".h") |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 178 | cppFile := android.PathForModuleGen(ctx, "sysprop", syspropFile.Rel()+".cpp") |
| 179 | |
Inseob Kim | ed2641f | 2020-02-19 10:42:41 +0900 | [diff] [blame] | 180 | headers := android.WritablePaths{headerFile, publicHeaderFile} |
| 181 | |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 182 | ctx.Build(pctx, android.BuildParams{ |
Inseob Kim | ed2641f | 2020-02-19 10:42:41 +0900 | [diff] [blame] | 183 | Rule: sysprop, |
| 184 | Description: "sysprop " + syspropFile.Rel(), |
| 185 | Output: cppFile, |
| 186 | ImplicitOutputs: headers, |
| 187 | Input: syspropFile, |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 188 | Args: map[string]string{ |
| 189 | "headerOutDir": filepath.Dir(headerFile.String()), |
Inseob Kim | 5cefbd2 | 2019-06-08 20:36:59 +0900 | [diff] [blame] | 190 | "publicOutDir": filepath.Dir(publicHeaderFile.String()), |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 191 | "srcOutDir": filepath.Dir(cppFile.String()), |
| 192 | "includeName": syspropFile.Rel() + ".h", |
| 193 | }, |
| 194 | }) |
| 195 | |
Inseob Kim | ed2641f | 2020-02-19 10:42:41 +0900 | [diff] [blame] | 196 | return cppFile, headers.Paths() |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 197 | } |
| 198 | |
Dan Willemsen | 4f1c3d4 | 2017-09-09 01:15:26 -0700 | [diff] [blame] | 199 | func genWinMsg(ctx android.ModuleContext, srcFile android.Path, flags builderFlags) (android.Path, android.Path) { |
| 200 | headerFile := android.GenPathWithExt(ctx, "windmc", srcFile, "h") |
| 201 | rcFile := android.GenPathWithExt(ctx, "windmc", srcFile, "rc") |
| 202 | |
| 203 | windmcCmd := gccCmd(flags.toolchain, "windmc") |
| 204 | |
Colin Cross | ae88703 | 2017-10-23 17:16:14 -0700 | [diff] [blame] | 205 | ctx.Build(pctx, android.BuildParams{ |
Dan Willemsen | 4f1c3d4 | 2017-09-09 01:15:26 -0700 | [diff] [blame] | 206 | Rule: windmc, |
| 207 | Description: "windmc " + srcFile.Rel(), |
| 208 | Output: rcFile, |
| 209 | ImplicitOutput: headerFile, |
| 210 | Input: srcFile, |
| 211 | Args: map[string]string{ |
| 212 | "windmcCmd": windmcCmd, |
| 213 | }, |
| 214 | }) |
| 215 | |
| 216 | return rcFile, headerFile |
| 217 | } |
| 218 | |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 219 | func genSources(ctx android.ModuleContext, srcFiles android.Paths, buildFlags builderFlags, |
| 220 | tools map[string]android.Path) (android.Paths, android.Paths) { |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 221 | |
Colin Cross | 635c3b0 | 2016-05-18 15:37:25 -0700 | [diff] [blame] | 222 | var deps android.Paths |
Colin Cross | 2a252be | 2017-05-01 17:37:24 -0700 | [diff] [blame] | 223 | var rsFiles android.Paths |
| 224 | |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 225 | var aidlRule *android.RuleBuilder |
| 226 | |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 227 | var lexRule_ *android.RuleBuilder |
| 228 | lexRule := func() *android.RuleBuilder { |
| 229 | if lexRule_ == nil { |
| 230 | lexRule_ = android.NewRuleBuilder().Sbox(android.PathForModuleGen(ctx, "lex")) |
| 231 | } |
| 232 | return lexRule_ |
| 233 | } |
| 234 | |
Dan Willemsen | 4e0aa23 | 2019-04-10 22:59:54 -0700 | [diff] [blame] | 235 | var yaccRule_ *android.RuleBuilder |
| 236 | yaccRule := func() *android.RuleBuilder { |
| 237 | if yaccRule_ == nil { |
| 238 | yaccRule_ = android.NewRuleBuilder().Sbox(android.PathForModuleGen(ctx, "yacc")) |
| 239 | } |
| 240 | return yaccRule_ |
| 241 | } |
| 242 | |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 243 | for i, srcFile := range srcFiles { |
Dan Willemsen | 34cc69e | 2015-09-23 15:26:20 -0700 | [diff] [blame] | 244 | switch srcFile.Ext() { |
Dan Willemsen | f0c73e0 | 2016-03-01 15:15:26 -0800 | [diff] [blame] | 245 | case ".y": |
Dan Willemsen | 21ec490 | 2016-11-02 20:43:13 -0700 | [diff] [blame] | 246 | cFile := android.GenPathWithExt(ctx, "yacc", srcFile, "c") |
Dan Willemsen | f0c73e0 | 2016-03-01 15:15:26 -0800 | [diff] [blame] | 247 | srcFiles[i] = cFile |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 248 | deps = append(deps, genYacc(ctx, yaccRule(), srcFile, cFile, buildFlags.yacc, tools)...) |
Dan Willemsen | f0c73e0 | 2016-03-01 15:15:26 -0800 | [diff] [blame] | 249 | case ".yy": |
Dan Willemsen | 21ec490 | 2016-11-02 20:43:13 -0700 | [diff] [blame] | 250 | cppFile := android.GenPathWithExt(ctx, "yacc", srcFile, "cpp") |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 251 | srcFiles[i] = cppFile |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 252 | deps = append(deps, genYacc(ctx, yaccRule(), srcFile, cppFile, buildFlags.yacc, tools)...) |
Dan Willemsen | f0c73e0 | 2016-03-01 15:15:26 -0800 | [diff] [blame] | 253 | case ".l": |
Dan Willemsen | 21ec490 | 2016-11-02 20:43:13 -0700 | [diff] [blame] | 254 | cFile := android.GenPathWithExt(ctx, "lex", srcFile, "c") |
Dan Willemsen | f0c73e0 | 2016-03-01 15:15:26 -0800 | [diff] [blame] | 255 | srcFiles[i] = cFile |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 256 | genLex(ctx, lexRule(), srcFile, cFile, tools) |
Dan Willemsen | f0c73e0 | 2016-03-01 15:15:26 -0800 | [diff] [blame] | 257 | case ".ll": |
Dan Willemsen | 21ec490 | 2016-11-02 20:43:13 -0700 | [diff] [blame] | 258 | cppFile := android.GenPathWithExt(ctx, "lex", srcFile, "cpp") |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 259 | srcFiles[i] = cppFile |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 260 | genLex(ctx, lexRule(), srcFile, cppFile, tools) |
Colin Cross | 0c461f1 | 2016-10-20 16:11:43 -0700 | [diff] [blame] | 261 | case ".proto": |
Dan Willemsen | 60e62f0 | 2018-11-16 21:05:32 -0800 | [diff] [blame] | 262 | ccFile, headerFile := genProto(ctx, srcFile, buildFlags) |
Colin Cross | 6af17aa | 2017-09-20 12:59:05 -0700 | [diff] [blame] | 263 | srcFiles[i] = ccFile |
| 264 | deps = append(deps, headerFile) |
Dan Willemsen | e1240db | 2016-11-03 14:28:51 -0700 | [diff] [blame] | 265 | case ".aidl": |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 266 | if aidlRule == nil { |
| 267 | aidlRule = android.NewRuleBuilder().Sbox(android.PathForModuleGen(ctx, "aidl")) |
| 268 | } |
Dan Willemsen | e1240db | 2016-11-03 14:28:51 -0700 | [diff] [blame] | 269 | cppFile := android.GenPathWithExt(ctx, "aidl", srcFile, "cpp") |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 270 | depFile := android.GenPathWithExt(ctx, "aidl", srcFile, "cpp.d") |
Dan Willemsen | e1240db | 2016-11-03 14:28:51 -0700 | [diff] [blame] | 271 | srcFiles[i] = cppFile |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 272 | deps = append(deps, genAidl(ctx, aidlRule, srcFile, cppFile, depFile, buildFlags.aidlFlags)...) |
Jeff Vander Stoep | d612627 | 2019-07-15 19:08:37 -0700 | [diff] [blame] | 273 | case ".rscript", ".fs": |
Colin Cross | 2a252be | 2017-05-01 17:37:24 -0700 | [diff] [blame] | 274 | cppFile := rsGeneratedCppFile(ctx, srcFile) |
| 275 | rsFiles = append(rsFiles, srcFiles[i]) |
| 276 | srcFiles[i] = cppFile |
Dan Willemsen | 4f1c3d4 | 2017-09-09 01:15:26 -0700 | [diff] [blame] | 277 | case ".mc": |
| 278 | rcFile, headerFile := genWinMsg(ctx, srcFile, buildFlags) |
| 279 | srcFiles[i] = rcFile |
| 280 | deps = append(deps, headerFile) |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 281 | case ".sysprop": |
Inseob Kim | ed2641f | 2020-02-19 10:42:41 +0900 | [diff] [blame] | 282 | cppFile, headerFiles := genSysprop(ctx, srcFile) |
Inseob Kim | 21f2690 | 2018-09-06 00:55:20 +0900 | [diff] [blame] | 283 | srcFiles[i] = cppFile |
Inseob Kim | ed2641f | 2020-02-19 10:42:41 +0900 | [diff] [blame] | 284 | deps = append(deps, headerFiles...) |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 285 | } |
| 286 | } |
| 287 | |
Dan Willemsen | 1945a4b | 2019-06-04 17:10:41 -0700 | [diff] [blame] | 288 | if aidlRule != nil { |
| 289 | aidlRule.Build(pctx, ctx, "aidl", "gen aidl") |
| 290 | } |
| 291 | |
Dan Willemsen | d2e291a | 2020-07-16 17:49:05 -0700 | [diff] [blame] | 292 | if lexRule_ != nil { |
| 293 | lexRule_.Build(pctx, ctx, "lex", "gen lex") |
| 294 | } |
| 295 | |
Dan Willemsen | 4e0aa23 | 2019-04-10 22:59:54 -0700 | [diff] [blame] | 296 | if yaccRule_ != nil { |
| 297 | yaccRule_.Build(pctx, ctx, "yacc", "gen yacc") |
| 298 | } |
| 299 | |
Colin Cross | 2a252be | 2017-05-01 17:37:24 -0700 | [diff] [blame] | 300 | if len(rsFiles) > 0 { |
| 301 | deps = append(deps, rsGenerateCpp(ctx, rsFiles, buildFlags.rsFlags)...) |
| 302 | } |
| 303 | |
Colin Cross | 581c189 | 2015-04-07 16:50:10 -0700 | [diff] [blame] | 304 | return srcFiles, deps |
| 305 | } |