OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 # The yasm build process creates a slew of small C subprograms that | 5 # The yasm build process creates a slew of small C subprograms that |
6 # dynamically generate files at various point in the build process. This makes | 6 # dynamically generate files at various point in the build process. This makes |
7 # the build integration moderately complex. | 7 # the build integration moderately complex. |
8 # | 8 # |
9 # There are three classes of dynamically generated files: | 9 # There are three classes of dynamically generated files: |
10 # 1) C source files that should be included in the build (eg., lc3bid.c) | 10 # 1) C source files that should be included in the build (eg., lc3bid.c) |
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 ] | 285 ] |
286 deps = [ | 286 deps = [ |
287 ":generate_x86_insn" | 287 ":generate_x86_insn" |
288 ] | 288 ] |
289 } | 289 } |
290 | 290 |
291 template("compile_macro") { | 291 template("compile_macro") { |
292 compiled_action(target_name) { | 292 compiled_action(target_name) { |
293 tool = ":genmacro" | 293 tool = ":genmacro" |
294 # Output #included by source/patched-yasm/frontends/yasm/yasm.c. | 294 # Output #included by source/patched-yasm/frontends/yasm/yasm.c. |
295 sources = invoker.sources | 295 inputs = invoker.sources |
296 outputs = invoker.outputs | 296 outputs = invoker.outputs |
297 args = [ | 297 args = [ |
298 rebase_path(outputs[0], root_build_dir), | 298 rebase_path(outputs[0], root_build_dir), |
299 invoker.macro_varname, | 299 invoker.macro_varname, |
300 rebase_path(sources[0], root_build_dir), | 300 rebase_path(inputs[0], root_build_dir), |
301 ] | 301 ] |
302 if (defined(invoker.deps)) { | 302 if (defined(invoker.deps)) { |
303 deps = invoker.deps | 303 deps = invoker.deps |
304 } | 304 } |
305 } | 305 } |
306 } | 306 } |
307 | 307 |
308 compile_macro("compile_nasm_macros") { | 308 compile_macro("compile_nasm_macros") { |
309 # Output #included by | 309 # Output #included by |
310 # source/patched-yasm/modules/preprocs/nasm/nasm-parser.c | 310 # source/patched-yasm/modules/preprocs/nasm/nasm-parser.c |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
347 "-b", | 347 "-b", |
348 "-o", | 348 "-o", |
349 rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.c", | 349 rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.c", |
350 "{{source}}", | 350 "{{source}}", |
351 ] | 351 ] |
352 } | 352 } |
353 | 353 |
354 # This call doesn't fit into the re2c template above. | 354 # This call doesn't fit into the re2c template above. |
355 compiled_action("compile_re2c_lc3b") { | 355 compiled_action("compile_re2c_lc3b") { |
356 tool = ":re2c" | 356 tool = ":re2c" |
357 sources = [ "source/patched-yasm/modules/arch/lc3b/lc3bid.re" ] | 357 inputs = [ "source/patched-yasm/modules/arch/lc3b/lc3bid.re" ] |
358 outputs = [ "$target_gen_dir/lc3bid.c" ] | 358 outputs = [ "$target_gen_dir/lc3bid.c" ] |
359 args = [ | 359 args = [ |
360 "-s", | 360 "-s", |
361 "-o", | 361 "-o", |
362 rebase_path(outputs[0], root_build_dir), | 362 rebase_path(outputs[0], root_build_dir), |
363 rebase_path(sources[0], root_build_dir), | 363 rebase_path(inputs[0], root_build_dir), |
364 ] | 364 ] |
365 } | 365 } |
366 | 366 |
367 compiled_action("generate_license") { | 367 compiled_action("generate_license") { |
368 tool = ":genstring" | 368 tool = ":genstring" |
369 # Output #included by source/patched-yasm/frontends/yasm/yasm.c. | 369 # Output #included by source/patched-yasm/frontends/yasm/yasm.c. |
370 sources = [ "source/patched-yasm/COPYING" ] | 370 inputs = [ "source/patched-yasm/COPYING" ] |
371 outputs = [ "$yasm_gen_include_dir/license.c" ] | 371 outputs = [ "$yasm_gen_include_dir/license.c" ] |
372 args = [ | 372 args = [ |
373 "license_msg", | 373 "license_msg", |
374 rebase_path(outputs[0], root_build_dir), | 374 rebase_path(outputs[0], root_build_dir), |
375 rebase_path(sources[0], root_build_dir), | 375 rebase_path(inputs[0], root_build_dir), |
376 ] | 376 ] |
377 } | 377 } |
378 | 378 |
379 compiled_action("generate_module") { | 379 compiled_action("generate_module") { |
380 tool = ":genmodule" | 380 tool = ":genmodule" |
381 inputs = [ config_makefile ] | 381 inputs = [ |
382 sources = [ "source/patched-yasm/libyasm/module.in" ] | 382 "source/patched-yasm/libyasm/module.in", |
| 383 config_makefile, |
| 384 ] |
383 outputs = [ "$target_gen_dir/module.c" ] | 385 outputs = [ "$target_gen_dir/module.c" ] |
384 args = [ | 386 args = [ |
385 rebase_path(sources[0], root_build_dir), | 387 rebase_path(inputs[0], root_build_dir), |
386 rebase_path(config_makefile, root_build_dir), | 388 rebase_path(config_makefile, root_build_dir), |
387 rebase_path(outputs[0], root_build_dir), | 389 rebase_path(outputs[0], root_build_dir), |
388 ] | 390 ] |
389 } | 391 } |
390 | 392 |
391 compiled_action("generate_version") { | 393 compiled_action("generate_version") { |
392 tool = ":genversion" | 394 tool = ":genversion" |
393 outputs = [ "$target_gen_dir/$version_file" ] | 395 outputs = [ "$target_gen_dir/$version_file" ] |
394 args = [ | 396 args = [ |
395 rebase_path(outputs[0], | 397 rebase_path(outputs[0], |
396 root_build_dir) | 398 root_build_dir) |
397 ] | 399 ] |
398 } | 400 } |
399 | 401 |
400 action("generate_x86_insn") { | 402 action("generate_x86_insn") { |
401 script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py" | 403 script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py" |
402 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 404 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
403 outputs = [ | 405 outputs = [ |
404 "$yasm_gen_include_dir/x86insns.c", | 406 "$yasm_gen_include_dir/x86insns.c", |
405 "$yasm_gen_include_dir/x86insn_gas.gperf", | 407 "$yasm_gen_include_dir/x86insn_gas.gperf", |
406 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 408 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
407 ] | 409 ] |
408 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 410 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
409 } | 411 } |
410 } | 412 } |
OLD | NEW |