1

I am writing an NMake build script for Windows. I want to write a multiline string in the NMake makefile.

The approach suggested in the following question works in GNUMake, but when I use it in NMake, I get syntax errors indicating that NMake is trying to parse every line as syntax rather than as a literal string variable.

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

Eventually what I want to do with the multiline string is to print it out to a file.

How do you do this in NMake (create a multiline string and echo it to a file)?

sffc
  • 6,186
  • 3
  • 44
  • 68

1 Answers1

0

NMake "inline files" seem to do the job for my use case:

@echo <<filename.txt
blah
blah
blah
<<KEEP

https://learn.microsoft.com/en-us/cpp/build/inline-files-in-a-makefile

sffc
  • 6,186
  • 3
  • 44
  • 68