header-vars: recognize more make flags ('-k' in particular)
[platform/upstream/automake.git] / lib / am / header-vars.am
index 5a90739..4ad1783 100644 (file)
@@ -1,5 +1,5 @@
 ## automake - create Makefile.in from Makefile.am
-## Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
+## 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
 ## 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, write to the Free Software
-## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-## 02111-1307, USA.
-SHELL = /bin/sh
+## along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
-srcdir = @srcdir@
-top_srcdir = @top_srcdir@
 VPATH = @srcdir@
-prefix = @prefix@
-exec_prefix = @exec_prefix@
 
-bindir = @bindir@
-sbindir = @sbindir@
-libexecdir = @libexecdir@
-datadir = @datadir@
-sysconfdir = @sysconfdir@
-sharedstatedir = @sharedstatedir@
-localstatedir = @localstatedir@
-libdir = @libdir@
-infodir = @infodir@
-mandir = @mandir@
-includedir = @includedir@
-oldincludedir = /usr/include
+@SET_MAKE@
+
+## We used to define this.  However, we don't because vendor makes
+## (e.g., Solaris, Irix) won't correctly propagate variables that are
+## defined in Makefile.  This particular variable can't be correctly
+## defined by configure (at least, not the current configure), so we
+## simply avoid defining it to allow the user to use this feature with
+## a vendor make.
+## DESTDIR =
+
+## Shell code that determines whether we are running under GNU make.
+## This is somewhat of an hack, and might be improved, but is good
+## enough for now.
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+
+## Shell code that determines whether the current make instance is
+## running with a given one-letter option (e.g., -k, -n) that takes
+## no argument.  Actually, the only supported option at the moment
+## is '-n' (support for '-k' will be added soon).
+am__make_running_with_option = \
+  { \
+    case $${am__target_option-} in \
+        ?) ;; \
+        *) 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, while the older variable
+## $(MFLAGS) behaves much better.  So use the latter.
+      for am__flg in $$MFLAGS; do \
+        case $$am__flg in \
+          *=*|--*) ;; \
+          -*$$am__target_option*) am__has_opt=yes; break;; \
+        esac; \
+      done; \
+    else \
+## Non-GNU make: we must rely on $(MAKEFLAGS).  This is tricker and more
+## brittle, but is the best we can do.
+      case $$MAKEFLAGS in \
+## If we run "make TESTS='snooze nap'", FreeBSD make will export MAKEFLAGS
+## 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 hack.
+         *\\[\ \       ]*) \
+## Extra indirection with ${am__bs} required by FreeBSD 8.x make.
+## Not sure why (so sorry for the cargo-cult programming here).
+           am__bs=\\; \
+           am__flags=`printf '%s\n' "$$MAKEFLAGS" \
+            | sed "s/$$am__bs$$am__bs[$$am__bs $$am__bs        ]*//g"`;; \
+         *) \
+           am__flags=$$MAKEFLAGS;; \
+      esac; \
+      am__skip_next=no; \
+      for am__flg in $$am__flags; do \
+        if test $$am__skip_next = yes; then \
+          am__skip_next=no; \
+          continue; \
+        fi; \
+        case $$am__flg in \
+          *=*|--*) ;; \
+## Quite ugly special-casing.  We might need other similar ones actually,
+## but let's wait until the need arises.
+          -I) am__skip_next=yes;; \
+          *$$am__target_option*) am__has_opt=yes; break;; \
+        esac; \
+      done;\
+    fi; \
+    unset am__skip_next am__flg am__flags am__target_option; \
+    test $$am__has_opt = yes; \
+  }
+
+## Shell code that determines whether make is running in "dry mode"
+## ("make -n") or not.  Useful in rules that invoke make recursively,
+## and are thus executed also with "make -n" -- either because they
+## are declared as dependencies to '.MAKE' (NetBSD make), or because
+## 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@
-pkglibdir = $(libdir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
 
-## Location of top build directory relative to this one.
-top_builddir = @top_builddir@
-
-ACLOCAL = @ACLOCAL@
-AUTOCONF = @AUTOCONF@
-AUTOMAKE = @AUTOMAKE@
-AUTOHEADER = @AUTOHEADER@
-
-INSTALL = @INSTALL@
-INSTALL_PROGRAM = @INSTALL_PROGRAM@
-INSTALL_DATA = @INSTALL_DATA@
-INSTALL_SCRIPT = @INSTALL_SCRIPT@
-transform = @program_transform_name@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
 
 ## These are defined because otherwise make on NetBSD V1.1 will print
 ## (eg): $(NORMAL_INSTALL) expands to empty string.
-NORMAL_INSTALL = true
-PRE_INSTALL = true
-POST_INSTALL = true
-NORMAL_UNINSTALL = true
-PRE_UNINSTALL = true
-POST_UNINSTALL = true
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+
+## dejagnu.am uses these variables.  Some users might rely on them too.
+?BUILD?build_triplet = @build@
+?HOST?host_triplet = @host@
+?TARGET?target_triplet = @target@