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

后端 未结 19 1996
借酒劲吻你
借酒劲吻你 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:33

    I believe the safest answer for cross-platform use would be to use one echo per line:

      ANNOUNCE.txt:
        rm -f $@
        echo "Version $(VERSION) of $(PACKAGE_NAME) has been released" > $@
        echo "" >> $@
        echo "It can be downloaded from $(DOWNLOAD_URL)" >> $@
        echo >> $@
        echo etc, etc" >> $@
    

    This avoids making any assumptions of on the version of echo available.

提交回复
热议问题