25 out = open(sys.argv[-1], "w")
27 out.write("""#include <msp/datafile/builtinsource.h>
35 for fn in sys.argv[1:-1]:
36 in_base = os.path.split(fn)[1]
37 name = makename(in_base)+"_data"
38 objects[in_base] = name
39 out.write("const char {}[] =\n".format(name))
40 data = open(fn).read()
43 line += escape_char(c)
45 out.write("\t\"{}\"\n".format(line))
47 out.write("\t\"{}\";\n\n".format(line))
49 out_base = os.path.splitext(os.path.split(sys.argv[-1])[1])[0]
50 out.write("void init_{}(DataFile::BuiltinSource &source)\n{{\n".format(makename(out_base)))
51 for n, d in objects.items():
52 out.write("\tsource.add_object(\"{}\", {});\n".format(n, d))