我需要通知 Makefile 的用户他必须设置一个环境变量。
target: dependency
@if test ! -f $(FILE) ; then\
echo Vitally needed $(FILE) is missed. ;\
echo You can change the path to the file by setting $(get_var_name $(FILE)) environment variable.;\
fi
那么,有没有办法获取 $(FILE) 的名称(我称之为 $(get_var_name ...) make 函数),以便用户看到以下输出?
Vitally needed very.very.important.file is missed.
You can change the path to the file by setting FILE environment variable.