From mboxrd@z Thu Jan 1 00:00:00 1970 From: dean.floyd.lkml@gmail.com (Dean Floyd) Date: Wed, 27 Apr 2011 20:13:05 -0700 Subject: quiet compile kernel In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Wed, Apr 27, 2011 at 10:04 AM, Prasad Joshi wrote: > On Wed, Apr 27, 2011 at 5:48 PM, loody wrote: >> Hi all: >> I found the compile message of kernel is quite succinct, when we set >> V=0, and I try to make my project output as clean as kernel did. >> >> Then I traced the Makefile and it just define "quiet" and "Q" then export it. >> Where is the exact place that quiet build begin? >> >> Is that complicated to copy this quiet-build process? > > Here is a simple way to do it > > Makefile: > ifeq ($(strip $(V)),) > ? ? ? ?E = @echo > ? ? ? ?Q = @ > else > ? ? ? ?E = @\# > ? ? ? ?Q = > endif > export E Q > > %.o: %.c > ? ? ? ?$(E) " ?CC ? ? ?" $@ > ? ? ? ?$(Q) $(CC) -c $(CFLAGS) $< -o $@ > > > So when V is defined, the make command will display the detailed > compilation message or else it will only show an echoed message. One > can also add a check for verbose level. You may also want to do something like the following: .SILENT: %.o: %.c echo " CC $<" $(CC) -g -c $< -o $@ -- Dean