From 4bba67aed2eabd9d6e0b87f3094de79ac268cd7a Mon Sep 17 00:00:00 2001 From: Alex Bates Date: Thu, 14 Jan 2021 10:59:55 +0000 Subject: [PATCH] ninja img/*.png --- tools/build/build.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tools/build/build.py b/tools/build/build.py index e7d43723a4..88b620bb73 100644 --- a/tools/build/build.py +++ b/tools/build/build.py @@ -141,6 +141,11 @@ async def main(): description="assemble $in") n.newline() + n.rule("img", + command="$python tools/convert_image.py $img_type $in $out $img_flags", + description="image $in") + n.newline() + objects = list_objects("tools/splat.yaml") # no .o extension! c_files = (f for f in objects if f.endswith(".c")) # glob("src/**/*.c", recursive=True) @@ -159,6 +164,13 @@ async def main(): n.build(obj(f), "as", "asm/" + f[2:] + ".s") elif f.endswith(".s"): n.build(obj(f), "as", f) + elif f.endswith(".png"): + path, img_type, png = f.rsplit(".", 2) + + n.build(obj(f), "img", path + ".png", variables={ + "img_type": img_type, + "img_flags": "", # TODO ask splat? have some other config file for image flags? + }) else: print("warning: dont know what to do with object " + f) n.newline()