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 = source[0].get_contents() |
414 415 code = code_formatter() 416 code(""" 417import m5.internal 418import m5.util 419 420buildEnv = m5.util.SmartDict($build_env) |
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 |
432defines_info = Value(build_env) |
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 --- |