Is it possible to create a multi-line string variable in a Makefile

后端 未结 19 2057
借酒劲吻你
借酒劲吻你 2020-11-28 20:27

I want to create a makefile variable that is a multi-line string (e.g. the body of an email release announcement). something like

ANNOUNCE_BODY=\"
Version $         


        
19条回答
  •  孤独总比滥情好
    2020-11-28 20:29

    Not really a helpful answer, but just to indicate that 'define' does not work as answered by Ax (did not fit in a comment):

    VERSION=4.3.1
    PACKAGE_NAME=foobar
    DOWNLOAD_URL=www.foobar.com
    
    define ANNOUNCE_BODY
        Version $(VERSION) of $(PACKAGE_NAME) has been released
        It can be downloaded from $(DOWNLOAD_URL)
        etc, etc
    endef
    
    all:
        @echo $(ANNOUNCE_BODY)
    

    It gives an error that the command 'It' cannot be found, so it tries to interpret the second line of ANNOUNCE BODY as a command.

提交回复
热议问题