elvis.mk 937 B

123456789101112131415161718192021222324252627282930313233343536373839
  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. distclean:: distclean-elvis
  17. # Plugin-specific targets.
  18. $(ELVIS):
  19. @$(call core_http_get,$(ELVIS),$(ELVIS_URL))
  20. @chmod +x $(ELVIS)
  21. $(ELVIS_CONFIG):
  22. @$(call core_http_get,$(ELVIS_CONFIG),$(ELVIS_CONFIG_URL))
  23. elvis: $(ELVIS) $(ELVIS_CONFIG)
  24. @$(ELVIS) rock -c $(ELVIS_CONFIG) $(ELVIS_OPTS)
  25. distclean-elvis:
  26. $(gen_verbose) rm -rf $(ELVIS)