You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
857 B

3 years ago
3 years ago
  1. # Graphics
  2. SPRITE_PNG := $(shell find png/sprite -type f -name '*.png')
  3. MAP_PNG := $(shell find png/map -type f -name '*.png' -not -name '*_coll.png')
  4. MAP_COLL := $(shell find png/map -type f -name '*_coll.png')
  5. # Graphics (generated)
  6. MAP_S := $(MAP_PNG:%.png=%.s)
  7. MAP_INC := $(MAP_PNG:%.png=%.inc)
  8. SPRITE_2BPP := $(SPRITE_PNG:%.png=%.2bpp)
  9. # Code
  10. SFILES := $(shell find src -type f -name '*.s')
  11. OFILES := $(SFILES:%.s=%.o) $(MAP_S:%.s=%.o)
  12. .PHONY: clean
  13. is.gb is.gb.sym: $(OFILES)
  14. rgblink -o $@ -n $@.sym $(OFILES)
  15. rgbfix -v $@
  16. $(OFILES): $(MAP_INC)
  17. $(OFILES): $(SPRITE_2BPP)
  18. %.o: %.s
  19. rgbasm -i inc -o $@ $<
  20. png/map/%.s png/map/%.inc: png/map/%.png png/map/%_coll.png
  21. python scripts/generate_map.py $<
  22. png/sprite/%.2bpp: png/sprite/%.png
  23. rgbgfx -o $@ $<
  24. clean:
  25. rm -f is.gb is.gb.sym $(OFILES) $(MAP_S) $(MAP_INC) $(SPRITE_2BPP)