| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 "source/patched-yasm/tools/re2c/translate.c", | 114 "source/patched-yasm/tools/re2c/translate.c", |
| 115 ] | 115 ] |
| 116 | 116 |
| 117 configs -= [ "//build/config/compiler:chromium_code" ] | 117 configs -= [ "//build/config/compiler:chromium_code" ] |
| 118 configs += [ ":yasm_config", | 118 configs += [ ":yasm_config", |
| 119 "//build/config/compiler:no_chromium_code" ] | 119 "//build/config/compiler:no_chromium_code" ] |
| 120 | 120 |
| 121 # re2c is missing CLOSEVOP from one switch. | 121 # re2c is missing CLOSEVOP from one switch. |
| 122 if (is_posix) { | 122 if (is_posix) { |
| 123 cflags = [ "-Wno-switch" ] | 123 cflags = [ "-Wno-switch" ] |
| 124 } else if (is_win) { |
| 125 cflags = [ "/wd4267" ] # size_t to int conversion. |
| 124 } | 126 } |
| 125 } | 127 } |
| 126 | 128 |
| 127 executable("yasm") { | 129 executable("yasm") { |
| 128 sources = [ | 130 sources = [ |
| 129 "source/patched-yasm/frontends/yasm/yasm-options.c", | 131 "source/patched-yasm/frontends/yasm/yasm-options.c", |
| 130 "source/patched-yasm/frontends/yasm/yasm.c", | 132 "source/patched-yasm/frontends/yasm/yasm.c", |
| 131 "source/patched-yasm/libyasm/assocdat.c", | 133 "source/patched-yasm/libyasm/assocdat.c", |
| 132 "source/patched-yasm/libyasm/bc-align.c", | 134 "source/patched-yasm/libyasm/bc-align.c", |
| 133 "source/patched-yasm/libyasm/bc-data.c", | 135 "source/patched-yasm/libyasm/bc-data.c", |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 compiled_action_foreach("compile_gperf") { | 249 compiled_action_foreach("compile_gperf") { |
| 248 tool = ":genperf" | 250 tool = ":genperf" |
| 249 sources = [ | 251 sources = [ |
| 250 "source/patched-yasm/modules/arch/x86/x86cpu.gperf", | 252 "source/patched-yasm/modules/arch/x86/x86cpu.gperf", |
| 251 "source/patched-yasm/modules/arch/x86/x86regtmod.gperf", | 253 "source/patched-yasm/modules/arch/x86/x86regtmod.gperf", |
| 252 ] | 254 ] |
| 253 | 255 |
| 254 outputs = [ "$target_gen_dir/{{source_name_part}}.c" ] | 256 outputs = [ "$target_gen_dir/{{source_name_part}}.c" ] |
| 255 args = [ | 257 args = [ |
| 256 "{{source}}", | 258 "{{source}}", |
| 257 rebase_path(target_gen_dir, ".") + "/{{source_name_part}}.c", | 259 rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.c", |
| 258 ] | 260 ] |
| 259 deps = [ | 261 deps = [ |
| 260 ":generate_x86_insn" | 262 ":generate_x86_insn" |
| 261 ] | 263 ] |
| 262 } | 264 } |
| 263 | 265 |
| 264 # This differs from |compile_gperf| in where it places it output files. | 266 # This differs from |compile_gperf| in where it places it output files. |
| 265 compiled_action_foreach("compile_gperf_for_include") { | 267 compiled_action_foreach("compile_gperf_for_include") { |
| 266 tool = ":genperf" | 268 tool = ":genperf" |
| 267 sources = [ | 269 sources = [ |
| 268 # Make sure the generated gperf files in $target_gen_dir are synced with | 270 # Make sure the generated gperf files in $target_gen_dir are synced with |
| 269 # the outputs for the related generate_*_insn actions in the | 271 # the outputs for the related generate_*_insn actions in the |
| 270 # generate_files target below. | 272 # generate_files target below. |
| 271 # | 273 # |
| 272 # The output for these two are #included by | 274 # The output for these two are #included by |
| 273 # source/patched-yasm/modules/arch/x86/x86id.c | 275 # source/patched-yasm/modules/arch/x86/x86id.c |
| 274 "$yasm_gen_include_dir/x86insn_gas.gperf", | 276 "$yasm_gen_include_dir/x86insn_gas.gperf", |
| 275 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 277 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
| 276 ] | 278 ] |
| 277 | 279 |
| 278 outputs = [ "$yasm_gen_include_dir/{{source_name_part}}.c" ] | 280 outputs = [ "$yasm_gen_include_dir/{{source_name_part}}.c" ] |
| 279 args = [ | 281 args = [ |
| 280 "{{source}}", | 282 "{{source}}", |
| 281 rebase_path(yasm_gen_include_dir, ".") + "/{{source_name_part}}.c", | 283 rebase_path(yasm_gen_include_dir, root_build_dir) + |
| 284 "/{{source_name_part}}.c", |
| 282 ] | 285 ] |
| 283 deps = [ | 286 deps = [ |
| 284 ":generate_x86_insn" | 287 ":generate_x86_insn" |
| 285 ] | 288 ] |
| 286 } | 289 } |
| 287 | 290 |
| 288 template("compile_macro") { | 291 template("compile_macro") { |
| 289 compiled_action(target_name) { | 292 compiled_action(target_name) { |
| 290 tool = ":genmacro" | 293 tool = ":genmacro" |
| 291 # Output #included by source/patched-yasm/frontends/yasm/yasm.c. | 294 # Output #included by source/patched-yasm/frontends/yasm/yasm.c. |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 compiled_action_foreach("compile_re2c") { | 339 compiled_action_foreach("compile_re2c") { |
| 337 tool = ":re2c" | 340 tool = ":re2c" |
| 338 sources = [ | 341 sources = [ |
| 339 "source/patched-yasm/modules/parsers/gas/gas-token.re", | 342 "source/patched-yasm/modules/parsers/gas/gas-token.re", |
| 340 "source/patched-yasm/modules/parsers/nasm/nasm-token.re", | 343 "source/patched-yasm/modules/parsers/nasm/nasm-token.re", |
| 341 ] | 344 ] |
| 342 outputs = [ "$target_gen_dir/{{source_name_part}}.c" ] | 345 outputs = [ "$target_gen_dir/{{source_name_part}}.c" ] |
| 343 args = [ | 346 args = [ |
| 344 "-b", | 347 "-b", |
| 345 "-o", | 348 "-o", |
| 346 rebase_path(target_gen_dir, ".") + "/{{source_name_part}}.c", | 349 rebase_path(target_gen_dir, root_build_dir) + "/{{source_name_part}}.c", |
| 347 "{{source}}", | 350 "{{source}}", |
| 348 ] | 351 ] |
| 349 } | 352 } |
| 350 | 353 |
| 351 # This call doesn't fit into the re2c template above. | 354 # This call doesn't fit into the re2c template above. |
| 352 compiled_action("compile_re2c_lc3b") { | 355 compiled_action("compile_re2c_lc3b") { |
| 353 tool = ":re2c" | 356 tool = ":re2c" |
| 354 sources = [ "source/patched-yasm/modules/arch/lc3b/lc3bid.re" ] | 357 sources = [ "source/patched-yasm/modules/arch/lc3b/lc3bid.re" ] |
| 355 outputs = [ "$target_gen_dir/lc3bid.c" ] | 358 outputs = [ "$target_gen_dir/lc3bid.c" ] |
| 356 args = [ | 359 args = [ |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py" | 401 script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py" |
| 399 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 402 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
| 400 outputs = [ | 403 outputs = [ |
| 401 "$yasm_gen_include_dir/x86insns.c", | 404 "$yasm_gen_include_dir/x86insns.c", |
| 402 "$yasm_gen_include_dir/x86insn_gas.gperf", | 405 "$yasm_gen_include_dir/x86insn_gas.gperf", |
| 403 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 406 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
| 404 ] | 407 ] |
| 405 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 408 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
| 406 } | 409 } |
| 407 } | 410 } |
| OLD | NEW |