help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Suppress warnings about overriding commands


From: Vincent Castellano
Subject: Suppress warnings about overriding commands
Date: Tue, 9 Jan 2007 11:47:24 -0800

Hello,

I was wondering if there is any method to suppress the following type
of messages:

Makefile:98: warning: overriding commands for target `lib'
Makefile:50: warning: ignoring old commands for target `lib'
Makefile:98: warning: overriding commands for target `cli'
Makefile:60: warning: ignoring old commands for target `cli'
Makefile:98: warning: overriding commands for target `debug'
Makefile:54: warning: ignoring old commands for target `debug'
Makefile:98: warning: overriding commands for target `cli-debug'
Makefile:66: warning: ignoring old commands for target `cli-debug'
[...]

The reason they come up is because we do a little (possibly kludgy,
but it works well for our needs) "magic" with a make variable CFG that
defines certain build parameters, and if it's not defined, build all
possible configurations.

The code that generates most of this looks like this:

# This will override the targets for make's without a CFG=
# Will generate warnings for override and ignore, may be ignored.
# Update this when adding new targets
ifndef CFG
lib cli debug cli-debug dll dll-debug distro main cli-distro dll-distro:
        $(foreach cfg,$(cfg_list), $(MAKE) CFG=$(cfg) $@;)
endif

While this may very well not be a best practice method to do this, is
there any way to ignore and suppress these warnings? Because we are
recalling ourselves recursively, they are displaying many times over.

Thank You,
Vincent Castellano




reply via email to

[Prev in Thread] Current Thread [Next in Thread]