PYTHON ?= python # Graphics SPRITE_PNG := $(shell find png/sprite -type f -name '*.png') MAP_PNG := $(shell find png/map -type f -name '*.png' -not -name '*_coll.png') MAP_COLL := $(shell find png/map -type f -name '*_coll.png') # Graphics (generated) MAP_S := $(MAP_PNG:%.png=%.s) MAP_INC := $(MAP_PNG:%.png=%.inc) SPRITE_2BPP := $(SPRITE_PNG:%.png=%.2bpp) # Code SFILES := $(shell find src -type f -name '*.s') OFILES := $(SFILES:%.s=%.o) $(MAP_S:%.s=%.o) .PHONY: clean is.gb is.gb.sym: $(OFILES) @echo "[LINK] is.gb" @rgblink -o $@ -n $@.sym $(OFILES) @rgbfix -v -p 0 $@ $(OFILES): $(MAP_INC) $(OFILES): $(SPRITE_2BPP) %.o: %.s @echo "[ASSEMBLE] $<" @rgbasm -i inc -o $@ $< png/map/%.s png/map/%.inc: png/map/%.png png/map/%_coll.png @echo "[MAP] $<" @$(PYTHON) scripts/generate_map.py $< png/sprite/%.2bpp: png/sprite/%.png @echo "[SPRITE] $<" @rgbgfx -o $@ $< clean: @rm -f is.gb is.gb.sym $(OFILES) $(MAP_S) $(MAP_INC) $(SPRITE_2BPP) @echo "All build files removed"