I do see certain statements in a pre-written Makefile target, where they are invoking the shell to execute certain commands. Following is the syntax of the one which I am puzzled about.
[ -z "$(ENV_VAR)" ] || \
echo Building $(ENV_VAR); \
So my questions in the above statement are:
(1) Is this a conditional statement that checks the existence of an environment variable?
(2) What does the -z option mean.
(3) As of I know “||” is a logical operator, how does it behave in such a use case.
-z: Expression is true, if the length of following string has zero lengthcmd1 || cmd2: Execution ofcmd2ifcmd1returns with a status not equal to zero (i.e.,cmd1fails)