| OLD | NEW |
| 1 # Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2009 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 14 matching lines...) Expand all Loading... |
| 25 # You will notice that a lot of the action targets seem very similar -- | 25 # You will notice that a lot of the action targets seem very similar -- |
| 26 # especially for genmacro invocations. This makes it seem like they should | 26 # especially for genmacro invocations. This makes it seem like they should |
| 27 # be a rule. The problem is that the correct invocation cannot be inferred | 27 # be a rule. The problem is that the correct invocation cannot be inferred |
| 28 # purely from the file name, or extension. Nor is it obvious whether the | 28 # purely from the file name, or extension. Nor is it obvious whether the |
| 29 # output should be processed as a source or not. Thus, we are left with a | 29 # output should be processed as a source or not. Thus, we are left with a |
| 30 # large amount of repetative code. | 30 # large amount of repetative code. |
| 31 | 31 |
| 32 { | 32 { |
| 33 'variables': { | 33 'variables': { |
| 34 'yasm_include_dirs': [ | 34 'yasm_include_dirs': [ |
| 35 'source/config/linux', | 35 'source/config/<(OS)', |
| 36 'source/patched-yasm', | 36 'source/patched-yasm', |
| 37 ], | 37 ], |
| 38 | 38 |
| 39 # The cflags used by any target that will be directly linked into yasm. | 39 # The cflags used by any target that will be directly linked into yasm. |
| 40 # These are specifically not used when building the subprograms. While | 40 # These are specifically not used when building the subprograms. While |
| 41 # it would probably be safe to use these flags there as well, the | 41 # it would probably be safe to use these flags there as well, the |
| 42 # ./configure based build does not use the same flags between the main | 42 # ./configure based build does not use the same flags between the main |
| 43 # yasm executable, and its subprograms. | 43 # yasm executable, and its subprograms. |
| 44 'yasm_c_flags': [ | 44 'yasm_defines': ['HAVE_CONFIG_H'], |
| 45 '-DHAVE_CONFIG_H', | 45 'yasm_cflags': [ |
| 46 '-std=gnu99', | 46 '-std=gnu99', |
| 47 '-ansi', | 47 '-ansi', |
| 48 '-pedantic', | 48 '-pedantic', |
| 49 ], | 49 ], |
| 50 | 50 |
| 51 # Locations for various generated artifacts. | 51 # Locations for various generated artifacts. |
| 52 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/yasm', | 52 'shared_generated_dir': '<(SHARED_INTERMEDIATE_DIR)/third_party/yasm', |
| 53 'generated_dir': '<(INTERMEDIATE_DIR)/third_party/yasm', | 53 'generated_dir': '<(INTERMEDIATE_DIR)/third_party/yasm', |
| 54 | 54 |
| 55 # Various files referenced by multiple targets. | 55 # Various files referenced by multiple targets. |
| 56 'version_file': 'version.mac', # Generated by genversion. | 56 'version_file': 'version.mac', # Generated by genversion. |
| 57 'genmodule_source': 'genmodule_outfile.c', | 57 'genmodule_source': 'genmodule_outfile.c', |
| 58 }, | 58 }, |
| 59 'targets': [ | 59 'targets': [ |
| 60 { | 60 { |
| 61 'target_name': 'yasm', | 61 'target_name': 'yasm', |
| 62 'type': 'executable', | 62 'type': 'executable', |
| 63 'dependencies': [ | 63 'dependencies': [ |
| 64 'config_sources', |
| 64 'genmacro', | 65 'genmacro', |
| 65 'genmodule', | 66 'genmodule', |
| 66 'genperf', | 67 'genperf', |
| 67 'genperf_libs', | 68 'genperf_libs', |
| 68 'generate_files', # Needed to generate gperf and instruction files. | 69 'generate_files', # Needed to generate gperf and instruction files. |
| 69 'genstring', | 70 'genstring', |
| 70 're2c', | 71 're2c', |
| 71 ], | 72 ], |
| 72 'sources': [ | 73 'sources': [ |
| 73 'source/patched-yasm/frontends/yasm/yasm-options.c', | 74 'source/patched-yasm/frontends/yasm/yasm-options.c', |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 '<(shared_generated_dir)/x86insn_nasm.gperf', | 147 '<(shared_generated_dir)/x86insn_nasm.gperf', |
| 147 '<(shared_generated_dir)/x86insn_gas.gperf', | 148 '<(shared_generated_dir)/x86insn_gas.gperf', |
| 148 '<(shared_generated_dir)/x86cpu.c', | 149 '<(shared_generated_dir)/x86cpu.c', |
| 149 '<(shared_generated_dir)/x86regtmod.c', | 150 '<(shared_generated_dir)/x86regtmod.c', |
| 150 ], | 151 ], |
| 151 'include_dirs': [ | 152 'include_dirs': [ |
| 152 '<@(yasm_include_dirs)', | 153 '<@(yasm_include_dirs)', |
| 153 '<(shared_generated_dir)', | 154 '<(shared_generated_dir)', |
| 154 '<(generated_dir)', | 155 '<(generated_dir)', |
| 155 ], | 156 ], |
| 156 'cflags': [ | 157 'defines': [ '<@(yasm_defines)' ], |
| 157 '<@(yasm_c_flags)', | 158 'cflags': [ '<@(yasm_cflags)', ], |
| 158 ], | |
| 159 'rules': [ | 159 'rules': [ |
| 160 { | 160 { |
| 161 'rule_name': 'generate_gperf', | 161 'rule_name': 'generate_gperf', |
| 162 'extension': 'gperf', | 162 'extension': 'gperf', |
| 163 'inputs': [ '<(PRODUCT_DIR)/genperf' ], | 163 'inputs': [ '<(PRODUCT_DIR)/genperf' ], |
| 164 'outputs': [ | 164 'outputs': [ |
| 165 '<(generated_dir)/<(RULE_INPUT_ROOT).c', | 165 '<(generated_dir)/<(RULE_INPUT_ROOT).c', |
| 166 ], | 166 ], |
| 167 'action': ['<(PRODUCT_DIR)/genperf', | 167 'action': ['<(PRODUCT_DIR)/genperf', |
| 168 '<(RULE_INPUT_PATH)', | 168 '<(RULE_INPUT_PATH)', |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 306 'process_outputs_as_sources': 1, | 306 'process_outputs_as_sources': 1, |
| 307 'message': 'Generating yasm tokens for lc3b.', | 307 'message': 'Generating yasm tokens for lc3b.', |
| 308 }, | 308 }, |
| 309 | 309 |
| 310 ### | 310 ### |
| 311 ### genmodule call. | 311 ### genmodule call. |
| 312 ### | 312 ### |
| 313 { | 313 { |
| 314 'action_name': 'generate_module', | 314 'action_name': 'generate_module', |
| 315 'variables': { | 315 'variables': { |
| 316 'makefile': 'source/config/linux/Makefile', | 316 'makefile': 'source/config/<(OS)/Makefile', |
| 317 'module_in': 'source/patched-yasm/libyasm/module.in', | 317 'module_in': 'source/patched-yasm/libyasm/module.in', |
| 318 'outfile': '<(generated_dir)/module.c', | 318 'outfile': '<(generated_dir)/module.c', |
| 319 }, | 319 }, |
| 320 'inputs': [ | 320 'inputs': [ |
| 321 '<(PRODUCT_DIR)/genmodule', | 321 '<(PRODUCT_DIR)/genmodule', |
| 322 '<(module_in)', | 322 '<(module_in)', |
| 323 '<(makefile)' | 323 '<(makefile)' |
| 324 ], | 324 ], |
| 325 'outputs': [ '<(generated_dir)/module.c' ], | 325 'outputs': [ '<(generated_dir)/module.c' ], |
| 326 'action': [ | 326 'action': [ |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 409 'type': 'static_library', | 409 'type': 'static_library', |
| 410 'dependencies': [ 'config_sources', ], | 410 'dependencies': [ 'config_sources', ], |
| 411 'sources': [ | 411 'sources': [ |
| 412 'source/patched-yasm/libyasm/phash.c', | 412 'source/patched-yasm/libyasm/phash.c', |
| 413 'source/patched-yasm/libyasm/xmalloc.c', | 413 'source/patched-yasm/libyasm/xmalloc.c', |
| 414 'source/patched-yasm/libyasm/xstrdup.c', | 414 'source/patched-yasm/libyasm/xstrdup.c', |
| 415 ], | 415 ], |
| 416 'include_dirs': [ | 416 'include_dirs': [ |
| 417 '<@(yasm_include_dirs)', | 417 '<@(yasm_include_dirs)', |
| 418 ], | 418 ], |
| 419 'defines': [ '<@(yasm_defines)' ], |
| 419 'cflags': [ | 420 'cflags': [ |
| 420 '<(yasm_c_flags)', | 421 '<@(yasm_cflags)', |
| 421 ], | 422 ], |
| 422 }, | 423 }, |
| 423 { | 424 { |
| 424 'target_name': 'genstring', | 425 'target_name': 'genstring', |
| 425 'type': 'executable', | 426 'type': 'executable', |
| 426 'dependencies': [ 'config_sources', ], | 427 'dependencies': [ 'config_sources', ], |
| 427 'sources': [ | 428 'sources': [ |
| 428 'source/patched-yasm/genstring.c', | 429 'source/patched-yasm/genstring.c', |
| 429 ], | 430 ], |
| 430 'include_dirs': [ | 431 'include_dirs': [ |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 ], | 520 ], |
| 520 }, | 521 }, |
| 521 ], | 522 ], |
| 522 } | 523 } |
| 523 | 524 |
| 524 # Local Variables: | 525 # Local Variables: |
| 525 # tab-width:2 | 526 # tab-width:2 |
| 526 # indent-tabs-mode:nil | 527 # indent-tabs-mode:nil |
| 527 # End: | 528 # End: |
| 528 # vim: set expandtab tabstop=2 shiftwidth=2: | 529 # vim: set expandtab tabstop=2 shiftwidth=2: |
| OLD | NEW |