bug-automake
[Top][All Lists]
Advanced

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

bug#12554: Checking MAKEFLAGS with RECURSIVE_TARGETS


From: Michael Daniels
Subject: bug#12554: Checking MAKEFLAGS with RECURSIVE_TARGETS
Date: Mon, 1 Oct 2012 21:52:36 +0000

Hello,

automake 1.11.3
make 3.81
Linux 3.2.0-23-generic x86_64

Just to get some initial context, automake is generating this code for 
recursive targets:

# This directory's subdirectories are mostly independent; you can cd
# into them and run `make' without going through this Makefile.
# To change the values of `make' variables: instead of editing Makefiles,
# (1) if the variable is set in `config.status', edit `config.status'
#     (which will cause the Makefiles to be regenerated when you run `make');
# (2) otherwise, pass the desired values on the `make' command line.
$(RECURSIVE_TARGETS):
    @fail= failcom='exit 1'; \
    for f in x $$MAKEFLAGS; do \
      case $$f in \
        *=* | --[!k]*);; \
        *k*) failcom='fail=yes';; \
      esac; \
    done; \
    dot_seen=no; \
    target=`echo $@ | sed s/-recursive//`; \
    .. and so on

Today I happened to set the environment variable MAKEFLAGS=-I/some/path/with/k/ 
and this was causing it to hit the *k* case unexpectedly due to the k in the 
include path. The only side effect was that when something fails to build, it 
zips past the terminal very quickly as it continues on making the other 
subdir's, very minor. The following makefile can be used to reproduce the 
behaviour:

$ cat Makefile
all:
    @echo MAKEFLAGS = $(MAKEFLAGS)
$ make -k -s
MAKEFLAGS = sk
$ make -k -s -I.
MAKEFLAGS = skI .
$ make -k -s -I. -I/some/path/with/k/
MAKEFLAGS = skI . -I /some/path/with/k/
$ make -s -I. -I/some/path/with/k/
MAKEFLAGS = sI . -I /some/path/with/k/
$ make -s -I. -I/some/path/with/k/ -j2
MAKEFLAGS = s --jobserver-fds=3,4 -j -I . -I /some/path/with/k/
$

So because the path is parsed in the loop, it is always matching *k*. The 
MAKEFLAGS behaviour is described in the manual here: 
http://www.gnu.org/software/make/manual/html_node/Options_002fRecursion.html.

Unfortunately I do not know enough about these tools to suggest a proper fix, 
but to make things worse the behaviour does not seem to be uniform across 
platforms; http://www.hep.by/gnu/autoconf/The-Make-Macro-MAKEFLAGS.html

Thanks,

Mike


---------------------------------------------------------------------
This transmission (including any attachments) may contain confidential 
information, privileged material (including material protected by the 
solicitor-client or other applicable privileges), or constitute non-public 
information. Any use of this information by anyone other than the intended 
recipient is prohibited. If you have received this transmission in error, 
please immediately reply to the sender and delete this information from your 
system. Use, dissemination, distribution, or reproduction of this transmission 
by unintended recipients is not authorized and may be unlawful.





reply via email to

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