make flags analysis: use simpler variable names
[platform/upstream/automake.git] / lib / am / header-vars.am
1 ## automake - create Makefile.in from Makefile.am
2 ## Copyright (C) 1994-2013 Free Software Foundation, Inc.
3
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2, or (at your option)
7 ## any later version.
8
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 ## GNU General Public License for more details.
13
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program.  If not, see <http://www.gnu.org/licenses/>.
16
17 VPATH = @srcdir@
18
19 @SET_MAKE@
20
21 ## We used to define this.  However, we don't because vendor makes
22 ## (e.g., Solaris, Irix) won't correctly propagate variables that are
23 ## defined in Makefile.  This particular variable can't be correctly
24 ## defined by configure (at least, not the current configure), so we
25 ## simply avoid defining it to allow the user to use this feature with
26 ## a vendor make.
27 ## DESTDIR =
28
29 ## Shell code that determines whether we are running under GNU make.
30 ## This is somewhat of an hack, and might be improved, but is good
31 ## enough for now.
32 am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
33
34 ## Shell code that determines whether the current make instance is
35 ## running with a given one-letter option (e.g., -k, -n) that takes
36 ## no argument.  Actually, the only supported option at the moment
37 ## is '-n' (support for '-k' will be added soon).
38 am__make_running_with_option = \
39   case $${target_option-} in \
40       ?) ;; \
41       *) echo "am__make_running_with_option: internal error: invalid" \
42               "target option '$${target_option-}' specified" >&2; \
43          exit 1;; \
44   esac; \
45   has_opt=no; \
46   sane_makeflags=$$MAKEFLAGS; \
47   if $(am__is_gnu_make); then \
48 ## The format of $(MAKEFLAGS) is quite tricky with GNU make; the
49 ## variable $(MFLAGS) behaves much better in that regard.  So use it.
50     sane_makeflags=$$MFLAGS; \
51   else \
52 ## Non-GNU make: we must rely on $(MAKEFLAGS).  This is tricker and more
53 ## brittle, but is the best we can do.
54     case $$MAKEFLAGS in \
55 ## If we run "make TESTS='snooze nap'", FreeBSD make will export MAKEFLAGS
56 ## to " TESTS=foo\ nap", so that the simpler loop below (on word-splitted
57 ## $$MAKEFLAGS) would see a "make flag" equal to "nap", and would wrongly
58 ## misinterpret that as and indication that make is running in dry mode.
59 ## This has already happened in practice.  So we need this hack.
60       *\\[\ \   ]*) \
61 ## Extra indirection with ${bs} required by FreeBSD 8.x make.
62 ## Not sure why (so sorry for the cargo-cult programming here).
63         bs=\\; \
64         sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
65           | sed "s/$$bs$$bs[$$bs $$bs   ]*//g"`;; \
66     esac; \
67   fi; \
68   skip_next=no; \
69   strip_trailopt () \
70   { \
71     flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
72   }; \
73   for flg in $$sane_makeflags; do \
74     test $$skip_next = yes && { skip_next=no; continue; }; \
75     case $$flg in \
76       *=*|--*) continue;; \
77 ## GNU make 3.83 has changed the format of $MFLAGS, and removed the space
78 ## between an option and its argument (e.g., from "-I dir" to "-Idir").
79 ## So we need to handle both formats.
80 ## TODO: we might need to handle similar other cases as well; but let's
81 ##       wait until the need arises.
82         -*I) strip_trailopt 'I'; skip_next=yes;; \
83       -*I?*) strip_trailopt 'I';; \
84     esac; \
85     case $$flg in \
86       *$$target_option*) has_opt=yes; break;; \
87     esac; \
88   done; \
89   test $$has_opt = yes
90
91 ## Shell code that determines whether make is running in "dry mode"
92 ## ("make -n") or not.  Useful in rules that invoke make recursively,
93 ## and are thus executed also with "make -n" -- either because they
94 ## are declared as dependencies to '.MAKE' (NetBSD make), or because
95 ## their recipes contain the "$(MAKE)" string (GNU and Solaris make).
96 am__make_dryrun = (target_option=n; $(am__make_running_with_option))
97
98 ## Shell code that determines whether make is running in "keep-going mode"
99 ## ("make -k") or not.  Useful in rules that must recursively descend into
100 ## subdirectories, and decide whther to stop at the first error or not.
101 am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
102
103 ## Some derived variables that have been found to be useful.
104 pkgdatadir = $(datadir)/@PACKAGE@
105 pkgincludedir = $(includedir)/@PACKAGE@
106 pkglibdir = $(libdir)/@PACKAGE@
107 pkglibexecdir = $(libexecdir)/@PACKAGE@
108
109 am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
110 install_sh_DATA = $(install_sh) -c -m 644
111 install_sh_PROGRAM = $(install_sh) -c
112 install_sh_SCRIPT = $(install_sh) -c
113 INSTALL_HEADER = $(INSTALL_DATA)
114 transform = $(program_transform_name)
115
116 ## These are defined because otherwise make on NetBSD V1.1 will print
117 ## (eg): $(NORMAL_INSTALL) expands to empty string.
118 NORMAL_INSTALL = :
119 PRE_INSTALL = :
120 POST_INSTALL = :
121 NORMAL_UNINSTALL = :
122 PRE_UNINSTALL = :
123 POST_UNINSTALL = :
124
125 ## dejagnu.am uses these variables.  Some users might rely on them too.
126 ?BUILD?build_triplet = @build@
127 ?HOST?host_triplet = @host@
128 ?TARGET?target_triplet = @target@