compat.mk 817 B

12345678910111213141516171819202122232425
  1. # Copyright (c) 2015, 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: rebar.config
  4. # We strip out -Werror because we don't want to fail due to
  5. # warnings when used as a dependency.
  6. define compat_convert_erlc_opt
  7. $(if $(filter-out -Werror,$1),\
  8. $(if $(findstring +,$1),\
  9. $(shell echo $1 | cut -b 2-)))
  10. endef
  11. define compat_rebar_config
  12. {deps, [$(call comma_list,$(foreach d,$(DEPS),\
  13. {$(call dep_name,$d),".*",{git,"$(call dep_repo,$d)","$(call dep_commit,$d)"}}))]}.
  14. {erl_opts, [$(call comma_list,$(foreach o,$(ERLC_OPTS),$(call compat_convert_erlc_opt,$o)))]}.
  15. endef
  16. $(eval _compat_rebar_config = $$(compat_rebar_config))
  17. $(eval export _compat_rebar_config)
  18. rebar.config:
  19. $(gen_verbose) echo "$${_compat_rebar_config}" > rebar.config