SConscript (7974:13692327bb0b) SConscript (8126:5138d1e453f1)
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

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

405########################################################################
406#
407# Commands for the basic automatically generated python files
408#
409
410# Generate Python file containing a dict specifying the current
411# buildEnv flags.
412def makeDefinesPyFile(target, source, env):
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

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

405########################################################################
406#
407# Commands for the basic automatically generated python files
408#
409
410# Generate Python file containing a dict specifying the current
411# buildEnv flags.
412def makeDefinesPyFile(target, source, env):
413 build_env, hg_info = [ x.get_contents() for x in source ]
413 build_env = source[0].get_contents()
414
415 code = code_formatter()
416 code("""
417import m5.internal
418import m5.util
419
420buildEnv = m5.util.SmartDict($build_env)
414
415 code = code_formatter()
416 code("""
417import m5.internal
418import m5.util
419
420buildEnv = m5.util.SmartDict($build_env)
421hgRev = '$hg_info'
422
423compileDate = m5.internal.core.compileDate
424_globals = globals()
425for key,val in m5.internal.core.__dict__.iteritems():
426 if key.startswith('flag_'):
427 flag = key[5:]
428 _globals[flag] = val
429del _globals
430""")
431 code.write(target[0].abspath)
432
421
422compileDate = m5.internal.core.compileDate
423_globals = globals()
424for key,val in m5.internal.core.__dict__.iteritems():
425 if key.startswith('flag_'):
426 flag = key[5:]
427 _globals[flag] = val
428del _globals
429""")
430 code.write(target[0].abspath)
431
433defines_info = [ Value(build_env), Value(env['HG_INFO']) ]
432defines_info = Value(build_env)
434# Generate a file with all of the compile options in it
435env.Command('python/m5/defines.py', defines_info,
436 MakeAction(makeDefinesPyFile, Transform("DEFINES", 0)))
437PySource('m5', 'python/m5/defines.py')
438
439# Generate python file containing info about the M5 source code
440def makeInfoPyFile(target, source, env):
441 code = code_formatter()

--- 611 unchanged lines hidden ---
433# Generate a file with all of the compile options in it
434env.Command('python/m5/defines.py', defines_info,
435 MakeAction(makeDefinesPyFile, Transform("DEFINES", 0)))
436PySource('m5', 'python/m5/defines.py')
437
438# Generate python file containing info about the M5 source code
439def makeInfoPyFile(target, source, env):
440 code = code_formatter()

--- 611 unchanged lines hidden ---