Edit

kc3-lang/automake/lib/am/subdirs.am

Branch :

  • Show log

    Commit

  • Author : Stefano Lattarini
    Date : 2013-04-29 16:12:34
    Hash : 02ead48e
    Message : subdirs: don't return false positives for the '-k' option's presence This change fixes automake bug#12554. The old implementation of the code descending into $(SUBDIRS) entries used the following snippet to decide whether make is running with the '-k' a.k.a. '--keep-going' option, and thus whether a failure in a subdirectory should prevent the descent in the following ones: fail= failcom='exit 1'; \ for f in x $$MAKEFLAGS; do \ case $$f in \ *=* | --[!k]*);; \ *k*) failcom='fail=yes';; \ esac; \ done It's clear that the second pattern in the 'case' construct could possibly match false positives, for examples in these two cases: make check TESTS="x.test k.test" make -I /usr/local/kool-fragments which are somewhat unusual, but not invalid. So we need a more resilient implementation, as we did for the detection of the '-n' flag. This implementation is now provided by the new private macro '$(am__make_keepgoing)' (introduced in recent commits); so we can just us that to fix the bug. * lib/am/subdirs.am ($(am__recursive_targets)): Use '$(am__make_keepgoing)' instead of ad-hoc and more brittle checks. * t/list-of-tests.mk (XFAIL_TESTS): Remove the now-passing test case 't/subdir-keep-going-pr12554.sh'. Reported-by: Michael Daniels <mdaniels@rim.com> Signed-off-by: Stefano Lattarini <stefano.lattarini@gmail.com>

  • lib/am/subdirs.am
  • ## automake - create Makefile.in from Makefile.am
    ## Copyright (C) 1994-2013 Free Software Foundation, Inc.
    
    ## This program is free software; you can redistribute it and/or modify
    ## it under the terms of the GNU General Public License as published by
    ## the Free Software Foundation; either version 2, or (at your option)
    ## any later version.
    
    ## This program is distributed in the hope that it will be useful,
    ## but WITHOUT ANY WARRANTY; without even the implied warranty of
    ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    ## GNU General Public License for more details.
    
    ## You should have received a copy of the GNU General Public License
    ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
    
    RECURSIVE_TARGETS += all-recursive check-recursive installcheck-recursive
    RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
      distclean-recursive maintainer-clean-recursive
    
    am__recursive_targets = \
      $(RECURSIVE_TARGETS) \
      $(RECURSIVE_CLEAN_TARGETS) \
      $(am__extra_recursive_targets)
    
    ## All documented targets which invoke 'make' recursively, or depend
    ## on targets that do so.  GNUmakefile from gnulib depends on this.
    AM_RECURSIVE_TARGETS += $(am__recursive_targets:-recursive=)
    
    .PHONY .MAKE: $(am__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.
    
    $(am__recursive_targets):
    ## Using $failcom allows "-k" to keep its natural meaning when running a
    ## recursive rule.
    	@fail=; \
    	if $(am__make_keepgoing); then \
    	  failcom='fail=yes'; \
    	else \
    	  failcom='exit 1'; \
    	fi; \
    	dot_seen=no; \
    	target=`echo $@ | sed s/-recursive//`; \
    ## For distclean and maintainer-clean we make sure to use the full
    ## list of subdirectories.  We do this so that 'configure; make
    ## distclean' really is a no-op, even if SUBDIRS is conditional.
    	case "$@" in \
    	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
    	  *) list='$(SUBDIRS)' ;; \
    	esac; \
    	for subdir in $$list; do \
    	  echo "Making $$target in $$subdir"; \
    	  if test "$$subdir" = "."; then \
    	    dot_seen=yes; \
    	    local_target="$$target-am"; \
    	  else \
    	    local_target="$$target"; \
    	  fi; \
    	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
    	  || eval $$failcom; \
    	done; \
    	if test "$$dot_seen" = "no"; then \
    	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
    	fi; test -z "$$fail"
    
    mostlyclean: mostlyclean-recursive
    clean: clean-recursive
    distclean: distclean-recursive
    maintainer-clean: maintainer-clean-recursive