OLD | NEW |
---|---|
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | |
59 'conditions': [ | |
60 ['OS=="win"', { | |
61 'exe_ext': '.exe', | |
62 },{ | |
63 'exe_ext' : '', | |
64 }] | |
65 ], | |
66 }, | 58 }, |
67 'targets': [ | 59 'targets': [ |
68 { | 60 { |
69 'target_name': 'yasm', | 61 'target_name': 'yasm', |
70 'type': 'executable', | 62 'type': 'executable', |
71 'toolsets': ['host'], | 63 'toolsets': ['host'], |
72 'dependencies': [ | 64 'dependencies': [ |
73 'config_sources', | 65 'config_sources', |
74 'genmacro', | 66 'genmacro', |
75 'genmodule', | 67 'genmodule', |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
163 '<@(yasm_include_dirs)', | 155 '<@(yasm_include_dirs)', |
164 '<(shared_generated_dir)', | 156 '<(shared_generated_dir)', |
165 '<(generated_dir)', | 157 '<(generated_dir)', |
166 ], | 158 ], |
167 'defines': [ '<@(yasm_defines)' ], | 159 'defines': [ '<@(yasm_defines)' ], |
168 'cflags': [ '<@(yasm_cflags)', ], | 160 'cflags': [ '<@(yasm_cflags)', ], |
169 'rules': [ | 161 'rules': [ |
170 { | 162 { |
171 'rule_name': 'generate_gperf', | 163 'rule_name': 'generate_gperf', |
172 'extension': 'gperf', | 164 'extension': 'gperf', |
173 'inputs': [ '<(PRODUCT_DIR)/genperf<(exe_ext)' ], | 165 'inputs': [ '<(PRODUCT_DIR)/' + |
166 '<(EXECUTABLE_PREFIX)genperf<(EXECUTABLE_SUFFIX)' ], | |
Ryan Sleevi
2012/01/12 00:50:19
GYP doesn't support line continuations like this (
| |
174 'outputs': [ | 167 'outputs': [ |
175 '<(generated_dir)/<(RULE_INPUT_ROOT).c', | 168 '<(generated_dir)/<(RULE_INPUT_ROOT).c', |
176 ], | 169 ], |
177 'action': ['<(PRODUCT_DIR)/genperf', | 170 'action': ['<(PRODUCT_DIR)/genperf', |
178 '<(RULE_INPUT_PATH)', | 171 '<(RULE_INPUT_PATH)', |
179 '<(generated_dir)/<(RULE_INPUT_ROOT).c', | 172 '<(generated_dir)/<(RULE_INPUT_ROOT).c', |
180 ], | 173 ], |
181 # These files are #included, so do not treat them as sources. | 174 # These files are #included, so do not treat them as sources. |
182 'process_outputs_as_sources': 0, | 175 'process_outputs_as_sources': 0, |
183 'message': 'yasm gperf for <(RULE_INPUT_PATH).', | 176 'message': 'yasm gperf for <(RULE_INPUT_PATH).', |
184 }, | 177 }, |
185 { | 178 { |
186 'rule_name': 'generate_re2c', | 179 'rule_name': 'generate_re2c', |
187 'extension': 're', | 180 'extension': 're', |
188 'inputs': [ '<(PRODUCT_DIR)/re2c<(exe_ext)' ], | 181 'inputs': [ '<(PRODUCT_DIR)/' + |
182 '<(EXECUTABLE_PREFIX)re2c<(EXECUTABLE_SUFFIX)' ], | |
189 'outputs': [ '<(generated_dir)/<(RULE_INPUT_ROOT).c', ], | 183 'outputs': [ '<(generated_dir)/<(RULE_INPUT_ROOT).c', ], |
190 'action': [ | 184 'action': [ |
191 '<(PRODUCT_DIR)/re2c', | 185 '<(PRODUCT_DIR)/re2c', |
192 '-b', | 186 '-b', |
193 '-o', | 187 '-o', |
194 '<(generated_dir)/<(RULE_INPUT_ROOT).c', | 188 '<(generated_dir)/<(RULE_INPUT_ROOT).c', |
195 '<(RULE_INPUT_PATH)', | 189 '<(RULE_INPUT_PATH)', |
196 ], | 190 ], |
197 'process_outputs_as_sources': 1, | 191 'process_outputs_as_sources': 1, |
198 'message': 'yasm re2c for <(RULE_INPUT_PATH).', | 192 'message': 'yasm re2c for <(RULE_INPUT_PATH).', |
199 }, | 193 }, |
200 ], | 194 ], |
201 'actions': [ | 195 'actions': [ |
202 ### | 196 ### |
203 ### genmacro calls. | 197 ### genmacro calls. |
204 ### | 198 ### |
205 { | 199 { |
206 'action_name': 'generate_nasm_macros', | 200 'action_name': 'generate_nasm_macros', |
207 'variables': { | 201 'variables': { |
208 'infile': 'source/patched-yasm/modules/parsers/nasm/nasm-std.mac', | 202 'infile': 'source/patched-yasm/modules/parsers/nasm/nasm-std.mac', |
209 'varname': 'nasm_standard_mac', | 203 'varname': 'nasm_standard_mac', |
210 'outfile': '<(generated_dir)/nasm-macros.c', | 204 'outfile': '<(generated_dir)/nasm-macros.c', |
211 }, | 205 }, |
212 'inputs': [ '<(PRODUCT_DIR)/genmacro<(exe_ext)', '<(infile)', ], | 206 'inputs': [ '<(PRODUCT_DIR)/' + |
207 '<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)', | |
208 '<(infile)', ], | |
213 'outputs': [ '<(outfile)', ], | 209 'outputs': [ '<(outfile)', ], |
214 'action': ['<(PRODUCT_DIR)/genmacro', | 210 'action': ['<(PRODUCT_DIR)/genmacro', |
215 '<(outfile)', '<(varname)', '<(infile)', ], | 211 '<(outfile)', '<(varname)', '<(infile)', ], |
216 # Not a direct source because this is #included by | 212 # Not a direct source because this is #included by |
217 # source/patched-yasm/modules/parsers/nasm/nasm-parser.c | 213 # source/patched-yasm/modules/parsers/nasm/nasm-parser.c |
218 'process_outputs_as_sources': 1, | 214 'process_outputs_as_sources': 1, |
219 'message': 'yasm genmacro for <(infile).', | 215 'message': 'yasm genmacro for <(infile).', |
220 }, | 216 }, |
221 { | 217 { |
222 'action_name': 'generate_nasm_version', | 218 'action_name': 'generate_nasm_version', |
223 'variables': { | 219 'variables': { |
224 'infile': '<(shared_generated_dir)/<(version_file)', | 220 'infile': '<(shared_generated_dir)/<(version_file)', |
225 'varname': 'nasm_version_mac', | 221 'varname': 'nasm_version_mac', |
226 'outfile': '<(generated_dir)/nasm-version.c', | 222 'outfile': '<(generated_dir)/nasm-version.c', |
227 }, | 223 }, |
228 'inputs': [ '<(PRODUCT_DIR)/genmacro<(exe_ext)', '<(infile)', ], | 224 'inputs': [ '<(PRODUCT_DIR)/' + |
225 '<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)', | |
226 '<(infile)', ], | |
229 'outputs': [ '<(outfile)', ], | 227 'outputs': [ '<(outfile)', ], |
230 'action': ['<(PRODUCT_DIR)/genmacro', | 228 'action': ['<(PRODUCT_DIR)/genmacro', |
231 '<(outfile)', '<(varname)', '<(infile)', | 229 '<(outfile)', '<(varname)', '<(infile)', |
232 ], | 230 ], |
233 # Not a direct source because this is #included by | 231 # Not a direct source because this is #included by |
234 # source/patched-yasm/modules/preprocs/nasm/nasm-preproc.c | 232 # source/patched-yasm/modules/preprocs/nasm/nasm-preproc.c |
235 'process_outputs_as_sources': 0, | 233 'process_outputs_as_sources': 0, |
236 'message': 'yasm genmacro for <(infile).', | 234 'message': 'yasm genmacro for <(infile).', |
237 }, | 235 }, |
238 { | 236 { |
239 'action_name': 'generate_win64_gas', | 237 'action_name': 'generate_win64_gas', |
240 'variables': { | 238 'variables': { |
241 'infile': 'source/patched-yasm/modules/objfmts/coff/win64-gas.mac', | 239 'infile': 'source/patched-yasm/modules/objfmts/coff/win64-gas.mac', |
242 'varname': 'win64_gas_stdmac', | 240 'varname': 'win64_gas_stdmac', |
243 'outfile': '<(generated_dir)/win64-gas.c', | 241 'outfile': '<(generated_dir)/win64-gas.c', |
244 }, | 242 }, |
245 'inputs': [ '<(PRODUCT_DIR)/genmacro<(exe_ext)', '<(infile)', ], | 243 'inputs': [ '<(PRODUCT_DIR)/' + |
244 '<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)', | |
245 '<(infile)', ], | |
246 'outputs': [ '<(outfile)', ], | 246 'outputs': [ '<(outfile)', ], |
247 'action': ['<(PRODUCT_DIR)/genmacro', | 247 'action': ['<(PRODUCT_DIR)/genmacro', |
248 '<(outfile)', '<(varname)', '<(infile)', | 248 '<(outfile)', '<(varname)', '<(infile)', |
249 ], | 249 ], |
250 # Not a direct source because this is #included by | 250 # Not a direct source because this is #included by |
251 # source/patched-yasm/modules/objfmts/coff/coff-objfmt.c | 251 # source/patched-yasm/modules/objfmts/coff/coff-objfmt.c |
252 'process_outputs_as_sources': 0, | 252 'process_outputs_as_sources': 0, |
253 'message': 'yasm genmacro for <(infile).', | 253 'message': 'yasm genmacro for <(infile).', |
254 }, | 254 }, |
255 { | 255 { |
256 'action_name': 'generate_win64_nasm', | 256 'action_name': 'generate_win64_nasm', |
257 'variables': { | 257 'variables': { |
258 'infile': 'source/patched-yasm/modules/objfmts/coff/win64-nasm.mac', | 258 'infile': 'source/patched-yasm/modules/objfmts/coff/win64-nasm.mac', |
259 'varname': 'win64_nasm_stdmac', | 259 'varname': 'win64_nasm_stdmac', |
260 'outfile': '<(generated_dir)/win64-nasm.c', | 260 'outfile': '<(generated_dir)/win64-nasm.c', |
261 }, | 261 }, |
262 'inputs': [ '<(PRODUCT_DIR)/genmacro<(exe_ext)', '<(infile)', ], | 262 'inputs': [ '<(PRODUCT_DIR)/' + |
263 '<(EXECUTABLE_PREFIX)genmacro<(EXECUTABLE_SUFFIX)', | |
264 '<(infile)', ], | |
263 'outputs': [ '<(outfile)', ], | 265 'outputs': [ '<(outfile)', ], |
264 'action': ['<(PRODUCT_DIR)/genmacro', | 266 'action': ['<(PRODUCT_DIR)/genmacro', |
265 '<(outfile)', | 267 '<(outfile)', |
266 '<(varname)', | 268 '<(varname)', |
267 '<(infile)', | 269 '<(infile)', |
268 ], | 270 ], |
269 # Not a direct source because this is #included by | 271 # Not a direct source because this is #included by |
270 # source/patched-yasm/modules/objfmts/coff/coff-objfmt.c | 272 # source/patched-yasm/modules/objfmts/coff/coff-objfmt.c |
271 'process_outputs_as_sources': 0, | 273 'process_outputs_as_sources': 0, |
272 'message': 'yasm genmacro for <(infile).', | 274 'message': 'yasm genmacro for <(infile).', |
273 }, | 275 }, |
274 | 276 |
275 ### | 277 ### |
276 ### genstring call. | 278 ### genstring call. |
277 ### | 279 ### |
278 { | 280 { |
279 'action_name': 'generate_license', | 281 'action_name': 'generate_license', |
280 'variables': { | 282 'variables': { |
281 'infile': 'source/patched-yasm/COPYING', | 283 'infile': 'source/patched-yasm/COPYING', |
282 'varname': 'license_msg', | 284 'varname': 'license_msg', |
283 'outfile': '<(generated_dir)/license.c', | 285 'outfile': '<(generated_dir)/license.c', |
284 }, | 286 }, |
285 'inputs': [ '<(PRODUCT_DIR)/genstring<(exe_ext)', '<(infile)', ], | 287 'inputs': [ '<(PRODUCT_DIR)/' + |
288 '<(EXECUTABLE_PREFIX)genstring<(EXECUTABLE_SUFFIX)', | |
289 '<(infile)', ], | |
286 'outputs': [ '<(outfile)', ], | 290 'outputs': [ '<(outfile)', ], |
287 'action': ['<(PRODUCT_DIR)/genstring', | 291 'action': ['<(PRODUCT_DIR)/genstring', |
288 '<(varname)', | 292 '<(varname)', |
289 '<(outfile)', | 293 '<(outfile)', |
290 '<(infile)', | 294 '<(infile)', |
291 ], | 295 ], |
292 # Not a direct source because this is #included by | 296 # Not a direct source because this is #included by |
293 # source/patched-yasm/frontends/yasm/yasm.c | 297 # source/patched-yasm/frontends/yasm/yasm.c |
294 'process_outputs_as_sources': 0, | 298 'process_outputs_as_sources': 0, |
295 'message': 'Generating yasm embeddable license.', | 299 'message': 'Generating yasm embeddable license.', |
296 }, | 300 }, |
297 | 301 |
298 ### | 302 ### |
299 ### A re2c call that doesn't fit into the rule below. | 303 ### A re2c call that doesn't fit into the rule below. |
300 ### | 304 ### |
301 { | 305 { |
302 'action_name': 'generate_lc3b_token', | 306 'action_name': 'generate_lc3b_token', |
303 'variables': { | 307 'variables': { |
304 'infile': 'source/patched-yasm/modules/arch/lc3b/lc3bid.re', | 308 'infile': 'source/patched-yasm/modules/arch/lc3b/lc3bid.re', |
305 # The license file is #included by yasm.c. | 309 # The license file is #included by yasm.c. |
306 'outfile': '<(generated_dir)/lc3bid.c', | 310 'outfile': '<(generated_dir)/lc3bid.c', |
307 }, | 311 }, |
308 'inputs': [ '<(PRODUCT_DIR)/re2c<(exe_ext)', '<(infile)', ], | 312 'inputs': [ '<(PRODUCT_DIR)/' + |
313 '<(EXECUTABLE_PREFIX)re2c<(EXECUTABLE_SUFFIX)', | |
314 '<(infile)', ], | |
309 'outputs': [ '<(outfile)', ], | 315 'outputs': [ '<(outfile)', ], |
310 'action': [ | 316 'action': [ |
311 '<(PRODUCT_DIR)/re2c', | 317 '<(PRODUCT_DIR)/re2c', |
312 '-s', | 318 '-s', |
313 '-o', '<(outfile)', | 319 '-o', '<(outfile)', |
314 '<(infile)' | 320 '<(infile)' |
315 ], | 321 ], |
316 'process_outputs_as_sources': 1, | 322 'process_outputs_as_sources': 1, |
317 'message': 'Generating yasm tokens for lc3b.', | 323 'message': 'Generating yasm tokens for lc3b.', |
318 }, | 324 }, |
319 | 325 |
320 ### | 326 ### |
321 ### genmodule call. | 327 ### genmodule call. |
322 ### | 328 ### |
323 { | 329 { |
324 'action_name': 'generate_module', | 330 'action_name': 'generate_module', |
325 'variables': { | 331 'variables': { |
326 'makefile': 'source/config/<(OS)/Makefile', | 332 'makefile': 'source/config/<(OS)/Makefile', |
327 'module_in': 'source/patched-yasm/libyasm/module.in', | 333 'module_in': 'source/patched-yasm/libyasm/module.in', |
328 'outfile': '<(generated_dir)/module.c', | 334 'outfile': '<(generated_dir)/module.c', |
329 }, | 335 }, |
330 'inputs': [ | 336 'inputs': [ |
331 '<(PRODUCT_DIR)/genmodule<(exe_ext)', | 337 '<(PRODUCT_DIR)/<(EXECUTABLE_PREFIX)genmodule<(EXECUTABLE_SUFFIX)', |
332 '<(module_in)', | 338 '<(module_in)', |
333 '<(makefile)' | 339 '<(makefile)' |
334 ], | 340 ], |
335 'outputs': [ '<(generated_dir)/module.c' ], | 341 'outputs': [ '<(generated_dir)/module.c' ], |
336 'action': [ | 342 'action': [ |
337 '<(PRODUCT_DIR)/genmodule', | 343 '<(PRODUCT_DIR)/genmodule', |
338 '<(module_in)', | 344 '<(module_in)', |
339 '<(makefile)', | 345 '<(makefile)', |
340 '<(outfile)' | 346 '<(outfile)' |
341 ], | 347 ], |
(...skipping 21 matching lines...) Expand all Loading... | |
363 'genversion', | 369 'genversion', |
364 ], | 370 ], |
365 'sources': [ | 371 'sources': [ |
366 'source/patched-yasm/modules/arch/x86/x86cpu.gperf', | 372 'source/patched-yasm/modules/arch/x86/x86cpu.gperf', |
367 'source/patched-yasm/modules/arch/x86/x86regtmod.gperf', | 373 'source/patched-yasm/modules/arch/x86/x86regtmod.gperf', |
368 ], | 374 ], |
369 'rules': [ | 375 'rules': [ |
370 { | 376 { |
371 'rule_name': 'generate_gperf', | 377 'rule_name': 'generate_gperf', |
372 'extension': 'gperf', | 378 'extension': 'gperf', |
373 'inputs': [ '<(PRODUCT_DIR)/genperf<(exe_ext)' ], | 379 'inputs': [ '<(PRODUCT_DIR)/' + |
380 '<(EXECUTABLE_PREFIX)genperf<(EXECUTABLE_SUFFIX)' ], | |
374 'outputs': [ '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', ], | 381 'outputs': [ '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', ], |
375 'action': [ | 382 'action': [ |
376 '<(PRODUCT_DIR)/genperf', | 383 '<(PRODUCT_DIR)/genperf', |
377 '<(RULE_INPUT_PATH)', | 384 '<(RULE_INPUT_PATH)', |
378 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', | 385 '<(shared_generated_dir)/<(RULE_INPUT_ROOT).c', |
379 ], | 386 ], |
380 'process_outputs_as_sources': 0, | 387 'process_outputs_as_sources': 0, |
381 'message': 'yasm genperf for <(RULE_INPUT_PATH).', | 388 'message': 'yasm genperf for <(RULE_INPUT_PATH).', |
382 }, | 389 }, |
383 ], | 390 ], |
(...skipping 13 matching lines...) Expand all Loading... | |
397 'action': [ | 404 'action': [ |
398 'python', | 405 'python', |
399 '<(gen_insn_path)', | 406 '<(gen_insn_path)', |
400 '<(shared_generated_dir)', | 407 '<(shared_generated_dir)', |
401 ], | 408 ], |
402 'message': 'Running <(gen_insn_path).', | 409 'message': 'Running <(gen_insn_path).', |
403 'process_outputs_as_sources': 0, | 410 'process_outputs_as_sources': 0, |
404 }, | 411 }, |
405 { | 412 { |
406 'action_name': 'generate_version', | 413 'action_name': 'generate_version', |
407 'inputs': [ '<(PRODUCT_DIR)/genversion<(exe_ext)' ], | 414 'inputs': [ '<(PRODUCT_DIR)/' + |
415 '<(EXECUTABLE_PREFIX)genversion<(EXECUTABLE_SUFFIX)' ], | |
408 'outputs': [ '<(shared_generated_dir)/<(version_file)', ], | 416 'outputs': [ '<(shared_generated_dir)/<(version_file)', ], |
409 'action': [ | 417 'action': [ |
410 '<(PRODUCT_DIR)/genversion', | 418 '<(PRODUCT_DIR)/genversion', |
411 '<(shared_generated_dir)/<(version_file)' | 419 '<(shared_generated_dir)/<(version_file)' |
412 ], | 420 ], |
413 'message': 'Generating yasm version file: ' | 421 'message': 'Generating yasm version file: ' |
414 '<(shared_generated_dir)/<(version_file).', | 422 '<(shared_generated_dir)/<(version_file).', |
415 'process_outputs_as_sources': 0, | 423 'process_outputs_as_sources': 0, |
416 }, | 424 }, |
417 ], | 425 ], |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
533 'include_dirs': [ | 541 'include_dirs': [ |
534 '<@(yasm_include_dirs)', | 542 '<@(yasm_include_dirs)', |
535 | 543 |
536 ], | 544 ], |
537 'cflags': [ | 545 'cflags': [ |
538 '-std=gnu99', | 546 '-std=gnu99', |
539 ], | 547 ], |
540 }, | 548 }, |
541 ], | 549 ], |
542 } | 550 } |
OLD | NEW |