header-vars: recognize more make flags ('-k' in particular)
[platform/upstream/automake.git] / lib / am / header-vars.am
index c0a5f0c..4ad1783 100644 (file)
@@ -38,15 +38,15 @@ am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
 am__make_running_with_option = \
   { \
     case $${am__target_option-} in \
-        n) ;; \
+        ?) ;; \
         *) echo "am__make_running_with_option: internal error: invalid" \
                 "target option '$${am__target_option-}' specified" >&2; \
            exit 1;; \
     esac; \
     am__has_opt=no; \
     if $(am__is_gnu_make); then \
-## GNU make: $(MAKEFLAGS) is quite tricky there, and the older
-## $(MFLAGS) variable behaves much better.
+## GNU make: $(MAKEFLAGS) is quite tricky there, while the older variable
+## $(MFLAGS) behaves much better.  So use the latter.
       for am__flg in $$MFLAGS; do \
         case $$am__flg in \
           *=*|--*) ;; \
@@ -61,7 +61,7 @@ am__make_running_with_option = \
 ## to " TESTS=foo\ nap", so that the simpler loop below (on word-splitted
 ## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly
 ## misinterpret that as and indication that make is running in dry mode.
-## This has already happened in practice.  So we need this unpleasant hack.
+## This has already happened in practice.  So we need this hack.
          *\\[\ \       ]*) \
 ## Extra indirection with ${am__bs} required by FreeBSD 8.x make.
 ## Not sure why (so sorry for the cargo-cult programming here).
@@ -97,6 +97,11 @@ am__make_running_with_option = \
 ## their recipes contain the "$(MAKE)" string (GNU and Solaris make).
 am__make_dryrun = { am__target_option=n; $(am__make_running_with_option); }
 
+## Shell code that determines whether make is running in "keep-going mode"
+## ("make -k") or not.  Useful in rules that must recursively descend into
+## subdirectories, and decide whther to stop at the first error or not.
+am__make_keepgoing = { am__target_option=k; $(am__make_running_with_option); }
+
 ## Some derived variables that have been found to be useful.
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@