SConscript (5559:660fa7b652f5) SConscript (5584:e08e65fd0f76)
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
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
147# Children should have access
148Export('Source')
149Export('BinSource')
150Export('PySource')
151Export('SimObject')
152Export('SwigSource')
160# Children should have access
161Export('Source')
162Export('BinSource')
163Export('PySource')
164Export('SimObject')
165Export('SwigSource')
166Export('UnitTest')
153
154########################################################################
155#
156# Trace Flags
157#
158all_flags = {}
159trace_flags = []
160def TraceFlag(name, desc=''):

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

957 # link against m5.
958 #
959 # SCons doesn't know to append a library suffix when there is a '.' in the
960 # name. Use '_' instead.
961
962 m5lib = newEnv.Library('m5_' + label,
963 make_objs(cc_lib_sources, newEnv) + swig_objs)
964
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
965 # Now link a stub with main() and the library.
966 exe = 'm5.' + label # final executable
967 objects = [newEnv.Object(s) for s in cc_bin_sources] + m5lib
968 if strip:
969 unstripped_exe = exe + '.unstripped'
970 newEnv.Program(unstripped_exe, objects)
971 if sys.platform == 'sunos5':
972 cmd = 'cp $SOURCE $TARGET; strip $TARGET'

--- 54 unchanged lines hidden ---
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 ---