relx.mk 937 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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: relx-rel distclean-relx-rel distclean-relx
  4. # Configuration.
  5. RELX_CONFIG ?= $(CURDIR)/relx.config
  6. RELX ?= $(CURDIR)/relx
  7. export RELX
  8. RELX_URL ?= https://github.com/erlware/relx/releases/download/v1.0.2/relx
  9. RELX_OPTS ?=
  10. RELX_OUTPUT_DIR ?= _rel
  11. ifeq ($(firstword $(RELX_OPTS)),-o)
  12. RELX_OUTPUT_DIR = $(word 2,$(RELX_OPTS))
  13. endif
  14. # Core targets.
  15. ifneq ($(wildcard $(RELX_CONFIG)),)
  16. rel:: distclean-relx-rel relx-rel
  17. endif
  18. distclean:: distclean-relx-rel distclean-relx
  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. relx-rel: $(RELX)
  27. @$(RELX) -c $(RELX_CONFIG) $(RELX_OPTS)
  28. distclean-relx-rel:
  29. $(gen_verbose) rm -rf $(RELX_OUTPUT_DIR)
  30. distclean-relx:
  31. $(gen_verbose) rm -rf $(RELX)