ci.mk 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Copyright (c) 2015-2017, 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: ci ci-prepare ci-setup
  4. CI_OTP ?=
  5. ifeq ($(strip $(CI_OTP)),)
  6. ci::
  7. else
  8. ci:: $(addprefix ci-,$(CI_OTP))
  9. ci-prepare: $(addprefix ci-prepare-,$(CI_OTP))
  10. ci-setup::
  11. $(verbose) :
  12. ci-extra::
  13. $(verbose) :
  14. ci_verbose_0 = @echo " CI " $(1);
  15. ci_verbose = $(ci_verbose_$(V))
  16. define ci_target
  17. ci-prepare-$1: $(KERL_INSTALL_DIR)/$2
  18. $(verbose) :
  19. ci-$1: ci-prepare-$1
  20. $(verbose) $(MAKE) --no-print-directory clean
  21. $(ci_verbose) \
  22. PATH="$(KERL_INSTALL_DIR)/$2/bin:$(PATH)" \
  23. CI_OTP_RELEASE="$1" \
  24. CT_OPTS="-label $1" \
  25. CI_VM="$3" \
  26. $(MAKE) ci-setup tests
  27. $(verbose) $(MAKE) --no-print-directory ci-extra
  28. endef
  29. $(foreach otp,$(CI_OTP),$(eval $(call ci_target,$(otp),$(otp),otp)))
  30. $(foreach otp,$(filter-out $(ERLANG_OTP),$(CI_OTP)),$(eval $(call kerl_otp_target,$(otp))))
  31. help::
  32. $(verbose) printf "%s\n" "" \
  33. "Continuous Integration targets:" \
  34. " ci Run '$(MAKE) tests' on all configured Erlang versions." \
  35. "" \
  36. "The CI_OTP variable must be defined with the Erlang versions" \
  37. "that must be tested. For example: CI_OTP = OTP-17.3.4 OTP-17.5.3"
  38. endif