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