[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#12554: Checking MAKEFLAGS with RECURSIVE_TARGETS
From: |
Stefano Lattarini |
Subject: |
bug#12554: Checking MAKEFLAGS with RECURSIVE_TARGETS |
Date: |
Mon, 29 Apr 2013 19:40:19 +0200 |
severity 12554 minor
tags 12554 + patch
thanks
On 10/01/2012 11:52 PM, Michael Daniels wrote:
> Hello,
>
Hi Michael, sorry for the delay.
> 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
>
I've prepared a patch series that appears to fix the issue. I will post it
here soon. Testing and feedback is appreciated. Barring objections, I'm
going to push the series to the branch-1.13.2 in a couple of days.
Thanks,
Stefano
- bug#12554: Checking MAKEFLAGS with RECURSIVE_TARGETS,
Stefano Lattarini <=
- bug#14309: [PATCH 0/7][PATCH 0/7] Fix automake bug#12554., Stefano Lattarini, 2013/04/29
- bug#14310: [PATCH 3/7] tests: remove dead code from t/make-dryrun.tap, Stefano Lattarini, 2013/04/29
- bug#14314: [PATCH 7/7] tests: avoid a spurious error with Solaris make, Stefano Lattarini, 2013/04/29
- bug#14312: [PATCH 1/7] tests: expose bug#12554 (false positives for presence of '-k' make option), Stefano Lattarini, 2013/04/29
- bug#14313: [PATCH 4/7] header-vars: simplify how make flags are determined, Stefano Lattarini, 2013/04/29
- bug#14316: [PATCH 6/7] subdirs: don't return false positives for the '-k' option's presence, Stefano Lattarini, 2013/04/29
- bug#12554: [PATCH 2/7] header-vars: new variable $(am__running_with_option), Stefano Lattarini, 2013/04/29
- bug#14315: [PATCH 5/7] header-vars: recognize more make flags ('-k' in particular), Stefano Lattarini, 2013/04/29