papermario/tools/build/bin_inc_c.py
Marijn van der Werf 5511e18133
Clean executable files (#1047)
* Mark headers as non-executable

* Update shebangs
2023-05-04 18:03:02 +09:00

18 lines
374 B
Python
Executable File

#!/usr/bin/env python3
from pathlib import Path
from sys import argv
import re
if __name__ == "__main__":
infile, outfile, cname = argv[1:]
with open(outfile, "w") as f:
f.write(f"unsigned char {cname}[] = {{ ")
with open(infile, "rb") as i:
for char in i.read():
f.write(f'0x{char:02X}, ')
f.write(f"}};\n")