SConstruct (11999:252c50d5b736) | SConstruct (12013:755a563d1883) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2013, 2015, 2016 ARM Limited 4# All rights reserved. 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 1316 unchanged lines hidden (view full) --- 1325################################################### 1326# 1327# This function is used to set up a directory with switching headers 1328# 1329################################################### 1330 1331main['ALL_ISA_LIST'] = all_isa_list 1332main['ALL_GPU_ISA_LIST'] = all_gpu_isa_list | 1# -*- mode:python -*- 2 3# Copyright (c) 2013, 2015, 2016 ARM Limited 4# All rights reserved. 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 1316 unchanged lines hidden (view full) --- 1325################################################### 1326# 1327# This function is used to set up a directory with switching headers 1328# 1329################################################### 1330 1331main['ALL_ISA_LIST'] = all_isa_list 1332main['ALL_GPU_ISA_LIST'] = all_gpu_isa_list |
1333all_isa_deps = {} | |
1334def make_switching_dir(dname, switch_headers, env): 1335 # Generate the header. target[0] is the full path of the output 1336 # header to generate. 'source' is a dummy variable, since we get the 1337 # list of ISAs from env['ALL_ISA_LIST']. 1338 def gen_switch_hdr(target, source, env): 1339 fname = str(target[0]) 1340 isa = env['TARGET_ISA'].lower() 1341 try: --- 9 unchanged lines hidden (view full) --- 1351 # should get re-executed. 1352 switch_hdr_action = MakeAction(gen_switch_hdr, 1353 Transform("GENERATE"), varlist=['ALL_ISA_LIST']) 1354 1355 # Instantiate actions for each header 1356 for hdr in switch_headers: 1357 env.Command(hdr, [], switch_hdr_action) 1358 | 1333def make_switching_dir(dname, switch_headers, env): 1334 # Generate the header. target[0] is the full path of the output 1335 # header to generate. 'source' is a dummy variable, since we get the 1336 # list of ISAs from env['ALL_ISA_LIST']. 1337 def gen_switch_hdr(target, source, env): 1338 fname = str(target[0]) 1339 isa = env['TARGET_ISA'].lower() 1340 try: --- 9 unchanged lines hidden (view full) --- 1350 # should get re-executed. 1351 switch_hdr_action = MakeAction(gen_switch_hdr, 1352 Transform("GENERATE"), varlist=['ALL_ISA_LIST']) 1353 1354 # Instantiate actions for each header 1355 for hdr in switch_headers: 1356 env.Command(hdr, [], switch_hdr_action) 1357 |
1359 isa_target = Dir('.').up().name.lower().replace('_', '-') 1360 all_isa_deps[isa_target] = None 1361 | |
1362Export('make_switching_dir') 1363 1364def make_gpu_switching_dir(dname, switch_headers, env): 1365 # Generate the header. target[0] is the full path of the output 1366 # header to generate. 'source' is a dummy variable, since we get the 1367 # list of ISAs from env['ALL_ISA_LIST']. 1368 def gen_switch_hdr(target, source, env): 1369 fname = str(target[0]) --- 159 unchanged lines hidden (view full) --- 1529 SConscript('src/SConscript', variant_dir = variant_path, exports = 'env') 1530 1531def pairwise(iterable): 1532 "s -> (s0,s1), (s1,s2), (s2, s3), ..." 1533 a, b = itertools.tee(iterable) 1534 b.next() 1535 return itertools.izip(a, b) 1536 | 1358Export('make_switching_dir') 1359 1360def make_gpu_switching_dir(dname, switch_headers, env): 1361 # Generate the header. target[0] is the full path of the output 1362 # header to generate. 'source' is a dummy variable, since we get the 1363 # list of ISAs from env['ALL_ISA_LIST']. 1364 def gen_switch_hdr(target, source, env): 1365 fname = str(target[0]) --- 159 unchanged lines hidden (view full) --- 1525 SConscript('src/SConscript', variant_dir = variant_path, exports = 'env') 1526 1527def pairwise(iterable): 1528 "s -> (s0,s1), (s1,s2), (s2, s3), ..." 1529 a, b = itertools.tee(iterable) 1530 b.next() 1531 return itertools.izip(a, b) 1532 |
1533variant_names = [variant_name(path) for path in variant_paths] 1534 |
|
1537# Create false dependencies so SCons will parse ISAs, establish 1538# dependencies, and setup the build Environments serially. Either 1539# SCons (likely) and/or our SConscripts (possibly) cannot cope with -j 1540# greater than 1. It appears to be standard race condition stuff; it 1541# doesn't always fail, but usually, and the behaviors are different. 1542# Every time I tried to remove this, builds would fail in some 1543# creative new way. So, don't do that. You'll want to, though, because 1544# tests/SConscript takes a long time to make its Environments. | 1535# Create false dependencies so SCons will parse ISAs, establish 1536# dependencies, and setup the build Environments serially. Either 1537# SCons (likely) and/or our SConscripts (possibly) cannot cope with -j 1538# greater than 1. It appears to be standard race condition stuff; it 1539# doesn't always fail, but usually, and the behaviors are different. 1540# Every time I tried to remove this, builds would fail in some 1541# creative new way. So, don't do that. You'll want to, though, because 1542# tests/SConscript takes a long time to make its Environments. |
1545for t1, t2 in pairwise(sorted(all_isa_deps.iterkeys())): | 1543for t1, t2 in pairwise(sorted(variant_names)): |
1546 main.Depends('#%s-deps' % t2, '#%s-deps' % t1) 1547 main.Depends('#%s-environs' % t2, '#%s-environs' % t1) 1548 1549# base help text 1550Help(''' 1551Usage: scons [scons options] [build variables] [target(s)] 1552 1553Extra scons options: 1554%(options)s 1555 1556Global build variables: 1557%(global_vars)s 1558 1559%(local_vars)s 1560''' % help_texts) | 1544 main.Depends('#%s-deps' % t2, '#%s-deps' % t1) 1545 main.Depends('#%s-environs' % t2, '#%s-environs' % t1) 1546 1547# base help text 1548Help(''' 1549Usage: scons [scons options] [build variables] [target(s)] 1550 1551Extra scons options: 1552%(options)s 1553 1554Global build variables: 1555%(global_vars)s 1556 1557%(local_vars)s 1558''' % help_texts) |