SConscript (3536:89aa06409e4d) | SConscript (3546:c4074658f1e1) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2006 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 --- 49 unchanged lines hidden (view full) --- 58 stacktrace.hh 59 syscallreturn.hh 60 tlb.hh 61 types.hh 62 utility.hh 63 vtophys.hh 64 ''') 65 | 1# -*- mode:python -*- 2 3# Copyright (c) 2006 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 --- 49 unchanged lines hidden (view full) --- 58 stacktrace.hh 59 syscallreturn.hh 60 tlb.hh 61 types.hh 62 utility.hh 63 vtophys.hh 64 ''') 65 |
66# Generate the header. target[0] is the full path of the output 67# header to generate. 'source' is a dummy variable, since we get the 68# list of ISAs from env['ALL_ISA_LIST']. 69def gen_switch_hdr(target, source, env): 70 fname = str(target[0]) 71 basename = os.path.basename(fname) 72 f = open(fname, 'w') 73 f.write('#include "arch/isa_specific.hh"\n') 74 cond = '#if' 75 for isa in env['ALL_ISA_LIST']: 76 f.write('%s THE_ISA == %s_ISA\n#include "arch/%s/%s"\n' 77 % (cond, isa.upper(), isa, basename)) 78 cond = '#elif' 79 f.write('#else\n#error "THE_ISA not set"\n#endif\n') 80 f.close() 81 return 0 | 66# Set up this directory to support switching headers 67env.make_switching_dir('arch', isa_switch_hdrs, env) |
82 | 68 |
83# String to print when generating header 84def gen_switch_hdr_string(target, source, env): 85 return "Generating ISA switch header " + str(target[0]) 86 87# Build SCons Action object. 'varlist' specifies env vars that this 88# action depends on; when env['ALL_ISA_LIST'] changes these actions 89# should get re-executed. 90switch_hdr_action = Action(gen_switch_hdr, gen_switch_hdr_string, 91 varlist=['ALL_ISA_LIST']) 92 93# Instantiate actions for each header 94for hdr in isa_switch_hdrs: 95 env.Command(hdr, [], switch_hdr_action) 96 | |
97################################################################# 98# 99# Include architecture-specific files. 100# 101################################################################# 102 103# 104# Build a SCons scanner for ISA files --- 63 unchanged lines hidden --- | 69################################################################# 70# 71# Include architecture-specific files. 72# 73################################################################# 74 75# 76# Build a SCons scanner for ISA files --- 63 unchanged lines hidden --- |