automake
[Top][All Lists]
Advanced

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

Possible bug in check-local


From: John Calcote
Subject: Possible bug in check-local
Date: Mon, 16 Jun 2008 13:15:15 -0600
User-agent: Thunderbird 2.0.0.12 (X11/20080226)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi list,

I think I've found a defect in check-local functionality. I was trying
to implement an extension to Automake wherein CSharp (Mono) sources
could be built using a Makefile.am file. Here's a simplified version of
my Makefile.am file:

- -----------------
xfcs_sources = ...
cstest_sources = ...

CLEANFILES = xfcs.dll xfcs.xml cstest_script cstest.exe

TESTS = cstest_script

all-local: xfcs.dll

check-local: cstest.exe cstest_script

xfcs.dll: $(xfcs_sources)
        ...

cstest.exe: xfcs.dll $(cstest_sources)
        ...

cstest_script:
        echo "#!/bin/sh" > cstest_script
        echo "mono cstest.exe" >> cstest_script
        chmod 0755 cstest_script

- -----------------

The problem here is that the generated Makefile tries to execute the
test script (cstest_script) BEFORE building the check-local targets.
Here's the relevant section of the generated Makefile:

- -----------------
check-TESTS: $(TESTS)
        ... (run all $(TESTS), etc)

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

check: check-am
- -----------------

As you can see from this snippet, check depends on check-am, which
depends on all-am, but NOT on check-local. Once all non-check targets
are built, then the command for check-am recursively calls $(MAKE). The
problem, as I see it, is that it tries to target check-TESTS first, and
THEN check-local.

Now, since the very definition of the check target (and by implication,
the check-local target) is to build tests required for TESTS, it seems
that either the order should be reversed in the sub-make targets, (eg.,
$(MAKE) ... check-local check-TESTS), or check-local should be a
dependency of check-am (after all-am, of course).

I can work around my problem by either building my local checks in
all-local and then simply not installing them, or by making my check
executable a dependency of the cstest_script target. But both of these
seem wrong to me. Should check-local be built before TESTS are built and
executed?

Thoughts?

John
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4-svn0 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iD8DBQFIVrvDdcgqmRY/OH8RAmTPAJ9y8KAUaSXhiVNPdNwsecY4VfloKQCdFU62
fd5R3cepYWfzK6Ugzs1GIm4=
=F/W9
-----END PGP SIGNATURE-----




reply via email to

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