SConstruct (3494:5ee078c93ec8) SConstruct (3546:c4074658f1e1)
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 447 unchanged lines hidden (view full) ---

456
457# libelf build is shared across all configs in the build root.
458env.SConscript('ext/libelf/SConscript',
459 build_dir = os.path.join(build_root, 'libelf'),
460 exports = 'env')
461
462###################################################
463#
1# -*- mode:python -*-
2
3# Copyright (c) 2004-2005 The Regents of The University of Michigan
4# All rights reserved.
5#
6# Redistribution and use in source and binary forms, with or without
7# modification, are permitted provided that the following conditions are
8# met: redistributions of source code must retain the above copyright

--- 447 unchanged lines hidden (view full) ---

456
457# libelf build is shared across all configs in the build root.
458env.SConscript('ext/libelf/SConscript',
459 build_dir = os.path.join(build_root, 'libelf'),
460 exports = 'env')
461
462###################################################
463#
464# This function is used to set up a directory with switching headers
465#
466###################################################
467
468def make_switching_dir(dirname, switch_headers, env):
469 # Generate the header. target[0] is the full path of the output
470 # header to generate. 'source' is a dummy variable, since we get the
471 # list of ISAs from env['ALL_ISA_LIST'].
472 def gen_switch_hdr(target, source, env):
473 fname = str(target[0])
474 basename = os.path.basename(fname)
475 f = open(fname, 'w')
476 f.write('#include "arch/isa_specific.hh"\n')
477 cond = '#if'
478 for isa in env['ALL_ISA_LIST']:
479 f.write('%s THE_ISA == %s_ISA\n#include "%s/%s/%s"\n'
480 % (cond, isa.upper(), dirname, isa, basename))
481 cond = '#elif'
482 f.write('#else\n#error "THE_ISA not set"\n#endif\n')
483 f.close()
484 return 0
485
486 # String to print when generating header
487 def gen_switch_hdr_string(target, source, env):
488 return "Generating switch header " + str(target[0])
489
490 # Build SCons Action object. 'varlist' specifies env vars that this
491 # action depends on; when env['ALL_ISA_LIST'] changes these actions
492 # should get re-executed.
493 switch_hdr_action = Action(gen_switch_hdr, gen_switch_hdr_string,
494 varlist=['ALL_ISA_LIST'])
495
496 # Instantiate actions for each header
497 for hdr in switch_headers:
498 env.Command(hdr, [], switch_hdr_action)
499
500env.make_switching_dir = make_switching_dir
501
502###################################################
503#
464# Define build environments for selected configurations.
465#
466###################################################
467
468# rename base env
469base_env = env
470
471for build_path in build_paths:

--- 89 unchanged lines hidden (view full) ---

561 # Set up the regression tests for each build.
562 for e in envList:
563 SConscript('tests/SConscript',
564 build_dir = os.path.join(build_path, 'tests', e.Label),
565 exports = { 'env' : e }, duplicate = False)
566
567Help(help_text)
568
504# Define build environments for selected configurations.
505#
506###################################################
507
508# rename base env
509base_env = env
510
511for build_path in build_paths:

--- 89 unchanged lines hidden (view full) ---

601 # Set up the regression tests for each build.
602 for e in envList:
603 SConscript('tests/SConscript',
604 build_dir = os.path.join(build_path, 'tests', e.Label),
605 exports = { 'env' : e }, duplicate = False)
606
607Help(help_text)
608
609
569###################################################
570#
571# Let SCons do its thing. At this point SCons will use the defined
572# build environments to build the requested targets.
573#
574###################################################
575
610###################################################
611#
612# Let SCons do its thing. At this point SCons will use the defined
613# build environments to build the requested targets.
614#
615###################################################
616