From f4cdf0a34b111ee59f6a8fee6ad8e2ac8aa14b5b Mon Sep 17 00:00:00 2001 From: Dragorn421 Date: Mon, 10 Feb 2025 18:28:07 +0100 Subject: [PATCH] Makefile: Add rules to build .png, .bin and .jpg in assets/ too --- Makefile | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index b82e139a82..2aae6fee27 100644 --- a/Makefile +++ b/Makefile @@ -984,8 +984,28 @@ $(BUILD_DIR)/src/overlays/%_reloc.o: $(BUILD_DIR)/spec $(POSTPROCESS_OBJ) $(@:.o=.s) $(AS) $(ASFLAGS) $(@:.o=.s) -o $@ -$(BUILD_DIR)/assets/%.inc.c: assets/%.png - false # TODO duplicate extracted/ build rules for git-tracked assets/ too +# Assets from assets/ + +$(BUILD_DIR)/assets/%.u64.inc.c: assets/%.u64.png + $(PYTHON) tools/assets/build_from_png.py $< $(@:.inc.c=.bin) + @echo // From file://`realpath $<` >$@ + tools/assets/bin2c/bin2c u64 <$(@:.inc.c=.bin) >>$@ + +# same as above rule but u32 +$(BUILD_DIR)/assets/%.u32.inc.c: assets/%.u32.png + $(PYTHON) tools/assets/build_from_png.py $< $(@:.inc.c=.bin) + @echo // From file://`realpath $<` >$@ + tools/assets/bin2c/bin2c u32 <$(@:.inc.c=.bin) >>$@ + +$(BUILD_DIR)/assets/%.u8.inc.c: assets/%.u8.bin + @echo // From file://`realpath $<` >$@ + tools/assets/bin2c/bin2c u8 <$< >>$@ + +$(BUILD_DIR)/assets/%.u64.jpg.inc.c: assets/%.u64.jpg + @echo // From file://`realpath $<` >$@ + tools/assets/bin2c/bin2c u64 <$< >>$@ + +# Assets from extracted/ $(BUILD_DIR)/assets/%.u64.inc.c: $(EXTRACTED_DIR)/assets/%.u64.png $(PYTHON) tools/assets/build_from_png.py $< $(@:.inc.c=.bin)