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.

37 lines
879 B

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