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) |
11 # 2) C source files that are #included by static C sources (eg., license.c) | 11 # 2) C source files that are #included by static C sources (eg., license.c) |
12 # 3) Intermediate files that are used as input by other subprograms to | 12 # 3) Intermediate files that are used as input by other subprograms to |
13 # further generate files in category #1 or #2. (eg., version.mac) | 13 # further generate files in category #1 or #2. (eg., version.mac) |
14 # | 14 # |
15 # This structure is represented with the following targets: | 15 # This structure is represented with the following targets: |
16 # 1) yasm -- Sources, flags for the main yasm executable. Also has most of | 16 # 1) yasm -- Sources, flags for the main yasm executable. Also has most of |
17 # of the actions and rules that invoke the subprograms. | 17 # of the actions and rules that invoke the subprograms. |
18 # 2) yasm_config -- General build configuration including setting a | 18 # 2) yasm_config -- General build configuration including setting a |
19 # source_prereqs listing the checked in version of files | 19 # inputs listing the checked in version of files |
20 # generated by manually running configure. These manually | 20 # generated by manually running configure. These manually |
21 # generated files are used by all binaries. | 21 # generated files are used by all binaries. |
22 # 3) yasm_utils -- Object files with memory management and hashing utilities | 22 # 3) yasm_utils -- Object files with memory management and hashing utilities |
23 # shared between yasm and the genperf subprogram. | 23 # shared between yasm and the genperf subprogram. |
24 # 4) genmacro, genmodule, etc. -- One executable target for each subprogram. | 24 # 4) genmacro, genmodule, etc. -- One executable target for each subprogram. |
25 # 5) generate_license, generate_module, etc. -- Actions that invoke programs | 25 # 5) generate_license, generate_module, etc. -- Actions that invoke programs |
26 # built in #4 to generate .c files. | 26 # built in #4 to generate .c files. |
27 # 6) compile_gperf, compile_re2c, etc. -- Actions that invoke programs that | 27 # 6) compile_gperf, compile_re2c, etc. -- Actions that invoke programs that |
28 # turn intermediate files into .c files. | 28 # turn intermediate files into .c files. |
29 | 29 |
30 if (current_toolchain == host_toolchain) { | 30 if (current_toolchain == host_toolchain) { |
31 | 31 |
32 # Various files referenced by multiple targets. | 32 # Various files referenced by multiple targets. |
33 yasm_gen_include_dir = "$target_gen_dir/include" | 33 yasm_gen_include_dir = "$target_gen_dir/include" |
34 config_makefile = "source/config/$os/Makefile" | 34 config_makefile = "source/config/$os/Makefile" |
35 version_file = "version.mac" | 35 version_file = "version.mac" |
36 | 36 |
37 import("//build/compiled_action.gni") | 37 import("//build/compiled_action.gni") |
38 | 38 |
39 config("yasm_config") { | 39 config("yasm_config") { |
40 include_dirs = [ | 40 include_dirs = [ |
41 "source/config/$os", | 41 "source/config/$os", |
42 "source/patched-yasm", | 42 "source/patched-yasm", |
43 ] | 43 ] |
44 source_prereqs = [ | 44 inputs = [ |
45 config_makefile, | 45 config_makefile, |
46 "source/config/$os/config.h", | 46 "source/config/$os/config.h", |
47 "source/config/$os/libyasm-stdint.h", | 47 "source/config/$os/libyasm-stdint.h", |
48 ] | 48 ] |
49 defines = [ "HAVE_CONFIG_H" ] | 49 defines = [ "HAVE_CONFIG_H" ] |
50 if (is_posix) { | 50 if (is_posix) { |
51 cflags = [ "-std=gnu99" ] | 51 cflags = [ "-std=gnu99" ] |
52 } | 52 } |
53 } | 53 } |
54 | 54 |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 if (is_win) { | 225 if (is_win) { |
226 cflags = [ "/wd4267" ] # size_t to int conversion. | 226 cflags = [ "/wd4267" ] # size_t to int conversion. |
227 } else { | 227 } else { |
228 cflags = [ "-ansi", "-pedantic" ] | 228 cflags = [ "-ansi", "-pedantic" ] |
229 if (is_clang) { | 229 if (is_clang) { |
230 cflags += [ "-Wno-incompatible-pointer-types" ] | 230 cflags += [ "-Wno-incompatible-pointer-types" ] |
231 } | 231 } |
232 } | 232 } |
233 | 233 |
234 # TODO(ajwong): This should take most of the generated output as | 234 # TODO(ajwong): This should take most of the generated output as |
235 # source_prereqs. | 235 # inputs. |
236 deps = [ | 236 deps = [ |
237 ":compile_gperf", | 237 ":compile_gperf", |
238 ":compile_gperf_for_include", | 238 ":compile_gperf_for_include", |
239 ":compile_nasm_macros", | 239 ":compile_nasm_macros", |
240 ":compile_nasm_version", | 240 ":compile_nasm_version", |
241 ":compile_re2c_lc3b", | 241 ":compile_re2c_lc3b", |
242 ":compile_win64_gas", | 242 ":compile_win64_gas", |
243 ":compile_win64_nasm", | 243 ":compile_win64_nasm", |
244 ":compile_re2c", | 244 ":compile_re2c", |
245 ":generate_license", | 245 ":generate_license", |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
402 script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py" | 402 script = "source/patched-yasm/modules/arch/x86/gen_x86_insn.py" |
403 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c | 403 # Output eventually #included by source/patched-yasm/frontends/yasm/x86id.c |
404 outputs = [ | 404 outputs = [ |
405 "$yasm_gen_include_dir/x86insns.c", | 405 "$yasm_gen_include_dir/x86insns.c", |
406 "$yasm_gen_include_dir/x86insn_gas.gperf", | 406 "$yasm_gen_include_dir/x86insn_gas.gperf", |
407 "$yasm_gen_include_dir/x86insn_nasm.gperf", | 407 "$yasm_gen_include_dir/x86insn_nasm.gperf", |
408 ] | 408 ] |
409 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] | 409 args = [ rebase_path(yasm_gen_include_dir, root_build_dir) ] |
410 } | 410 } |
411 } | 411 } |
OLD | NEW |