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 --- 130 unchanged lines hidden (view full) --- 139swig_sources = [] 140def SwigSource(package, source): 141 '''Add a swig file to build''' 142 if not isinstance(source, SCons.Node.FS.File): 143 source = File(source) 144 val = source,package 145 swig_sources.append(val) 146 |
147unit_tests = [] 148def UnitTest(target, sources): 149 if not isinstance(sources, (list, tuple)): 150 sources = [ sources ] 151 152 srcs = [] 153 for source in sources: 154 if not isinstance(source, SCons.Node.FS.File): 155 source = File(source) 156 srcs.append(source) 157 158 unit_tests.append((target, srcs)) 159 |
160# Children should have access 161Export('Source') 162Export('BinSource') 163Export('PySource') 164Export('SimObject') 165Export('SwigSource') |
166Export('UnitTest') |
167 168######################################################################## 169# 170# Trace Flags 171# 172all_flags = {} 173trace_flags = [] 174def TraceFlag(name, desc=''): --- 796 unchanged lines hidden (view full) --- 971 # link against m5. 972 # 973 # SCons doesn't know to append a library suffix when there is a '.' in the 974 # name. Use '_' instead. 975 976 m5lib = newEnv.Library('m5_' + label, 977 make_objs(cc_lib_sources, newEnv) + swig_objs) 978 |
979 for target, sources in unit_tests: 980 objs = [ newEnv.StaticObject(s) for s in sources ] 981 newEnv.Program("unittest/%s.%s" % (target, label), objs + m5lib) 982 |
983 # Now link a stub with main() and the library. 984 exe = 'm5.' + label # final executable 985 objects = [newEnv.Object(s) for s in cc_bin_sources] + m5lib 986 if strip: 987 unstripped_exe = exe + '.unstripped' 988 newEnv.Program(unstripped_exe, objects) 989 if sys.platform == 'sunos5': 990 cmd = 'cp $SOURCE $TARGET; strip $TARGET' --- 54 unchanged lines hidden --- |