elvis.mk 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  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_CONFIG),$(ELVIS_CONFIG_URL))
  23. @$(call core_http_get,$(ELVIS),$(ELVIS_URL))
  24. @chmod +x $(ELVIS)
  25. elvis: $(ELVIS)
  26. @$(ELVIS) rock -c $(ELVIS_CONFIG) $(ELVIS_OPTS)
  27. distclean-elvis:
  28. $(gen_verbose) rm -rf $(ELVIS)