Skip site navigation (1) Skip section navigation (2)

Re: additional GCC warning flags

From: Alvaro Herrera <alvherre(at)dcc(dot)uchile(dot)cl>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: Neil Conway <neilc(at)samurai(dot)com>,Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>,pgsql-patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: additional GCC warning flags
Date: 2004-10-19 18:07:24
Message-ID: 20041019180724.GA4973@dcc.uchile.cl (view raw or flat)
Thread:
Lists: pgsql-patches
On Tue, Oct 19, 2004 at 07:40:56PM +0200, Peter Eisentraut wrote:

> I'm already not so happy about the new warning options, because they
> make the compile lines too long.  How's that for an argument? ;-)

There's a better solution: use an approach similar to that used in the
Linux kernel, which echoes only the object name that's currently being
compiled.  So there's output showing progress, but not unnecessarily
long lines.  Of course, it can be easily reverted by using a configure
argument or make variable.


This is from Linux's main Makefile (I may be missing a piece):


# Beautify output
# ---------------------------------------------------------------------------
#
# Normally, we echo the whole command before executing it. By making
# that echo $($(quiet)$(cmd)), we now have the possibility to set
# $(quiet) to choose other forms of output instead, e.g.
#
#         quiet_cmd_cc_o_c = Compiling $(RELDIR)/$@
#         cmd_cc_o_c       = $(CC) $(c_flags) -c -o $@ $<
#
# If $(quiet) is empty, the whole command will be printed.
# If it is set to "quiet_", only the short version will be printed. 
# If it is set to "silent_", nothing wil be printed at all, since
# the variable $(silent_cmd_cc_o_c) doesn't exist.
#
# A simple variant is to prefix commands with $(Q) - that's usefull
# for commands that shall be hidden in non-verbose mode.
#
#   $(Q)ln $@ :<
#
# If KBUILD_VERBOSE equals 0 then the above command will be hidden.
# If KBUILD_VERBOSE equals 1 then the above command is displayed.

ifeq ($(KBUILD_VERBOSE),1)
  quiet =
  Q =
else
  quiet=quiet_
  Q = @
endif



A sample target would be

%.o: %.c scripts FORCE
    $(Q)$(MAKE) $(build)=$(@D) $@

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
"Endurecerse, pero jamás perder la ternura" (E. Guevara)


In response to

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2004-10-19 18:37:00
Subject: Re: additional GCC warning flags
Previous:From: Peter EisentrautDate: 2004-10-19 17:40:56
Subject: Re: additional GCC warning flags

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group