Deleted Added
sdiff udiff text old ( 8233:15b5ea80fd95 ) new ( 8235:6381dc8bcfcc )
full compact
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

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

228
229 self.module = modname
230 cc_file = joinpath(self.dirname, modname + '_wrap.cc')
231 py_file = joinpath(self.dirname, modname + '.py')
232
233 self.cc_source = Source(cc_file, swig=True, parent=self)
234 self.py_source = PySource(package, py_file, parent=self)
235
236unit_tests = []
237def UnitTest(target, sources):
238 '''Create a unit test, specify the target name and a source or
239 list of sources'''
240 if not isinstance(sources, (list, tuple)):
241 sources = [ sources ]
242
243 sources = [ Source(src, skip_lib=True) for src in sources ]
244 unit_tests.append((target, sources))
245
246# Children should have access
247Export('Source')
248Export('PySource')
249Export('SimObject')
250Export('SwigSource')
251Export('UnitTest')
252
253########################################################################

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

668''')
669 code.write(str(target[0]))
670
671# Build all swig modules
672for swig in SwigSource.all:
673 env.Command([swig.cc_source.tnode, swig.py_source.tnode], swig.tnode,
674 MakeAction('$SWIG $SWIGFLAGS -outdir ${TARGETS[1].dir} '
675 '-o ${TARGETS[0]} $SOURCES', Transform("SWIG")))
676 init_file = 'python/swig/init_%s.cc' % swig.module
677 env.Command(init_file, Value(swig.module),
678 MakeAction(makeEmbeddedSwigInit, Transform("EMBED SW")))
679 Source(init_file)
680
681#
682# Handle debug flags
683#
684def makeDebugFlagCC(target, source, env):
685 assert(len(target) == 1 and len(source) == 1)
686
687 val = eval(source[0].get_contents())

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

899 shared_date = make_obj(date_source, static=False, extra_deps=shared_objs)
900 shared_objs.append(shared_date)
901
902 # First make a library of everything but main() so other programs can
903 # link against m5.
904 static_lib = new_env.StaticLibrary(libname, static_objs)
905 shared_lib = new_env.SharedLibrary(libname, shared_objs)
906
907 for target, sources in unit_tests:
908 objs = [ make_obj(s, static=True) for s in sources ]
909 new_env.Program("unittest/%s.%s" % (target, label), objs + static_objs)
910
911 # Now link a stub with main() and the static library.
912 main_objs = [ make_obj(s, True) for s in Source.get(main=True) ]
913
914 progname = exename
915 if strip:
916 progname += '.unstripped'
917
918 targets = new_env.Program(progname, main_objs + static_objs)
919
920 if strip:
921 if sys.platform == 'sunos5':

--- 54 unchanged lines hidden ---