SConstruct (6655:380a32b43336) SConstruct (6658:f4de76601762)
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# Copyright (c) 2004-2005 The Regents of The University of Michigan
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are

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

737
738main['ALL_ISA_LIST'] = all_isa_list
739def make_switching_dir(dname, switch_headers, env):
740 # Generate the header. target[0] is the full path of the output
741 # header to generate. 'source' is a dummy variable, since we get the
742 # list of ISAs from env['ALL_ISA_LIST'].
743 def gen_switch_hdr(target, source, env):
744 fname = str(target[0])
1# -*- mode:python -*-
2
3# Copyright (c) 2009 The Hewlett-Packard Development Company
4# Copyright (c) 2004-2005 The Regents of The University of Michigan
5# All rights reserved.
6#
7# Redistribution and use in source and binary forms, with or without
8# modification, are permitted provided that the following conditions are

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

737
738main['ALL_ISA_LIST'] = all_isa_list
739def make_switching_dir(dname, switch_headers, env):
740 # Generate the header. target[0] is the full path of the output
741 # header to generate. 'source' is a dummy variable, since we get the
742 # list of ISAs from env['ALL_ISA_LIST'].
743 def gen_switch_hdr(target, source, env):
744 fname = str(target[0])
745 bname = basename(fname)
746 f = open(fname, 'w')
745 f = open(fname, 'w')
747 f.write('#include "arch/isa_specific.hh"\n')
748 cond = '#if'
749 for isa in all_isa_list:
750 f.write('%s THE_ISA == %s_ISA\n#include "%s/%s/%s"\n'
751 % (cond, isa.upper(), dname, isa, bname))
752 cond = '#elif'
753 f.write('#else\n#error "THE_ISA not set"\n#endif\n')
746 isa = env['TARGET_ISA'].lower()
747 print >>f, '#include "%s/%s/%s"' % (dname, isa, basename(fname))
754 f.close()
748 f.close()
755 return 0
756
757 # String to print when generating header
758 def gen_switch_hdr_string(target, source, env):
759 return "Generating switch header " + str(target[0])
760
761 # Build SCons Action object. 'varlist' specifies env vars that this
762 # action depends on; when env['ALL_ISA_LIST'] changes these actions
763 # should get re-executed.

--- 108 unchanged lines hidden ---
749
750 # String to print when generating header
751 def gen_switch_hdr_string(target, source, env):
752 return "Generating switch header " + str(target[0])
753
754 # Build SCons Action object. 'varlist' specifies env vars that this
755 # action depends on; when env['ALL_ISA_LIST'] changes these actions
756 # should get re-executed.

--- 108 unchanged lines hidden ---