pokemon/tools/generate/__main__.py
Zack Buhman da49dbeb2b Makefile: improve build rules slightly
I'm still not satisfied with the Makefile, but this at least makes it
converge in a single make invocation again.

This also removes the enum value arrays.
2023-07-26 18:17:45 +00:00

19 lines
467 B
Python

from pathlib import Path
from pprint import pprint
import sys
from generate.files import files
def generate(base_path, target_path):
for func, filename in files:
path = base_path / filename
if path != target_path:
continue
with open(path, 'w') as f:
f.write(func().getvalue())
# sys.argv[1] is secretly used in parse
base_path = Path(sys.argv[2])
target_path = Path(sys.argv[4])
generate(base_path, target_path)