The linux kernel I compile only prints message like:
CC .....
LD [M] ....
How can I hide the compiling message printed out by make and output what I want? Where can I find the portion of code which does this in kernel Makefile?
If you want to inhibit the display of commands during a particular make run, you can use the -s option. If you want to inhibit the display of all command lines in every run, add the special target . SILENT to your makefile .
The file name of the target of the rule. If the target is an archive member, then ' $@ ' is the name of the archive file. In a pattern rule that has multiple targets (see Introduction to Pattern Rules), ' $@ ' is the name of whichever target caused the rule's recipe to be run.
The ' -s ' or ' --silent ' flag to make prevents all echoing, as if all recipes started with ' @ '. A rule in the makefile for the special target .
The Linux make command is used to build and maintain groups of programs and files from the source code. In Linux, it is one of the most frequently used commands by the developers. It assists developers to install and compile many utilities from the terminal.
In short, prepend '@'.
What the kernel makefiles do is rather more complicated, but it boils down to something like this:
%.o: %.c
@echo [CC] $@
@gcc -o $@ -c $<
Look at the GNU Make manual. GNU Make really is quite well documented, and if you're doing a lot of work with it it's worth the effort to read it through.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With