mirror of
https://github.com/mirror/make.git
synced 2025-02-26 03:45:41 +08:00
Enhancements to the documentation (fixes bugs #1772 and 4898).
Add "!" to the list of shell escape characters: POSIX sh allows it to be used to negate the return value of the command.
This commit is contained in:
parent
a35db90275
commit
2b3ee46f4e
@ -1,5 +1,12 @@
|
|||||||
2004-01-07 Paul D. Smith <psmith@gnu.org>
|
2004-01-07 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* doc/make.texi (Target-specific): Fix Savannah bug #1772.
|
||||||
|
(MAKE Variable): Fix Savannah bug #4898.
|
||||||
|
|
||||||
|
* job.c (construct_command_argv_internal): Add "!" to the list of
|
||||||
|
shell escape chars. POSIX sh allows it to appear before a
|
||||||
|
command, to negate the exit code. Fixes bug #6404.
|
||||||
|
|
||||||
* implicit.c (pattern_search): When matching an implicit rule,
|
* implicit.c (pattern_search): When matching an implicit rule,
|
||||||
remember which dependencies have the ignore_mtime flag set.
|
remember which dependencies have the ignore_mtime flag set.
|
||||||
Original fix provided in Savannah patch #2349, by Benoit
|
Original fix provided in Savannah patch #2349, by Benoit
|
||||||
|
@ -38,7 +38,8 @@ and issues the commands to recompile them.
|
|||||||
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
This is Edition @value{EDITION}, last updated @value{UPDATED},
|
||||||
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
of @cite{The GNU Make Manual}, for @code{make}, Version @value{VERSION}.
|
||||||
|
|
||||||
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2002, 2003
|
Copyright 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
|
||||||
|
1998, 1999, 2000, 2002, 2003, 2004
|
||||||
Free Software Foundation, Inc.
|
Free Software Foundation, Inc.
|
||||||
|
|
||||||
Permission is granted to copy, distribute and/or modify this document
|
Permission is granted to copy, distribute and/or modify this document
|
||||||
@ -57,11 +58,11 @@ Texts. A copy of the license is included in the section entitled
|
|||||||
@subtitle A Program for Directing Recompilation
|
@subtitle A Program for Directing Recompilation
|
||||||
@subtitle GNU @code{make} Version @value{VERSION}
|
@subtitle GNU @code{make} Version @value{VERSION}
|
||||||
@subtitle @value{UPDATE-MONTH}
|
@subtitle @value{UPDATE-MONTH}
|
||||||
@author Richard M. Stallman, Roland McGrath, Paul Smith
|
@author Richard M. Stallman, Roland McGrath, Paul D. Smith
|
||||||
@page
|
@page
|
||||||
@vskip 0pt plus 1filll
|
@vskip 0pt plus 1filll
|
||||||
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
Copyright @copyright{} 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
|
||||||
1996, 1997, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
|
1996, 1997, 1998, 1999, 2000, 2002, 2003, 2004 Free Software Foundation, Inc.
|
||||||
@sp 2
|
@sp 2
|
||||||
Published by the Free Software Foundation @*
|
Published by the Free Software Foundation @*
|
||||||
59 Temple Place -- Suite 330, @*
|
59 Temple Place -- Suite 330, @*
|
||||||
@ -350,7 +351,7 @@ The @code{make} utility automatically determines which pieces of a large
|
|||||||
program need to be recompiled, and issues commands to recompile them.
|
program need to be recompiled, and issues commands to recompile them.
|
||||||
This manual describes GNU @code{make}, which was implemented by Richard
|
This manual describes GNU @code{make}, which was implemented by Richard
|
||||||
Stallman and Roland McGrath. Development since Version 3.76 has been
|
Stallman and Roland McGrath. Development since Version 3.76 has been
|
||||||
handled by Paul Smith.
|
handled by Paul D. Smith.
|
||||||
|
|
||||||
GNU @code{make} conforms to section 6.2 of @cite{IEEE Standard
|
GNU @code{make} conforms to section 6.2 of @cite{IEEE Standard
|
||||||
1003.2-1992} (POSIX.2).
|
1003.2-1992} (POSIX.2).
|
||||||
@ -3675,7 +3676,11 @@ a rule alters the effects of the @samp{-t} (@samp{--touch}), @samp{-n}
|
|||||||
(@samp{--just-print}), or @samp{-q} (@w{@samp{--question}}) option.
|
(@samp{--just-print}), or @samp{-q} (@w{@samp{--question}}) option.
|
||||||
Using the @code{MAKE} variable has the same effect as using a @samp{+}
|
Using the @code{MAKE} variable has the same effect as using a @samp{+}
|
||||||
character at the beginning of the command line. @xref{Instead of
|
character at the beginning of the command line. @xref{Instead of
|
||||||
Execution, ,Instead of Executing the Commands}.@refill
|
Execution, ,Instead of Executing the Commands}. This special feature
|
||||||
|
is only enabled if the @code{MAKE} variable appears directly in the
|
||||||
|
command script: it does not apply if the @code{MAKE} variable is
|
||||||
|
referenced through expansion of another variable. In the latter case
|
||||||
|
you must use the @samp{+} token to get these special effects.@refill
|
||||||
|
|
||||||
Consider the command @samp{make -t} in the above example. (The
|
Consider the command @samp{make -t} in the above example. (The
|
||||||
@samp{-t} option marks targets as up to date without actually running
|
@samp{-t} option marks targets as up to date without actually running
|
||||||
@ -5225,10 +5230,11 @@ environment if the @samp{-e} option is in force) will take precedence.
|
|||||||
Specifying the @code{override} directive will allow the target-specific
|
Specifying the @code{override} directive will allow the target-specific
|
||||||
variable value to be preferred.
|
variable value to be preferred.
|
||||||
|
|
||||||
There is one more special feature of target-specific variables: when you
|
There is one more special feature of target-specific variables: when
|
||||||
define a target-specific variable, that variable value is also in effect
|
you define a target-specific variable that variable value is also in
|
||||||
for all prerequisites of this target (unless those prerequisites override
|
effect for all prerequisites of this target, and all their
|
||||||
it with their own target-specific variable value). So, for example, a
|
prerequisites, etc. (unless those prerequisites override that variable
|
||||||
|
with their own target-specific variable value). So, for example, a
|
||||||
statement like this:
|
statement like this:
|
||||||
|
|
||||||
@example
|
@example
|
||||||
@ -5240,7 +5246,16 @@ prog : prog.o foo.o bar.o
|
|||||||
will set @code{CFLAGS} to @samp{-g} in the command script for
|
will set @code{CFLAGS} to @samp{-g} in the command script for
|
||||||
@file{prog}, but it will also set @code{CFLAGS} to @samp{-g} in the
|
@file{prog}, but it will also set @code{CFLAGS} to @samp{-g} in the
|
||||||
command scripts that create @file{prog.o}, @file{foo.o}, and
|
command scripts that create @file{prog.o}, @file{foo.o}, and
|
||||||
@file{bar.o}, and any command scripts which create their prerequisites.
|
@file{bar.o}, and any command scripts which create their
|
||||||
|
prerequisites.
|
||||||
|
|
||||||
|
Be aware that a given prerequisite will only be built once per
|
||||||
|
invocation of make, at most. If the same file is a prerequisite of
|
||||||
|
multiple targets, and each of those targets has a different value for
|
||||||
|
the same target-specific variable, then the first target to be built
|
||||||
|
will cause that prerequisite to be built and the prerequisite will
|
||||||
|
inherit the target-specific value from the first target. It will
|
||||||
|
ignore the target-specific values from any other targets.
|
||||||
|
|
||||||
@node Pattern-specific, , Target-specific, Using Variables
|
@node Pattern-specific, , Target-specific, Using Variables
|
||||||
@section Pattern-specific Variable Values
|
@section Pattern-specific Variable Values
|
||||||
|
@ -103,7 +103,7 @@ pattern_search (struct file *file, int archive,
|
|||||||
|
|
||||||
/* This buffer records all the dependencies actually found for a rule. */
|
/* This buffer records all the dependencies actually found for a rule. */
|
||||||
char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *));
|
char **found_files = (char **) alloca (max_pattern_deps * sizeof (char *));
|
||||||
/* This list notes if the associated dep has an "ignore_mtime" flag set. */
|
/* Remember whether the associated dep has an "ignore_mtime" flag set. */
|
||||||
unsigned char *found_files_im = (unsigned char *) alloca (max_pattern_deps * sizeof (unsigned char));
|
unsigned char *found_files_im = (unsigned char *) alloca (max_pattern_deps * sizeof (unsigned char));
|
||||||
/* Number of dep names now in FOUND_FILES. */
|
/* Number of dep names now in FOUND_FILES. */
|
||||||
unsigned int deps_found = 0;
|
unsigned int deps_found = 0;
|
||||||
|
13
job.c
13
job.c
@ -358,13 +358,12 @@ vms_redirect (struct dsc$descriptor_s *desc, char *fname, char *ibuf)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/* found apostrophe at (p-1)
|
||||||
found apostrophe at (p-1)
|
inc p until after closing apostrophe.
|
||||||
|
*/
|
||||||
inc p until after closing apostrophe. */
|
|
||||||
|
|
||||||
static char *
|
static char *
|
||||||
handle_apos (char *p)
|
vms_handle_apos (char *p)
|
||||||
{
|
{
|
||||||
int alast;
|
int alast;
|
||||||
int inside;
|
int inside;
|
||||||
@ -2160,7 +2159,7 @@ child_execute_job (char *argv, struct child *child)
|
|||||||
/* Nice places for line breaks are after strings, after
|
/* Nice places for line breaks are after strings, after
|
||||||
comma or space and before slash. */
|
comma or space and before slash. */
|
||||||
case '"':
|
case '"':
|
||||||
q = handle_apos (q + 1);
|
q = vms_handle_apos (q + 1);
|
||||||
sep = q;
|
sep = q;
|
||||||
break;
|
break;
|
||||||
case ',':
|
case ',':
|
||||||
@ -2695,7 +2694,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
|||||||
char* sh_chars;
|
char* sh_chars;
|
||||||
char** sh_cmds;
|
char** sh_cmds;
|
||||||
#else /* must be UNIX-ish */
|
#else /* must be UNIX-ish */
|
||||||
static char sh_chars[] = "#;\"*?[]&|<>(){}$`^~";
|
static char sh_chars[] = "#;\"*?[]&|<>(){}$`^~!";
|
||||||
static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login",
|
static char *sh_cmds[] = { "cd", "eval", "exec", "exit", "login",
|
||||||
"logout", "set", "umask", "wait", "while", "for",
|
"logout", "set", "umask", "wait", "while", "for",
|
||||||
"case", "if", ":", ".", "break", "continue",
|
"case", "if", ":", ".", "break", "continue",
|
||||||
|
Loading…
Reference in New Issue
Block a user