[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How make interprets MAKEFLAGS?(2)
From: |
Philip Guenther |
Subject: |
Re: How make interprets MAKEFLAGS?(2) |
Date: |
Mon, 7 Feb 2011 05:48:40 -0800 |
On Mon, Feb 7, 2011 at 4:45 AM, Paul Smith <address@hidden> wrote:
...
> The other example begin with a single dash; a single dash introduces a
> string consisting of one or more single-letter options, so make
> interprets it as "-i -g -n -o -e -e -r -r -o -r -s -u -u -z -z -z".
Not quite: as soon as an option is encountered that takes an option
argument, then if there's anything left to the current command
argument then it is taken as the option argument. Since the -o option
to GNU make takes an argument, -ignore-errorsuuzzz is parsed as if it
was written
-i -g -n -o re-errorsuuzzz
That's why the -s option wasn't set.
(For those who wonder why the -g and -o options aren't appearing in
the MAKEFLAGS passed to the child, go read that paragraph in the info
pages again:
When `make' interprets the value of `MAKEFLAGS' (either from the
environment or from a makefile), it first prepends a hyphen if the value
does not already begin with one. Then it chops the value into words
separated by blanks, and parses these words as if they were options
given on the command line (except that `-C', `-f', `-h', `-o', `-W',
and their long-named versions are ignored; and there is no error for an
invalid option).
-o is intentionally ignored, while -g is an invalid option and
therefore silently ignored.)
Philip Guenther