automake
[Top][All Lists]
Advanced

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

Re: Overriding `check:' target


From: Stefano Lattarini
Subject: Re: Overriding `check:' target
Date: Wed, 28 Sep 2011 21:14:07 +0200
User-agent: KMail/1.13.7 (Linux/2.6.30-2-686; KDE/4.6.5; i686; ; )

On Wednesday 28 September 2011, Jordi Gutiérrez wrote:
> (Please cc: me as I'm not subscribed to the list)
> 
> On 28 September 2011 04:06, Stefano Lattarini
> <address@hidden> wrote:
> > [Adding bug-automake]
> >
> > Reference:
> >  <http://lists.gnu.org/archive/html/automake/2011-09/msg00028.html>
> >
> > Hi Jordi, thanks for the report.
> >
> > On Tuesday 27 September 2011, Jordi Gutiérrez wrote:
> >
> >>
> >> This may be a little frivolous, but in GNU Octave's top-level
> >> Makefile.am, we override the check: target:
> >>
> >> http://hg.savannah.gnu.org/hgweb/octave/file/1bfca2bbea8b/Makefile.am#l106
> >
> > Ah yes, you've hitten a known bug/limitation that I had already
> > encoutered, but the lamentably forgotten about (sorry!).
> 
> Huh, so this is an automake bug?
>
This is fuzzy: it can be seen either as a bug or as a limitation.  In
theory, every automake-provided target should be overridable, which
suggests the behaviour you are observing is a bug.  But apparently the
`all' and `check' targets are special enough to deserve a special
treatment, especially when BUILT_SOURCES is involved; so the fact they
cannot be overridden can be seen as an unfortunate, but not gratuitous,
limitation.

Anyway, changing the current behaviour might be tricky and break other
usages "in the wild", so it's not something I want to do lighlty (even
if documenting it might be worthwhile).  So, IMHO the best fix for your
problem is to change the Octave's Makefile.am, if possible.

> >>
> >> However, in the generated Makefile, this produces a warning:
> >>
> >>     Makefile:2354: warning: overriding commands for target `check'
> >>     Makefile:1948: warning: ignoring old commands for target `check'
> >>
> >> because the generated Makefile contains these lines:
> >>
> >>     ## Standard target
> >>     check: $(BUILT_SOURCES)
> >>        $(MAKE) $(AM_MAKEFLAGS) check-recursive
> >>
> > JFTR, If I understand things correctly, this hackish recipe is
> > really required to ensure that $(BUILT_SOURCES) are effectively
> > built not only before the `check' target, but also before all its
> > "built-in" dependencies (`check-local', `check-am' and
> > `check-recusrsive', mostly).
> >
> >>     ## Overriden target
> >>     check: all
> >>        $(MAKE) -C test check
> >>
> > Just a question: why this overriding?
> 
> It's simply so that "make check" will contain the test output as the
> last bit of output. Without this, the tests are run, but the output is
> cluttered with "make[2]: Leaving directory..." output and similar.
>
Is this really much a problem?  Can't you just ignore these extra lines,
or call make with the `--no-print-directory' option?

BTW, if the Octave testsuite uses the Automake-provided harness, you could
enable colorized tests output, which makes pretty easy to ignore noise
when visually scanning the testsuite output.

> >> When does this happen? When is the check: target empty
> >> and when does it actually have a command in there?
> >>
> > Automake should provide a recipe to the `check' target iff the
> > `BUILT_SOURCES' variable is defined.
> 
> I see. Yes, we do define that variable, as you can see above in the
> Makefile.am in our VCS.
>
Yes, I've noticed that :-)

HTH,
  Stefano



reply via email to

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