makefile - Output multiline variable to a file with GNU Make -
I'm having a hard time writing makefile rules that output to a multiline variable in a file.
Here I have the code:
defined VAR1 / dev D755 - - - - - - endef defined VAR2 / test d 777 - - - - - - / test2 d 777 - - - - - - endef VARS + = $ (VAR1) VARS + = $ (VAR2) All: "$ (VARS)" echo & gt; Test However, the echo fails to call me "unknown quoted string" because I'm unknown how can I put files in every line declared on a separate line?
If you export the variable, instead of shell and instead of a series it is referred to as the shell variable If you do, you will have a better fortune:
defined VAR1 / dev d 755 - - - - - - endef defined VAR2 / test d 777 - - - - - - - / test2 d 777 - - - - - Definition of Endof Works $ (VAr1) $ (VAr2) and ED exports VARS All: "Echo $$ VARS" & gt; << Code> Keep the following adjustments in your messyface:
- I created
defined to VARS , Instead of a series of + = assignments, which makes it easy to get a new line between the value of VAR1 and VAR2 . I used the $ VARS - I added the
export VARS in my makefile, pushed it into the environment. > Instead of $ (VARS) - which leaves instead to open rather than open, which should avoid the "canceled cited string" error.
Comments
Post a Comment