OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright (c) 2009 Google Inc. All rights reserved. | 3 # Copyright (c) 2009 Google Inc. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 # Notes: | 7 # Notes: |
8 # | 8 # |
9 # This is all roughly based on the Makefile system used by the Linux | 9 # This is all roughly based on the Makefile system used by the Linux |
10 # kernel, but is a non-recursive make -- we put the entire dependency | 10 # kernel, but is a non-recursive make -- we put the entire dependency |
(...skipping 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1252 | 1252 |
1253 # TODO(evan): cache this output. (But then we'll need to add extra | 1253 # TODO(evan): cache this output. (But then we'll need to add extra |
1254 # flags to gyp to flush the cache, yuk! It's fast enough for now to | 1254 # flags to gyp to flush the cache, yuk! It's fast enough for now to |
1255 # just run it every time.) | 1255 # just run it every time.) |
1256 | 1256 |
1257 return { 'ARFLAGS.target': arflags_target, | 1257 return { 'ARFLAGS.target': arflags_target, |
1258 'ARFLAGS.host': arflags_host, | 1258 'ARFLAGS.host': arflags_host, |
1259 'LINK_flags': link_flags } | 1259 'LINK_flags': link_flags } |
1260 | 1260 |
1261 | 1261 |
| 1262 def CalculateVariables(default_variables, params): |
| 1263 """Calculate additional variables for use in the build (called by gyp).""" |
| 1264 cc_target = os.environ.get('CC.target', os.environ.get('CC', 'cc')) |
| 1265 default_variables['LINKER_SUPPORTS_ICF'] = \ |
| 1266 gyp.system_test.TestLinkerSupportsICF(cc_command=cc_target) |
| 1267 |
| 1268 |
1262 def GenerateOutput(target_list, target_dicts, data, params): | 1269 def GenerateOutput(target_list, target_dicts, data, params): |
1263 options = params['options'] | 1270 options = params['options'] |
1264 generator_flags = params.get('generator_flags', {}) | 1271 generator_flags = params.get('generator_flags', {}) |
1265 builddir_name = generator_flags.get('output_dir', 'out') | 1272 builddir_name = generator_flags.get('output_dir', 'out') |
1266 | 1273 |
1267 def CalculateMakefilePath(build_file, base_name): | 1274 def CalculateMakefilePath(build_file, base_name): |
1268 """Determine where to write a Makefile for a given gyp file.""" | 1275 """Determine where to write a Makefile for a given gyp file.""" |
1269 # Paths in gyp files are relative to the .gyp file, but we want | 1276 # Paths in gyp files are relative to the .gyp file, but we want |
1270 # paths relative to the source root for the master makefile. Grab | 1277 # paths relative to the source root for the master makefile. Grab |
1271 # the path of the .gyp file as the base to relativize against. | 1278 # the path of the .gyp file as the base to relativize against. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1414 # Add a check to make sure we tried to process all the .d files. | 1421 # Add a check to make sure we tried to process all the .d files. |
1415 all_deps += """ | 1422 all_deps += """ |
1416 ifneq ($(word %(last)d,$(d_files)),) | 1423 ifneq ($(word %(last)d,$(d_files)),) |
1417 $(error Found unprocessed dependency files (gyp didn't generate enough rules
!)) | 1424 $(error Found unprocessed dependency files (gyp didn't generate enough rules
!)) |
1418 endif | 1425 endif |
1419 """ % { 'last': ((num_outputs / 1000) + 1) * 1000 + 1 } | 1426 """ % { 'last': ((num_outputs / 1000) + 1) * 1000 + 1 } |
1420 | 1427 |
1421 root_makefile.write(SHARED_FOOTER % { 'generate_all_deps': all_deps }) | 1428 root_makefile.write(SHARED_FOOTER % { 'generate_all_deps': all_deps }) |
1422 | 1429 |
1423 root_makefile.close() | 1430 root_makefile.close() |
OLD | NEW |