Page 1 of 1

[zcc] m4 macro processor added to build sequence

Posted: Thu Sep 22, 2016 9:33 pm
by alvin
Effective with the Sept 23 build, zcc will invoke m4 to pre-process files of the following types:

foo.c.m4 -> output from m4 becomes .c
foo.s.m4 -> output from m4 becomes .s
foo.asm.m4 -> output from n4 becomes .asm
foo.h.m4 -> output from m4 is immediately written to the destination directory as a .h file. This allows files listed after foo.h.m4 in the source list to use this .h file in the same compile.

zcc can take any files of those types to any stage in the compile process, just like it does with other file types.

A few flags have been added to zcc specific to m4 processing:

-m4 : zcc will process m4 files and stop, writing the results to the destination directory
-CmOPTION : zcc will pass OPTION to the m4 command line

Note that filenames of the form "foo.ext.m4" may be processed and written to the output directory as "foo.ext" depending on flags given to zcc. For example the file "foo.c.m4" will be output as "foo.c" after m4 has processed it if zcc is given the -m4 flag on the command line. This means you should not use files of name "foo.ext" to store other source code as those files may be accidentally overwritten.

An m4 reference:
http://mbreen.com/m4.html