Can make warn me, when I use unset variables?

后端 未结 2 1061
暗喜
暗喜 2021-02-13 18:03

Is there a way to tell make to complain when I use unset variables? Something similar to set -u in bash?

I have just spent twenty minutes debugging my Makef

2条回答
  •  广开言路
    2021-02-13 18:38

    Here is how one can do it to make make fail immediately:

    ifndef PSWD
    $(error PSWD is undefined)
    endif
    

提交回复
热议问题