jack2 codebase
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

81 lines
2.6KB

  1. #!/usr/bin/python
  2. #
  3. # Copyright (C) 2007 Arnold Krille
  4. #
  5. # This file originates from FFADO (www.ffado.org)
  6. #
  7. # This program is free software: you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation, either version 3 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. #
  20. #
  21. # Taken from http://www.scons.org/wiki/ReplacementBuilder
  22. #
  23. from string import Template
  24. def replace_action(target, source, env):
  25. open( str(target[0]), 'w' ).write( Template( open( str(source[0]), 'r' ).read() ).safe_substitute( env ) )
  26. return 0
  27. def replace_string(target, source, env):
  28. return "building '%s' from '%s'" % ( str(target[0]), str(source[0]) )
  29. def generate(env, **kw):
  30. action = env.Action( replace_action, replace_string )
  31. env['BUILDERS']['ScanReplace'] = env.Builder( action=action, src_suffix='.in', single_source=True )
  32. def exists(env):
  33. return 1
  34. #!/usr/bin/python
  35. #
  36. # Copyright (C) 2007 Arnold Krille
  37. #
  38. # This file originates from FFADO (www.ffado.org)
  39. #
  40. # This program is free software: you can redistribute it and/or modify
  41. # it under the terms of the GNU General Public License as published by
  42. # the Free Software Foundation, either version 3 of the License, or
  43. # (at your option) any later version.
  44. #
  45. # This program is distributed in the hope that it will be useful,
  46. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  47. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  48. # GNU General Public License for more details.
  49. #
  50. # You should have received a copy of the GNU General Public License
  51. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  52. #
  53. #
  54. # Taken from http://www.scons.org/wiki/ReplacementBuilder
  55. #
  56. from string import Template
  57. def replace_action(target, source, env):
  58. open( str(target[0]), 'w' ).write( Template( open( str(source[0]), 'r' ).read() ).safe_substitute( env ) )
  59. return 0
  60. def replace_string(target, source, env):
  61. return "building '%s' from '%s'" % ( str(target[0]), str(source[0]) )
  62. def generate(env, **kw):
  63. action = env.Action( replace_action, replace_string )
  64. env['BUILDERS']['ScanReplace'] = env.Builder( action=action, src_suffix='.in', single_source=True )
  65. def exists(env):
  66. return 1