Re: additional GCC warning flags

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: additional GCC warning flags
Дата
Msg-id 20041019180724.GA4973@dcc.uchile.cl
обсуждение исходный текст
Ответ на Re: additional GCC warning flags  (Peter Eisentraut <peter_e@gmx.net>)
Ответы Re: additional GCC warning flags  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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)


В списке pgsql-patches по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: additional GCC warning flags
Следующее
От: Tom Lane
Дата:
Сообщение: Re: additional GCC warning flags