SConstruct (8482:353abb676fa2) | SConstruct (8483:b5052cad1fd3) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2011 Advanced Micro Devices, Inc. 4# Copyright (c) 2009 The Hewlett-Packard Development Company 5# Copyright (c) 2004-2005 The Regents of The University of Michigan 6# All rights reserved. 7# 8# Redistribution and use in source and binary forms, with or without --- 821 unchanged lines hidden (view full) --- 830# value of the variable. 831def build_config_file(target, source, env): 832 (variable, value) = [s.get_contents() for s in source] 833 f = file(str(target[0]), 'w') 834 print >> f, '#define', variable, value 835 f.close() 836 return None 837 | 1# -*- mode:python -*- 2 3# Copyright (c) 2011 Advanced Micro Devices, Inc. 4# Copyright (c) 2009 The Hewlett-Packard Development Company 5# Copyright (c) 2004-2005 The Regents of The University of Michigan 6# All rights reserved. 7# 8# Redistribution and use in source and binary forms, with or without --- 821 unchanged lines hidden (view full) --- 830# value of the variable. 831def build_config_file(target, source, env): 832 (variable, value) = [s.get_contents() for s in source] 833 f = file(str(target[0]), 'w') 834 print >> f, '#define', variable, value 835 f.close() 836 return None 837 |
838# Generate the message to be printed when building the config file. 839def build_config_file_string(target, source, env): 840 (variable, value) = [s.get_contents() for s in source] 841 return "Defining %s as %s in %s." % (variable, value, target[0]) 842 | |
843# Combine the two functions into a scons Action object. | 838# Combine the two functions into a scons Action object. |
844config_action = Action(build_config_file, build_config_file_string) | 839config_action = MakeAction(build_config_file, Transform("CONFIG H", 2)) |
845 846# The emitter munges the source & target node lists to reflect what 847# we're really doing. 848def config_emitter(target, source, env): 849 # extract variable name from Builder arg 850 variable = str(target[0]) 851 # True target is config header file 852 target = joinpath('config', variable.lower() + '.hh') --- 163 unchanged lines hidden --- | 840 841# The emitter munges the source & target node lists to reflect what 842# we're really doing. 843def config_emitter(target, source, env): 844 # extract variable name from Builder arg 845 variable = str(target[0]) 846 # True target is config header file 847 target = joinpath('config', variable.lower() + '.hh') --- 163 unchanged lines hidden --- |