bug-automake
[Top][All Lists]
Advanced

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

bug#19961: check-local is kind of like check-hook


From: Peter Johansson
Subject: bug#19961: check-local is kind of like check-hook
Date: Mon, 02 Mar 2015 09:18:25 +1000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.8.0

On 02/28/2015 02:07 AM, Shahbaz Youssefi wrote:
Hi,

The -local and -hook targets are generally used like this:

X: X-local
     # stuff to do X
     $(MAKE) X-hook

That is, X-local is run first, then the automake generated rules do X
and then X-hook is called.

With check-local, the generated Makefile.in looks like this:

check-am: all-am
     $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local

Now as far as the documentation is concerned, this is valid:

With the -local targets, there is no particular guarantee of execution order; 
typically, they are run early, but with parallel make, there is no way to be 
sure of that.
However, even with not-parallel make, check-local executes after the tests.

To align this with the other -local rules, why not generate it like this?

check-am: all-am check-local
     $(MAKE) $(AM_MAKEFLAGS) check-TESTS

I think it would be a mistake to change this rule. Some projects might rely on the fact that 'check-local' depends on 'all-am' and 'check-local' might e.g. run some of the programs built within 'all-am'.



The reason I actually have a problem with the current method is that
it is impossible to perform an action before the check. In my
particular case, my test scripts use test kernel modules. Of course,
automake doesn't have a target like check_KERNELMODULE for example to
automatically build the kernel module before running the tests. So
ideally what I could do is to build the kernel module in check-local.
The way the Makefile.in's are currently generated, this is impossible.

In my case, I had to use all-local to build the test kernel modules,
even if the user is not interested in make check, which is annoying in
the least.

With my Automake the rule looks like:

check-am: all-am
    $(MAKE) $(AM_MAKEFLAGS) $(check_SCRIPTS) $(check_DATA)
    $(MAKE) $(AM_MAKEFLAGS) check-TESTS check-local

so you could move your check_kernelmodule into check_DATA with something like (untested)

check_DATA = kernelmodule.timestamp

kernelmodule.timestamp:
    @echo "*******************************************"
    @echo "*******************************************"
    @echo "I want this to be called before the check"
    @echo "*******************************************"
    @echo "*******************************************"





Cheers,
Peter

--
Peter Johansson






reply via email to

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