rules.mk 667 B

123456789101112131415161718192021222324
  1. art_LOCAL_PATH := $(call whereami)
  2. art_SPRITES := $(wildcard $(art_LOCAL_PATH)/*.png)
  3. art_SPR_DATA := $(addprefix $(OUT)/,$(art_SPRITES:%.png=%.cspr))
  4. art_SPR_SRC := $(OUT)/$(art_LOCAL_PATH)/sprites.c
  5. art_SPR_HDR := $(OUT)/$(art_LOCAL_PATH)/sprites.h
  6. BUILT_SRCS_C += $(art_SPR_SRC)
  7. INCLUDE += $(OUT)/$(art_LOCAL_PATH)
  8. BUILT_SRCS += $(art_SPR_HDR)
  9. $(OUT)/%.cspr: %.png
  10. @echo "SPRITE: $@"
  11. @mkdir -p $(dir $@)
  12. @ConvertImg --not-static --format n2dlib $< > $@
  13. $(art_SPR_SRC): $(art_SPR_DATA)
  14. @echo "Catting sprites into sprites.c"
  15. @rm -f $@
  16. @echo "#include <stdint.h>" > $@
  17. @cat $^ >> $@
  18. $(art_SPR_HDR): $(art_SPR_SRC)
  19. @./$(art_LOCAL_PATH)/header.bash $< $@