I'm using m4 define to create a macro. I tried using include(file) to read the content of the file as below.
define(`TEST', include(file1))
TEST
file1:
test -abc -LDFLAGS "-Wl,-rpath,/home/user -lmsg"
When I run the code, it gives a warning and doesn't print anything beyond -Wl
m4:r1:1: Warning: excess arguments to builtin `define' ignored
test -abc -LDFLAGS "-Wl
I tried using single quotes, but it didn't work. Can someone please help me resolve this?
If there are commas in the file, those will be interpreted as argument separators. The
includereplacement is inserted before determining the arguments todefine.Using single quotes is correct -- then the
includewill be processed in the output instead. For example:does work on my machine. (note that an even better solution is to add quotes around
file1as well).