I would like to store some elementary m4 macros that I typically use in a a separate file (say mymacros.m4 ) and then apply the macros used therein on the current source file I am working on mydoc.pre.txt
Is this possible? In all m4 tutorials, I have seen m4 macros being stored at the top of the file or interleaved with the working document. So at the commandline, I would like to type something like
m4 -f mymacros.m4 mydoc.pre.txt > mydoc.post.txt.
Is there an m4 feature for this?
m4providesincludeandsincludemacros (and maybepaste,spaste):So you can include your
mymacros.m4into yourm4files:You can use (if your
m4supports) the-Ioption ofm4command to add directories to include path.