# 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)
|
|
rgblink -o $@ -n $@.sym $(OFILES)
|
|
rgbfix -v $@
|
|
|
|
$(OFILES): $(MAP_INC)
|
|
$(OFILES): $(SPRITE_2BPP)
|
|
|
|
%.o: %.s
|
|
rgbasm -i inc -o $@ $<
|
|
|
|
png/map/%.s png/map/%.inc: png/map/%.png png/map/%_coll.png
|
|
python scripts/generate_map.py $<
|
|
|
|
png/sprite/%.2bpp: png/sprite/%.png
|
|
rgbgfx -o $@ $<
|
|
|
|
clean:
|
|
rm -f is.gb is.gb.sym $(OFILES) $(MAP_S) $(MAP_INC) $(SPRITE_2BPP)
|