relx.mk 840 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. # Copyright (c) 2013-2014, Loïc Hoguin <essen@ninenines.eu>
  2. # This file is part of erlang.mk and subject to the terms of the ISC License.
  3. .PHONY: distclean-rel
  4. # Configuration.
  5. RELX_CONFIG ?= $(CURDIR)/relx.config
  6. ifneq ($(wildcard $(RELX_CONFIG)),)
  7. RELX ?= $(CURDIR)/relx
  8. export RELX
  9. RELX_URL ?= https://github.com/erlware/relx/releases/download/v1.0.2/relx
  10. RELX_OPTS ?=
  11. RELX_OUTPUT_DIR ?= _rel
  12. ifneq ($(firstword $(subst -o,,$(RELX_OPTS))),)
  13. RELX_OUTPUT_DIR = $(firstword $(subst -o,,$(RELX_OPTS)))
  14. endif
  15. # Core targets.
  16. rel:: distclean-rel $(RELX)
  17. @$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS)
  18. distclean:: distclean-rel
  19. # Plugin-specific targets.
  20. define relx_fetch
  21. $(call core_http_get,$(RELX),$(RELX_URL))
  22. chmod +x $(RELX)
  23. endef
  24. $(RELX):
  25. @$(call relx_fetch)
  26. distclean-rel:
  27. $(gen_verbose) rm -rf $(RELX_OUTPUT_DIR)
  28. endif