1 #!/usr/bin/env python 2 # Copyright (c) 2011 Google Inc. All rights reserved. 3 # Use of this source code is governed by a BSD-style license that can be 4 # found in the LICENSE file. 5 6 import sys 7 8 assert len(sys.argv) == 4, sys.argv 9 10 (in_file, c_file, h_file) = sys.argv[1:] 11 12 def write_file(filename, contents): 13 open(filename, 'wb').write(contents) 14 15 write_file(c_file, open(in_file, 'rb').read()) 16 17 write_file(h_file, '#define NAME "%s"\n' % in_file) 18 19 sys.exit(0) 20