On Fri, 2012-03-09 at 18:17 +0100, Sebastian Pipping wrote: > on page [1] it reads: > > "CFLAGS should be used in every invocation of the C compiler, > both those which do compilation and those which do linking." > > It would be nice to have an explanation why CFLAGS whould be used with > linking, too. Maybe with an example or a dedicated section in the manual.
I'm not sure there's anything so magical about it that it requires a dedicated section. There's nothing more to it than some flags on the compile line can also be useful to the linker, in at least some implementations. For example the linker could recognize the optimize or debug flags and do link-time optimization or generate output with special debug information. And sometimes, depending on how your makefile is written, it's possible for a "link command" to also compile; for example in a POSIX "cc" implementation, this does what you'd expect: cc -o foo foo.o bar.c biz.c baz.o (that is, compile the .c files and link the whole thing together). If your makefile can never provide source files to the linker, and you know that the linker you're using has no use for compile flags (doesn't make use of them) then it's fine to leave them out. _______________________________________________ Bug-make mailing list Bug-make@gnu.org https://lists.gnu.org/mailman/listinfo/bug-make