I need to check if a variable is defined inside a makefile file executing the command
if the variable is empty or not defined the command returns an empty string, for example
make
. For example, to get the value for a makefile variable I can run the command
Code:
% make -C /usr/ports/misc/mc -V WRKDIR
/usr/ports/misc/mc/work
%
Code:
% make -C /usr/ports/misc/mc -V FORBIDDEN
%
make
returns an empty string and exit code 0 (FORBIDDEN
is not defined for misc/mc port)