1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00
RIOT/makefiles/utils/checks.mk
Juan Carrano 547d9f0802 makefiles/utils: Add a function for checking that a string is not empty.
A call to `$(ensure_value x,y)` will fail with message y if x is empty, and
otherwise return x. This can be useto write more compact makefiles, while still
producing friendly error messages.
2018-12-07 18:19:34 +01:00

12 lines
341 B
Makefile

# Utilities to produce errors inside Make
# Use this functions to produce friendlier error messages.
# Produce an error if the value is empty
#
# Parameters
# value: a string which should not be empty
# message: The error message to display.
# Returns:
# the first argument, if it is not empty.
ensure_value = $(if $(1),$(1),$(error $(2)))