elvis.mk 995 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. # Copyright (c) 2015, Erlang Solutions Ltd.
  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.5-beta2/elvis
  9. ELVIS_CONFIG_URL ?= https://github.com/inaka/elvis/releases/download/0.2.5-beta2/elvis.config
  10. ELVIS_OPTS ?=
  11. # Core targets.
  12. help::
  13. $(verbose) 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. $(gen_verbose) $(call core_http_get,$(ELVIS),$(ELVIS_URL))
  20. $(verbose) chmod +x $(ELVIS)
  21. $(ELVIS_CONFIG):
  22. $(verbose) $(call core_http_get,$(ELVIS_CONFIG),$(ELVIS_CONFIG_URL))
  23. elvis: $(ELVIS) $(ELVIS_CONFIG)
  24. $(verbose) $(ELVIS) rock -c $(ELVIS_CONFIG) $(ELVIS_OPTS)
  25. distclean-elvis:
  26. $(gen_verbose) rm -rf $(ELVIS)