How to synthesize line breaks in GNU Make warnings or errors?

前端 未结 1 1623
攒了一身酷
攒了一身酷 2021-01-11 17:05

When using the built-in $(error text) and $(warning text) functions of GNU Make, how can I get line breaks into the error/warning output without acrobatics?

By acrob

1条回答
  •  悲&欢浪女
    2021-01-11 17:25

    Define a line break variable using define/endef and use it as $n like this:

    define n
    
    
    endef
    
    $(warning "something$nfoo$nbar$nbaz")
    

    Note the two blank lines between define and endef

    0 讨论(0)
提交回复
热议问题