+objects = {}
+for fn in sys.argv[1:-1]:
+ in_base = os.path.split(fn)[1]
+ name = makename(in_base)+"_data"
+ objects[in_base] = name
+ out.write("const char {}[] =\n".format(name))
+ data = open(fn).read()
+ line = ""
+ for c in data:
+ line += escape_char(c)
+ if len(line)>=68:
+ out.write("\t\"{}\"\n".format(line))
+ line = ""
+ out.write("\t\"{}\";\n\n".format(line))
+
+out_base = os.path.splitext(os.path.split(sys.argv[-1])[1])[0]
+out.write("void init_{}(DataFile::BuiltinSource &source)\n{{\n".format(makename(out_base)))
+for n, d in objects.items():
+ out.write("\tsource.add_object(\"{}\", {});\n".format(n, d))
+out.write("}\n")
+
+out.write("""