For each target xxx, I have a corresponding file $(LOGDIRECTORY)/xxx.log and I would like to redirect the typical make output to that particular file, while printing to the console a more "neat" message. For example, if I run "make xxx" I would like to see output such as the following:

Compiling: x.cpp => x.o
Compiling: y.cpp => y.o
Compiling: z.y => z.c
Compiling: z.c => z.o
Linking: x.o, y.o, z.o => prog


While it outputs the above, it should write out the longer -- somewhat less appealing -- output "g++ -I... " to the log files. If any of the steps fail, I would like to see something like the following:

Type "make xxx_log" to view log.
** Make [2] error

My main issue is that I have tried using pattern rules to create such an output, but make seems to ignore the pattern rules I have defined. Additionally, I have not seen any examples dealing with the .cpp pattern rule; only examples for .c.

Can anyone help? Thanks.


_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to