My work is converting Linux command into CMake execute_process(COMMAND ...)
, and there are some differences between them, so i need to understand each Linux command. But this m4 command really beat me. The m4 command as below:
m4 -Isource/analyzer/ -P < source/analyzer/aParser.m4y > source/analyzer/aParser.by
What does this command mean?
I have read m4 document before, and it said the format of the m4
command is: m4 [option…] [file…]
, so i think in command:
m4 -Isource/analyzer/ -P < source/analyzer/aParser.m4y > source/analyzer/aParser.by
the -Isource/analyzer/ -P
is [option...]
of m4
, and this m4
commad use<
to read the file source/analyzer/aParser.m4y
as m4 [file...]
, did i understand right?
m4 is a macro processor. Read its documentation (for GNU m4). It is a quite complex thing, so I won't try to abstract it in a few sentences.
The -P
option is prefixing builtins with m4_
so define
becomes m4_define
etc...
The <
(and >
) is not an option to m4, it is a general shell redirection.
Of course, you also need to study the documentation of cmake (which I personally don't like much, since GNU make 4 is powerful enough without cmake
)
You probably should spend weeks in reading documentations, including Advanced Bash Scripting guide & Advanced Linux Programming (and the other documentations I pointed here).