mk(1) doesn’t provide such a built-in way of defining variables only if they aren’t non-empty environment variables. Actually, neither any make(1) from Bell Labs nor POSIX make(1) provide such a way to do that, the ?= syntax is just a GNU extension.
What you usually would do is in your mkfile just set the variable normally:
XDG_CONFIG_HOME = $home/.config
and overwrite the variable in the mk(1) command:
; mk 'XDG_CONFIG_HOME='^$home^'/cfg'
1
samthegolden
On
In shell, ":-" is used to set a variable to a default value in case the variable has no value:
mk(1) doesn’t provide such a built-in way of defining variables only if they aren’t non-empty environment variables. Actually, neither any make(1) from Bell Labs nor POSIX make(1) provide such a way to do that, the
?=
syntax is just a GNU extension.What you usually would do is in your
mkfile
just set the variable normally:and overwrite the variable in the mk(1) command: