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.

32 lines
925 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. MAP_ASM := $(MAP_PNG:%.png:%.s)
  6. ALL_2BPP := $(SPRITE_PNG:%.png=%.2bpp) $(MAP_PNG:%.png=%.map.2bpp) $(MAP_PNG:%.png=%.tiles.2bpp)
  7. # Code
  8. SFILES := $(shell find src -type f -name '*.s')
  9. OFILES := $(SFILES:%.s=%.o) $(MAP_ASM)
  10. .PHONY: clean
  11. is.gb is.gb.sym:$(OFILES) $(ALL_2BPP)
  12. rgblink -o $@ -n $@.sym $(OFILES)
  13. rgbfix -v $@
  14. $(OFILES): $(ALL_2BPP)
  15. %.o: %.s
  16. rgbasm -i inc -o $@ $<
  17. png/map/%.tiles.2bpp png/map/%.map.2bpp: png/map/%.png
  18. rgbgfx -u -t $(<:%.png=%.map.2bpp) -o $(<:%.png=%.tiles.2bpp) $<
  19. png/map/%.s: png/map/%_coll.png
  20. python scripts/generate_coll_map.py -o $@ $<
  21. png/sprite/%.2bpp: png/sprite/%.png
  22. rgbgfx -o $@ $<
  23. clean:
  24. rm -f is.gb is.gb.sym $(ALL_2BPP) $(OFILES) $(MAP_ASM)