deprecations.mk 1.3 KB

12345678910111213141516171819202122232425262728293031
  1. # deprecations warnings should be emitted for any variables which are planned for removal
  2. #
  3. # Specify the deprecation of variable 'FOO':
  4. # 1. clear the default value of the variable and re-arrange all conditionals appropriately
  5. # 1. add the announcement hint in this file:
  6. # ```
  7. # ifneq ($(FOO),)
  8. # MAKEFILET_DEPRECATION_WARNINGS += $(call MAKEFILET_EMIT_DEPRECATION_WARNING,FOO,Some explanation.)
  9. # endif
  10. # ```
  11. #
  12. MAKEFILET_DEPRECATION_PREFIX = DEPRECATION WARNING (makefilet):
  13. # the suffix is just a simple line break
  14. define MAKEFILET_DEPRECATION_SUFFIX
  15. endef
  16. MAKEFILET_EMIT_DEPRECATION_WARNING = $(MAKEFILET_DEPRECATION_PREFIX) '$(1)' is obsolet and will be removed. $(2)$(MAKEFILET_DEPRECATION_SUFFIX)
  17. MAKEFILET_DEPRECATION_WARNINGS ?=
  18. ifneq ($(DISABLE_CUSTOM_VIRTUALENV),)
  19. MAKEFILET_DEPRECATION_WARNINGS += $(call MAKEFILET_EMIT_DEPRECATION_WARNING,DISABLE_CUSTOM_VIRTUALENV,In the future 'makefilet' will not create virtual environments anymore by default. Please set 'PYTHON_VIRTUALENV_ENABLE=0' and remove 'DISABLE_CUSTOM_VIRTUALENV'.)
  20. endif
  21. # emit the collected warnings
  22. ifneq ($(MAKEFILET_DEPRECATION_WARNINGS),)
  23. # "$(warning ...)" is not allowed outside of a target - thus we inject an error message via an assignment
  24. _ := $(shell echo >&2 "$(MAKEFILET_DEPRECATION_WARNINGS)")
  25. endif