Lots of target override warnings running cbuild Makefile

Bug #1076450 reported by Paul Sokolovsky
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Linaro Toolchain Build Automation
Confirmed
Medium
Unassigned

Bug Description

Running cbuild Makefiles generally produces lots of warnings/errors, which complicates debugging real issues. One of the most noisy warnings are:

make[3]: Entering directory `/home/pfalcon/devel/linaro/cbuild-all/cbuild/slaves/lava-build'
../../lib/gcc.mk:57: warning: overriding commands for target `testsuite'
../../lib/steps.mk:144: warning: ignoring old commands for target `testsuite'
../../lib/gcc.mk:67: warning: overriding commands for target `configure'
../../lib/steps.mk:171: warning: ignoring old commands for target `configure'
../../lib/gcc.mk:72: warning: overriding commands for target `build'
../../lib/steps.mk:150: warning: ignoring old commands for target `build'
../../lib/gcc.mk:75: warning: overriding commands for target `post-archive'
../../lib/steps.mk:179: warning: ignoring old commands for target `post-archive'
../../lib/gcc.mk:78: warning: overriding commands for target `extract-top'
../../lib/steps.mk:163: warning: ignoring old commands for target `extract-top'
make -f ../../lib/fetch.mk fetch F=gcc-linaro-4.6-2012.09/gcc-linaro-4.6-2012.09.tar

Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

From http://theory.uwinnipeg.ca/localfiles/infofiles/make/make_121.html :

----------------
`warning: overriding commands for target `xxx''
`warning: ignoring old commands for target `xxx''
    GNU make allows commands to be specified only once per target (except for double-colon rules). If you give commands for a target which already has been defined to have commands, this warning is issued and the second set of commands will overwrite the first set.
----------------

I.e., GNU make doesn't appreciate such usage. However (http://www.gnu.org/software/make/manual/make.html#Multiple-Rules): "As a special case, if the file's name begins with a dot, no error message is printed." So, that would be easy way to fix that issue.

Revision history for this message
Michael Hope (michaelh1) wrote :

Yip, I know about this but don't have a fix. steps.mk defines fallback actions for things like install

install:
  make -C foo install

which can then be overriden by the calling script, such as gcc.mk:

include steps.mk

install:
 make -C foo something-else-but-install

Open to suggestions. I'm happy with the current way.

Changed in cbuild:
status: New → Confirmed
importance: Undecided → Medium
Revision history for this message
Paul Sokolovsky (pfalcon) wrote :

I tried to follow the lead from make's docs ("As a special case, if the file's name begins with a dot, no error message is printed."), but found it doesn't really make any difference:

../../lib/gcc.mk:78: warning: overriding commands for target `.extract-top'
../../lib/steps.mk:165: warning: ignoring old commands for target `.extract-top'

Looking at make's source, there's no explicit check for starting dot at the place where warning is printed, so either that clause in docs is out of date, or means something completely different.

Other approach might be to have vars like extact_top_DEFINED=1, then include steps.mk and wrap its rules in ifdef blocks, but that's much less verbose and intrusive change than just using dot-prefixed target names which I hope would work ;-(

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.