elvis.mk 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright (c) 2014, Juan Facorro <juan@inaka.net>
  2. # This file is part of erlang.mk and subject to the terms of the ISC License.
  3. .PHONY: elvis distclean-elvis
  4. # Configuration.
  5. ELVIS_CONFIG ?= $(CURDIR)/elvis.config
  6. ELVIS ?= $(CURDIR)/elvis
  7. export ELVIS
  8. ELVIS_URL ?= https://github.com/inaka/elvis/releases/download/0.2.3/elvis
  9. ELVIS_CONFIG_URL ?= https://github.com/inaka/elvis/releases/download/0.2.3/elvis.config
  10. ELVIS_OPTS ?=
  11. # Core targets.
  12. help::
  13. @printf "%s\n" "" \
  14. "Elvis targets:" \
  15. " elvis Run Elvis using the local elvis.config or download the default otherwise"
  16. ifneq ($(wildcard $(ELVIS_CONFIG)),)
  17. rel:: distclean-elvis
  18. endif
  19. distclean:: distclean-elvis
  20. # Plugin-specific targets.
  21. $(ELVIS):
  22. @$(call core_http_get,$(ELVIS),$(ELVIS_URL))
  23. @chmod +x $(ELVIS)
  24. $(ELVIS_CONFIG):
  25. @$(call core_http_get,$(ELVIS_CONFIG),$(ELVIS_CONFIG_URL))
  26. elvis: $(ELVIS) $(ELVIS_CONFIG)
  27. @$(ELVIS) rock -c $(ELVIS_CONFIG) $(ELVIS_OPTS)
  28. distclean-elvis:
  29. $(gen_verbose) rm -rf $(ELVIS)