【问题标题】:nmake throw error if variable is not defined如果未定义变量,则 nmake 抛出错误
【发布时间】:2020-02-13 22:47:24
【问题描述】:

我有一个通过 nmake 运行的 makefile,而不是 gnumake。

我有一些代码取自用于 gnumake 的 makefile...

# out_repo = 

ifndef out_repo
$(error out_repo is not set)
endif

这不适用于 nmake。在 nmake 中有没有一种方法可以让我有相同的行为,如果未定义变量,make 过程会出错?

【问题讨论】:

    标签: gnu-make nmake


    【解决方案1】:

    NMAKE 语法中的等效代码是:

    # out_repo = 
    
    !ifndef out_repo
    !error out_repo is not set
    !endif
    

    请参阅我对https://stackoverflow.com/a/54046754/318716 的回答,以获取更旧、更有用的 NMAKE 文档的参考。

    【讨论】:

      猜你喜欢
      • 2018-11-15
      • 2018-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-11-10
      • 1970-01-01
      • 2016-11-04
      相关资源
      最近更新 更多