I study makeand struggle to understand something. I have some rules with this general structure.
FILE = "myfile.txt"
test :
YOUR = $(subst my,your,$(FILE));\
cat $(FILE) $(YOUR)
I expect the final result to be executed by the command:
cat myfile.txt yourfile.txt
Instead, I get the following ...
YOUR = "yourfile.txt";\
cat "myfile.txt"
/bin/sh: YOUR: command not found
make: *** [test] Error 1
If instead of using the function substI just do YOUR="yourfile"in makefile, everything looks fine. Any suggestions or did I miss something quite fundamental? I must add that I use tabs, not spaces, to run lines for commands in a rule.
source
share