helpers.mk 439 B

123456789101112131415161718192021
  1. define print_info
  2. tput bold && tput setaf 2 && echo $1
  3. tput sgr0
  4. endef
  5. define print_help
  6. tput setaf 4 && printf "%-30s - %s\n" $1 $2
  7. tput sgr0
  8. endef
  9. define uniq =
  10. $(eval out :=) \
  11. $(foreach _, $1, $(if $(filter $_, $(out)),,$(eval out += $_))) \
  12. $(out)
  13. endef
  14. # for some reason this filter works differently than repasting it
  15. # directly into rule
  16. define filter_file =
  17. $(foreach _, $2, $(if $(findstring $1, $(notdir $_)), $_))
  18. endef