mirror of
https://github.com/mirror/make.git
synced 2025-01-27 04:40:33 +08:00
New special variable: .RECIPEPREFIX
Allows the user to reset the prefix character for introducing recipe lines from the default (tab) to any other single character, and back again. Also, reworked the manual to consistently use the word "recipe" to describe the set of commands we use to update a target, instead of the various phrases used in the past: "commands", "command lines", "command scripts", etc.
This commit is contained in:
parent
c1f71b0336
commit
43d81ff866
49
ChangeLog
49
ChangeLog
@ -1,3 +1,11 @@
|
||||
2007-11-04 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* doc/make.texi: Convert references to "commands", "command
|
||||
lines", and "command script" to "recipe".
|
||||
* NEWS: Ditto.
|
||||
* commands.c, file.c, job.c, remake.c, read.c, variable.c, main.c:
|
||||
Ditto.
|
||||
|
||||
2007-10-12 Eli Zaretskii <eliz@gnu.org>
|
||||
|
||||
* variable.c (do_variable_definition): Allow $(SHELL) to expand to
|
||||
@ -21,6 +29,47 @@
|
||||
* w32/pathstuff.c (convert_Path_to_windows32): Handle quoted
|
||||
directories in Path.
|
||||
|
||||
2007-09-12 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* doc/make.texi: Applied wording cleanups from Savannah patch #6195.
|
||||
Provided by Diego Biurrun <diego@biurrun.de>
|
||||
(Complex Makefile): Remove .PHONY setting for tar: patch #6196.
|
||||
Provided by Diego Biurrun <diego@biurrun.de>
|
||||
|
||||
2007-09-11 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* doc/make.texi (Special Variables): Moved this into the "How to
|
||||
Use Variables" chapter. Added a table entry for .RECIPEPREFIX.
|
||||
(MAKEFILE_LIST) No longer a section; this was added into the
|
||||
"Special Variables" section.
|
||||
(Rule Introduction): Reference .RECIPEPREFIX.
|
||||
(Simple Makefile): Ditto.
|
||||
(Rule Syntax): Ditto.
|
||||
(Command Syntax): Ditto.
|
||||
(Error Messages): Ditto.
|
||||
|
||||
2007-09-10 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* commands.c (print_commands): Don't print an extra line in the
|
||||
command scripts. Prefix the command scripts with cmd_prefix, not \t.
|
||||
|
||||
* read.c (construct_include_path): Add the full string to the cache; we
|
||||
were chopping the last char.
|
||||
|
||||
* NEWS: Announce the .RECIPEPREFIX special variable.
|
||||
* variable.c (lookup_special_var): Rename from handle_special_var().
|
||||
(lookup_variable): Call the new name.
|
||||
(set_special_var): New function: handle setting of special variables.
|
||||
When setting .RECIPEPREFIX, reset the cmd_prefix global variable.
|
||||
(do_variable_definition): Call it.
|
||||
* make.h (RECIPEPREFIX_DEFAULT): Define the default command prefix char.
|
||||
(RECIPEPREFIX_NAME): Define the command prefix special variable name.
|
||||
* main.c (main): Create the .RECIPEPREFIX special variable.
|
||||
* read.c (eval): Remove the cmd_prefix characters from the command
|
||||
scripts here, so they're not stored in the commands array at all,
|
||||
rather than waiting and stripping them out during command construction.
|
||||
* job.c (construct_command_argv_internal): Don't skip cmd_prefix here.
|
||||
|
||||
2007-08-15 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* doc/make.texi (GNU Free Documentation License): The fdl.texi
|
||||
|
200
NEWS
200
NEWS
@ -14,6 +14,13 @@ Version 3.81.90
|
||||
* Compiling GNU make now requires a conforming ISO C 1989 compiler and
|
||||
standard runtime library.
|
||||
|
||||
* New special variable: .RECIPEPREFIX allows you to reset the recipe
|
||||
introduction character from the default (TAB) to something else. The
|
||||
first character of this variable value is the new recipe introduction
|
||||
character. If the variable is set to the empty string, TAB is used
|
||||
again. It can be set and reset at will; rules will be parsed
|
||||
according to the current value.
|
||||
|
||||
|
||||
Version 3.81
|
||||
|
||||
@ -50,13 +57,14 @@ Version 3.81
|
||||
of this SysV feature you will need to update them.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
|
||||
In order to comply with POSIX, the way in which GNU make processes
|
||||
backslash-newline sequences in command strings has changed. If your
|
||||
makefiles use backslash-newline sequences inside of single-quoted
|
||||
strings in command scripts you will be impacted by this change. See
|
||||
the GNU make manual subsection "Splitting Command Lines" (node
|
||||
"Splitting Lines"), in section "Command Syntax", chapter "Writing the
|
||||
Commands in Rules", for details.
|
||||
backslash-newline sequences in recipes has changed. If your makefiles
|
||||
use backslash-newline sequences inside of single-quoted strings in
|
||||
recipes you will be impacted by this change. See the GNU make manual
|
||||
subsection "Splitting Recipe Lines" (node "Splitting Lines"), in
|
||||
section "Recipe Syntax", chapter "Writing Recipe in Rules", for
|
||||
details.
|
||||
|
||||
* WARNING: Backward-incompatibility!
|
||||
Some previous versions of GNU make had a bug where "#" in a function
|
||||
@ -65,7 +73,7 @@ Version 3.81
|
||||
fixed: if your makefile uses "\#" in a function invocation the
|
||||
backslash is now preserved, so you'll need to remove it.
|
||||
|
||||
* New command-line option: -L (--check-symlink-times). On systems that
|
||||
* New command line option: -L (--check-symlink-times). On systems that
|
||||
support symbolic links, if this option is given then GNU make will
|
||||
use the most recent modification time of any symbolic links that are
|
||||
used to resolve target files. The default behavior remains as it
|
||||
@ -126,7 +134,7 @@ Version 3.81
|
||||
argument if all arguments are true.
|
||||
|
||||
* Changes made for POSIX compatibility:
|
||||
- Only touch targets (under -t) if they have at least one command.
|
||||
- Only touch targets (under -t) if they have a recipe.
|
||||
- Setting the SHELL make variable does NOT change the value of the
|
||||
SHELL environment variable given to programs invoked by make. As
|
||||
an enhancement to POSIX, if you export the make variable SHELL then
|
||||
@ -199,7 +207,7 @@ Version 3.80
|
||||
expanded it returns a complete list of variable names defined by all
|
||||
makefiles at that moment.
|
||||
|
||||
* A new command-line option is defined, -B or --always-make. If
|
||||
* A new command line option is defined, -B or --always-make. If
|
||||
specified GNU make will consider all targets out-of-date even if they
|
||||
would otherwise not be.
|
||||
|
||||
@ -480,7 +488,7 @@ Version 3.72
|
||||
|
||||
* The `MAKEFLAGS' variable (in the environment or in a makefile) can now
|
||||
contain variable definitions itself; these are treated just like
|
||||
command-line variable definitions. Make will automatically insert any
|
||||
command line variable definitions. Make will automatically insert any
|
||||
variable definitions from the environment value of `MAKEFLAGS' or from
|
||||
the command line, into the `MAKEFLAGS' value exported to children. The
|
||||
`MAKEOVERRIDES' variable previously included in the value of `$(MAKE)'
|
||||
@ -489,8 +497,8 @@ Version 3.72
|
||||
in the environment when its size is limited.
|
||||
|
||||
* If `.DELETE_ON_ERROR' appears as a target, Make will delete the target of
|
||||
a rule if it has changed when its commands exit with a nonzero status,
|
||||
just as when the commands get a signal.
|
||||
a rule if it has changed when its recipe exits with a nonzero status,
|
||||
just as when the recipe gets a signal.
|
||||
|
||||
* The automatic variable `$+' is new. It lists all the dependencies like
|
||||
`$^', but preserves duplicates listed in the makefile. This is useful
|
||||
@ -500,9 +508,9 @@ Version 3.72
|
||||
* You can now specify the `.IGNORE' and `.SILENT' special targets with
|
||||
dependencies to limit their effects to those files. If a file appears as
|
||||
a dependency of `.IGNORE', then errors will be ignored while running the
|
||||
commands to update that file. Likewise if a file appears as a dependency
|
||||
of `.SILENT', then the commands to update that file will not be printed
|
||||
before they are run. (This change was made to conform to POSIX.2.)
|
||||
recipe to update that file. Likewise if a file appears as a dependency
|
||||
of `.SILENT', then the recipe to update that file will not be printed
|
||||
before it is run. (This change was made to conform to POSIX.2.)
|
||||
|
||||
Version 3.71
|
||||
|
||||
@ -550,22 +558,22 @@ Version 3.69
|
||||
Make, and a string describing the remote job support compiled in (if any).
|
||||
Thus the value (in this release) is something like `3.69' or `3.69-Customs'.
|
||||
|
||||
* Commands in an invocation of the `shell' function are no longer run with
|
||||
a modified environment like target commands are. As in versions before
|
||||
* Commands in an invocation of the `shell' function are no longer run
|
||||
with a modified environment like recipes are. As in versions before
|
||||
3.68, they now run with the environment that `make' started with. We
|
||||
have reversed the change made in version 3.68 because it turned out to
|
||||
cause a paradoxical situation in cases like:
|
||||
|
||||
export variable = $(shell echo value)
|
||||
|
||||
When Make attempted to put this variable in the environment for a target
|
||||
command, it would try expand the value by running the shell command
|
||||
When Make attempted to put this variable in the environment for a
|
||||
recipe, it would try expand the value by running the shell command
|
||||
`echo value'. In version 3.68, because it constructed an environment
|
||||
for that shell command in the same way, Make would begin to go into an
|
||||
infinite loop and then get a fatal error when it detected the loop.
|
||||
|
||||
* The commands given for `.DEFAULT' are now used for phony targets with no
|
||||
commands.
|
||||
* The recipe given for `.DEFAULT' is now used for phony targets with no
|
||||
recipe.
|
||||
|
||||
Version 3.68
|
||||
|
||||
@ -589,8 +597,8 @@ Version 3.68
|
||||
no error (not even a warning) for a nonexistent makefile.
|
||||
|
||||
* Commands in an invocation of the `shell' function are now run with a
|
||||
modified environment like target commands are, so you can use `export' et
|
||||
al to set up variables for them. They used to run with the environment
|
||||
modified environment like recipes are, so you can use `export' et al
|
||||
to set up variables for them. They used to run with the environment
|
||||
that `make' started with.
|
||||
|
||||
Version 3.66
|
||||
@ -634,8 +642,8 @@ Version 3.63
|
||||
change directory, and recursive use of Make, now set `-w' automatically.
|
||||
|
||||
* Multiple double-colon rules for the same target will no longer have their
|
||||
commands run simultaneously under -j, as this could result in the two
|
||||
commands trying to change the file at the same time and interfering with
|
||||
recipes run simultaneously under -j, as this could result in the two
|
||||
recipes trying to change the file at the same time and interfering with
|
||||
one another.
|
||||
|
||||
* The `SHELL' variable is now never taken from the environment.
|
||||
@ -647,7 +655,7 @@ Version 3.63
|
||||
that tells you what all the options are and what they do. Try `make --help'.
|
||||
|
||||
* There are two new directives: `export' and `unexport'. All variables are
|
||||
no longer automatically put into the environments of the commands that
|
||||
no longer automatically put into the environments of the recipe lines that
|
||||
Make runs. Instead, only variables specified on the command line or in
|
||||
the environment are exported by default. To export others, use:
|
||||
export VARIABLE
|
||||
@ -662,8 +670,8 @@ Version 3.63
|
||||
to get the old behavior. See the node `Variables/Recursion' in the manual
|
||||
for a full description.
|
||||
|
||||
* The commands from the `.DEFAULT' special target are only applied to
|
||||
targets which have no rules at all, not all targets with no commands.
|
||||
* The recipe from the `.DEFAULT' special target is only applied to
|
||||
targets which have no rules at all, not all targets with no recipe.
|
||||
This change was made for compatibility with Unix make.
|
||||
|
||||
* All fatal error messages now contain `***', so they are easy to find in
|
||||
@ -715,8 +723,8 @@ Version 3.61
|
||||
* Built-in rules for C++ source files with the `.C' suffix.
|
||||
We still recommend that you use `.cc' instead.
|
||||
|
||||
* If commands are given too many times for a single target,
|
||||
the last set given is used, and a warning message is printed.
|
||||
* If a recipe is given too many times for a single target, the last one
|
||||
given is used, and a warning message is printed.
|
||||
|
||||
* Error messages about makefiles are in standard GNU error format,
|
||||
so C-x ` in Emacs works on them.
|
||||
@ -733,7 +741,7 @@ Version 3.60
|
||||
|
||||
* Archives on AIX now supposedly work.
|
||||
|
||||
* When the commands specified for .DEFAULT are used to update a target,
|
||||
* When the recipes specified for .DEFAULT are used to update a target,
|
||||
the $< automatic variable is given the same value as $@ for that target.
|
||||
This is how Unix make behaves, and this behavior is mandated by POSIX.2.
|
||||
|
||||
@ -758,18 +766,18 @@ Version 3.57
|
||||
|
||||
Version 3.55
|
||||
|
||||
* There is now a Unix man page for GNU Make. It is certainly not a replacement
|
||||
for the Texinfo manual, but it documents the basic functionality and the
|
||||
switches. For full documentation, you should still read the Texinfo manual.
|
||||
Thanks to Dennis Morse of Stanford University for contributing the initial
|
||||
version of this.
|
||||
* There is now a Unix man page for GNU Make. It is certainly not a
|
||||
replacement for the Texinfo manual, but it documents the basic
|
||||
functionality and the switches. For full documentation, you should
|
||||
still read the Texinfo manual. Thanks to Dennis Morse of Stanford
|
||||
University for contributing the initial version of this.
|
||||
|
||||
* Variables which are defined by default (e.g., `CC') will no longer be put
|
||||
into the environment for child processes. (If these variables are reset by the
|
||||
environment, makefiles, or the command line, they will still go into the
|
||||
environment.)
|
||||
* Variables which are defined by default (e.g., `CC') will no longer be
|
||||
put into the environment for child processes. (If these variables are
|
||||
reset by the environment, makefiles, or the command line, they will
|
||||
still go into the environment.)
|
||||
|
||||
* Makefiles which have commands but no dependencies (and thus are always
|
||||
* Makefiles which have recipes but no dependencies (and thus are always
|
||||
considered out of date and in need of remaking), will not be remade (if they
|
||||
were being remade only because they were makefiles). This means that GNU
|
||||
Make will no longer go into an infinite loop when fed the makefiles that
|
||||
@ -781,45 +789,45 @@ pathname (instead of a `%' pattern).
|
||||
Version 3.51
|
||||
|
||||
* When removing intermediate files, only one `rm' command line is printed,
|
||||
listing all file names.
|
||||
listing all file names.
|
||||
|
||||
* There are now automatic variables `$(^D)', `$(^F)', `$(?D)', and `$(?F)'.
|
||||
These are the directory-only and file-only versions of `$^' and `$?'.
|
||||
These are the directory-only and file-only versions of `$^' and `$?'.
|
||||
|
||||
* Library dependencies given as `-lNAME' will use "libNAME.a" in the current
|
||||
directory if it exists.
|
||||
directory if it exists.
|
||||
|
||||
* The automatic variable `$($/)' is no longer defined.
|
||||
|
||||
* Leading `+' characters on a command line make that line be executed even
|
||||
under -n, -t, or -q (as if the line contained `$(MAKE)').
|
||||
* Leading `+' characters on a recipe line make that line be executed even
|
||||
under -n, -t, or -q (as if the line contained `$(MAKE)').
|
||||
|
||||
* For command lines containing `$(MAKE)', `${MAKE}', or leading `+' characters,
|
||||
only those lines are executed, not their entire rules.
|
||||
(This is how Unix make behaves for lines containing `$(MAKE)' or `${MAKE}'.)
|
||||
* For recipe lines containing `$(MAKE)', `${MAKE}', or leading `+' characters,
|
||||
only those lines are executed, not the entire recipe.
|
||||
(This is how Unix make behaves for lines containing `$(MAKE)' or `${MAKE}'.)
|
||||
|
||||
Version 3.50
|
||||
|
||||
* Filenames in rules will now have ~ and ~USER expanded.
|
||||
|
||||
* The `-p' output has been changed so it can be used as a makefile.
|
||||
(All information that isn't specified by makefiles is prefaced with comment
|
||||
characters.)
|
||||
(All information that isn't specified by makefiles is prefaced with comment
|
||||
characters.)
|
||||
|
||||
Version 3.49
|
||||
|
||||
* The % character can be quoted with backslash in implicit pattern rules,
|
||||
static pattern rules, `vpath' directives, and `patsubst', `filter', and
|
||||
`filter-out' functions. A warning is issued if a `vpath' directive's
|
||||
pattern contains no %.
|
||||
static pattern rules, `vpath' directives, and `patsubst', `filter', and
|
||||
`filter-out' functions. A warning is issued if a `vpath' directive's
|
||||
pattern contains no %.
|
||||
|
||||
* The `wildcard' variable expansion function now expands ~ and ~USER.
|
||||
|
||||
* Messages indicating failed commands now contain the target name:
|
||||
* Messages indicating failed recipe lines now contain the target name:
|
||||
make: *** [target] Error 1
|
||||
|
||||
* The `-p' output format has been changed somewhat to look more like
|
||||
makefile rules and to give all information that Make has about files.
|
||||
makefile rules and to give all information that Make has about files.
|
||||
|
||||
Version 3.48
|
||||
|
||||
@ -828,49 +836,49 @@ Version 3.47
|
||||
* The `-l' switch with no argument removes any previous load-average limit.
|
||||
|
||||
* When the `-w' switch is in effect, and Make has updated makefiles,
|
||||
it will write a `Leaving directory' messagfe before re-executing itself.
|
||||
This makes the `directory change tracking' changes to Emacs's compilation
|
||||
commands work properly.
|
||||
it will write a `Leaving directory' message before re-executing itself.
|
||||
This makes the `directory change tracking' changes to Emacs's compilation
|
||||
commands work properly.
|
||||
|
||||
Version 3.46
|
||||
|
||||
* The automatic variable `$*' is now defined for explicit rules,
|
||||
as it is in Unix make.
|
||||
as it is in Unix make.
|
||||
|
||||
Version 3.45
|
||||
|
||||
* The `-j' switch is now put in the MAKEFLAGS and MFLAGS variables when
|
||||
specified without an argument (indicating infinite jobs).
|
||||
The `-l' switch is not always put in the MAKEFLAGS and MFLAGS variables.
|
||||
specified without an argument (indicating infinite jobs).
|
||||
The `-l' switch is not always put in the MAKEFLAGS and MFLAGS variables.
|
||||
|
||||
* Make no longer checks hashed directories after running commands.
|
||||
The behavior implemented in 3.41 caused too much slowdown.
|
||||
* Make no longer checks hashed directories after running recipes.
|
||||
The behavior implemented in 3.41 caused too much slowdown.
|
||||
|
||||
Version 3.44
|
||||
|
||||
* A dependency is NOT considered newer than its dependent if
|
||||
they have the same modification time. The behavior implemented
|
||||
in 3.43 conflicts with RCS.
|
||||
they have the same modification time. The behavior implemented
|
||||
in 3.43 conflicts with RCS.
|
||||
|
||||
Version 3.43
|
||||
|
||||
* Dependency loops are no longer fatal errors.
|
||||
|
||||
* A dependency is considered newer than its dependent if
|
||||
they have the same modification time.
|
||||
they have the same modification time.
|
||||
|
||||
Version 3.42
|
||||
|
||||
* The variables F77 and F77FLAGS are now set by default to $(FC) and
|
||||
$(FFLAGS). Makefiles designed for System V make may use these variables in
|
||||
explicit rules and expect them to be set. Unfortunately, there is no way to
|
||||
make setting these affect the Fortran implicit rules unless FC and FFLAGS
|
||||
are not used (and these are used by BSD make).
|
||||
$(FFLAGS). Makefiles designed for System V make may use these variables in
|
||||
explicit rules and expect them to be set. Unfortunately, there is no way to
|
||||
make setting these affect the Fortran implicit rules unless FC and FFLAGS
|
||||
are not used (and these are used by BSD make).
|
||||
|
||||
Version 3.41
|
||||
|
||||
* Make now checks to see if its hashed directories are changed by commands.
|
||||
Other makes that hash directories (Sun, 4.3 BSD) don't do this.
|
||||
* Make now checks to see if its hashed directories are changed by recipes.
|
||||
Other makes that hash directories (Sun, 4.3 BSD) don't do this.
|
||||
|
||||
Version 3.39
|
||||
|
||||
@ -879,7 +887,7 @@ Version 3.39
|
||||
Version 3.32
|
||||
|
||||
* A file beginning with a dot can be the default target if it also contains
|
||||
a slash (e.g., `../bin/foo'). (Unix make allows this as well.)
|
||||
a slash (e.g., `../bin/foo'). (Unix make allows this as well.)
|
||||
|
||||
Version 3.31
|
||||
|
||||
@ -888,8 +896,8 @@ Version 3.31
|
||||
* Yet more USG stuff.
|
||||
|
||||
* Minimal support for Microport System V (a 16-bit machine and a
|
||||
brain-damaged compiler). This has even lower priority than other USG
|
||||
support, so if it gets beyond trivial, I will take it out completely.
|
||||
brain-damaged compiler). This has even lower priority than other USG
|
||||
support, so if it gets beyond trivial, I will take it out completely.
|
||||
|
||||
* Revamped default implicit rules (not much visible change).
|
||||
|
||||
@ -900,13 +908,13 @@ Version 3.30
|
||||
* Improved support for USG and HPUX (hopefully).
|
||||
|
||||
* A variable reference like `$(foo:a=b)', if `a' contains a `%', is
|
||||
equivalent to `$(patsubst a,b,$(foo))'.
|
||||
equivalent to `$(patsubst a,b,$(foo))'.
|
||||
|
||||
* Defining .DEFAULT with no deps or commands clears its commands.
|
||||
* Defining .DEFAULT with no deps or recipe clears its recipe.
|
||||
|
||||
* New default implicit rules for .S (cpp, then as), and .sh (copy and make
|
||||
executable). All default implicit rules that use cpp (even indirectly), use
|
||||
$(CPPFLAGS).
|
||||
* New default implicit rules for .S (cpp, then as), and .sh (copy and
|
||||
make executable). All default implicit rules that use cpp (even
|
||||
indirectly), use $(CPPFLAGS).
|
||||
|
||||
Version 3.29
|
||||
|
||||
@ -915,21 +923,21 @@ Version 3.29
|
||||
Version 3.28
|
||||
|
||||
* New option: "-l LOAD" says not to start any new jobs while others are
|
||||
running if the load average is not below LOAD (a floating-point number).
|
||||
running if the load average is not below LOAD (a floating-point number).
|
||||
|
||||
* There is support in place for implementations of remote command execution
|
||||
in Make. See the file remote.c.
|
||||
in Make. See the file remote.c.
|
||||
|
||||
Version 3.26
|
||||
|
||||
* No more than 10 directories will be kept open at once.
|
||||
(This number can be changed by redefining MAX_OPEN_DIRECTORIES in dir.c.)
|
||||
(This number can be changed by redefining MAX_OPEN_DIRECTORIES in dir.c.)
|
||||
|
||||
Version 3.25
|
||||
|
||||
* Archive files will have their modification times recorded before doing
|
||||
anything that might change their modification times by updating an archive
|
||||
member.
|
||||
anything that might change their modification times by updating an archive
|
||||
member.
|
||||
|
||||
Version 3.20
|
||||
|
||||
@ -938,25 +946,25 @@ Version 3.20
|
||||
Version 3.19
|
||||
|
||||
* The recursion level indications in error messages are much shorter than
|
||||
they were in version 3.14.
|
||||
they were in version 3.14.
|
||||
|
||||
Version 3.18
|
||||
|
||||
* Leading spaces before directives are ignored (as documented).
|
||||
|
||||
* Included makefiles can determine the default goal target.
|
||||
(System V Make does it this way, so we are being compatible).
|
||||
(System V Make does it this way, so we are being compatible).
|
||||
|
||||
Version 3.14.
|
||||
|
||||
* Variables that are defaults built into Make will not be put in the
|
||||
environment for children. This just saves some environment space and,
|
||||
except under -e, will be transparent to sub-makes.
|
||||
environment for children. This just saves some environment space and,
|
||||
except under -e, will be transparent to sub-makes.
|
||||
|
||||
* Error messages from sub-makes will indicate the level of recursion.
|
||||
|
||||
* Hopefully some speed-up for large directories due to a change in the
|
||||
directory hashing scheme.
|
||||
directory hashing scheme.
|
||||
|
||||
* One child will always get a standard input that is usable.
|
||||
|
||||
@ -965,7 +973,7 @@ directory hashing scheme.
|
||||
Version 3.13.
|
||||
|
||||
* Count parentheses inside expansion function calls so you can
|
||||
have nested calls: `$(sort $(foreach x,a b,$(x)))'.
|
||||
have nested calls: `$(sort $(foreach x,a b,$(x)))'.
|
||||
|
||||
Version 3.12.
|
||||
|
||||
@ -981,15 +989,15 @@ Version 3.12.
|
||||
|
||||
* Makefiles will be updated and re-read if necessary.
|
||||
|
||||
* Can now run several commands at once (parallelism), -j option.
|
||||
* Can now run several recipes at once (parallelism), -j option.
|
||||
|
||||
* Error messages will contain the level of Make recursion, if any.
|
||||
|
||||
* The `MAKEFLAGS' and `MFLAGS' variables will be scanned for options after
|
||||
makefiles are read.
|
||||
makefiles are read.
|
||||
|
||||
* A double-colon rule with no dependencies will always have its commands run.
|
||||
(This is how both the BSD and System V versions of Make do it.)
|
||||
* A double-colon rule with no dependencies will always have its recipe run.
|
||||
(This is how both the BSD and System V versions of Make do it.)
|
||||
|
||||
Version 3.05
|
||||
|
||||
|
@ -596,7 +596,7 @@ print_commands (const struct commands *cmds)
|
||||
{
|
||||
const char *s;
|
||||
|
||||
fputs (_("# commands to execute"), stdout);
|
||||
fputs (_("# recipe to execute"), stdout);
|
||||
|
||||
if (cmds->fileinfo.filenm == 0)
|
||||
puts (_(" (built-in):"));
|
||||
@ -609,15 +609,12 @@ print_commands (const struct commands *cmds)
|
||||
{
|
||||
const char *end;
|
||||
|
||||
while (isspace ((unsigned char)*s))
|
||||
++s;
|
||||
|
||||
end = strchr (s, '\n');
|
||||
if (end == 0)
|
||||
end = s + strlen (s);
|
||||
|
||||
printf ("\t%.*s\n", (int) (end - s), s);
|
||||
printf ("%c%.*s\n", cmd_prefix, (int) (end - s), s);
|
||||
|
||||
s = end;
|
||||
s = end + (end[0] == '\n');
|
||||
}
|
||||
}
|
||||
|
1847
doc/make.texi
1847
doc/make.texi
File diff suppressed because it is too large
Load Diff
14
file.c
14
file.c
@ -255,18 +255,18 @@ rehash_file (struct file *from_file, const char *to_hname)
|
||||
but give a message to let the user know what's going on. */
|
||||
if (to_file->cmds->fileinfo.filenm != 0)
|
||||
error (&from_file->cmds->fileinfo,
|
||||
_("Commands were specified for file `%s' at %s:%lu,"),
|
||||
_("Recipe was specified for file `%s' at %s:%lu,"),
|
||||
from_file->name, to_file->cmds->fileinfo.filenm,
|
||||
to_file->cmds->fileinfo.lineno);
|
||||
else
|
||||
error (&from_file->cmds->fileinfo,
|
||||
_("Commands for file `%s' were found by implicit rule search,"),
|
||||
_("Recipe for file `%s' was found by implicit rule search,"),
|
||||
from_file->name);
|
||||
error (&from_file->cmds->fileinfo,
|
||||
_("but `%s' is now considered the same file as `%s'."),
|
||||
from_file->name, to_hname);
|
||||
error (&from_file->cmds->fileinfo,
|
||||
_("Commands for `%s' will be ignored in favor of those for `%s'."),
|
||||
_("Recipe for `%s' will be ignored in favor of the one for `%s'."),
|
||||
to_hname, from_file->name);
|
||||
}
|
||||
}
|
||||
@ -359,7 +359,7 @@ remove_intermediates (int sig)
|
||||
struct file *f = *file_slot;
|
||||
/* Is this file eligible for automatic deletion?
|
||||
Yes, IFF: it's marked intermediate, it's not secondary, it wasn't
|
||||
given on the command-line, and it's either a -include makefile or
|
||||
given on the command line, and it's either a -include makefile or
|
||||
it's not precious. */
|
||||
if (f->intermediate && (f->dontcare || !f->precious)
|
||||
&& !f->secondary && !f->cmd_target)
|
||||
@ -895,7 +895,7 @@ print_file (const void *item)
|
||||
if (f->phony)
|
||||
puts (_("# Phony target (prerequisite of .PHONY)."));
|
||||
if (f->cmd_target)
|
||||
puts (_("# Command-line target."));
|
||||
puts (_("# Command line target."));
|
||||
if (f->dontcare)
|
||||
puts (_("# A default, MAKEFILES, or -include/sinclude makefile."));
|
||||
puts (f->tried_implicit
|
||||
@ -929,10 +929,10 @@ print_file (const void *item)
|
||||
switch (f->command_state)
|
||||
{
|
||||
case cs_running:
|
||||
puts (_("# Commands currently running (THIS IS A BUG)."));
|
||||
puts (_("# Recipe currently running (THIS IS A BUG)."));
|
||||
break;
|
||||
case cs_deps_running:
|
||||
puts (_("# Dependencies commands running (THIS IS A BUG)."));
|
||||
puts (_("# Dependencies recipe running (THIS IS A BUG)."));
|
||||
break;
|
||||
case cs_not_started:
|
||||
case cs_finished:
|
||||
|
30
job.c
30
job.c
@ -1724,13 +1724,13 @@ new_job (struct file *file)
|
||||
++jobserver_tokens;
|
||||
|
||||
/* The job is now primed. Start it running.
|
||||
(This will notice if there are in fact no commands.) */
|
||||
(This will notice if there is in fact no recipe.) */
|
||||
if (cmds->fileinfo.filenm)
|
||||
DB (DB_BASIC, (_("Invoking commands from %s:%lu to update target `%s'.\n"),
|
||||
DB (DB_BASIC, (_("Invoking recipe from %s:%lu to update target `%s'.\n"),
|
||||
cmds->fileinfo.filenm, cmds->fileinfo.lineno,
|
||||
c->file->name));
|
||||
else
|
||||
DB (DB_BASIC, (_("Invoking builtin commands to update target `%s'.\n"),
|
||||
DB (DB_BASIC, (_("Invoking builtin recipe to update target `%s'.\n"),
|
||||
c->file->name));
|
||||
|
||||
|
||||
@ -2461,9 +2461,6 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
*(ap++) = *(p++);
|
||||
*(ap++) = *p;
|
||||
}
|
||||
/* If there's a command prefix char here, skip it. */
|
||||
if (p[1] == cmd_prefix)
|
||||
++p;
|
||||
}
|
||||
else if (*p == '\n' && restp != NULL)
|
||||
{
|
||||
@ -2511,11 +2508,6 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
/* Throw out the backslash and newline. */
|
||||
++p;
|
||||
|
||||
/* If there is a command prefix after a backslash-newline,
|
||||
remove it. */
|
||||
if (p[1] == cmd_prefix)
|
||||
++p;
|
||||
|
||||
/* If there's nothing in this argument yet, skip any
|
||||
whitespace before the start of the next word. */
|
||||
if (ap == new_argv[i])
|
||||
@ -2743,9 +2735,8 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
}
|
||||
else if (*p == '\\' && p[1] == '\n')
|
||||
{
|
||||
/* POSIX says we keep the backslash-newline, but throw out
|
||||
the next char if it's a TAB. If we don't have a POSIX
|
||||
shell on DOS/Windows/OS2, mimic the pre-POSIX behavior
|
||||
/* POSIX says we keep the backslash-newline. If we don't have a
|
||||
POSIX shell on DOS/Windows/OS2, mimic the pre-POSIX behavior
|
||||
and remove the backslash/newline. */
|
||||
#if defined (__MSDOS__) || defined (__EMX__) || defined (WINDOWS32)
|
||||
# define PRESERVE_BSNL unixy_shell
|
||||
@ -2758,11 +2749,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
*(ap++) = '\\';
|
||||
*(ap++) = '\n';
|
||||
}
|
||||
|
||||
++p;
|
||||
if (p[1] == cmd_prefix)
|
||||
++p;
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -2849,12 +2836,7 @@ construct_command_argv_internal (char *line, char **restp, char *shell,
|
||||
while (*q != '\0')
|
||||
{
|
||||
if (q[0] == '\\' && q[1] == '\n')
|
||||
{
|
||||
q += 2; /* remove '\\' and '\n' */
|
||||
/* Remove any command prefix in the next line */
|
||||
if (q[0] == cmd_prefix)
|
||||
q++;
|
||||
}
|
||||
q += 2; /* remove '\\' and '\n' */
|
||||
else
|
||||
*p++ = *q++;
|
||||
}
|
||||
|
9
main.c
9
main.c
@ -320,7 +320,7 @@ static const char *const usage[] =
|
||||
N_("\
|
||||
-h, --help Print this message and exit.\n"),
|
||||
N_("\
|
||||
-i, --ignore-errors Ignore errors from commands.\n"),
|
||||
-i, --ignore-errors Ignore errors from recipes.\n"),
|
||||
N_("\
|
||||
-I DIRECTORY, --include-dir=DIRECTORY\n\
|
||||
Search DIRECTORY for included makefiles.\n"),
|
||||
@ -335,20 +335,20 @@ static const char *const usage[] =
|
||||
-L, --check-symlink-times Use the latest mtime between symlinks and target.\n"),
|
||||
N_("\
|
||||
-n, --just-print, --dry-run, --recon\n\
|
||||
Don't actually run any commands; just print them.\n"),
|
||||
Don't actually run any recipe; just print them.\n"),
|
||||
N_("\
|
||||
-o FILE, --old-file=FILE, --assume-old=FILE\n\
|
||||
Consider FILE to be very old and don't remake it.\n"),
|
||||
N_("\
|
||||
-p, --print-data-base Print make's internal database.\n"),
|
||||
N_("\
|
||||
-q, --question Run no commands; exit status says if up to date.\n"),
|
||||
-q, --question Run no recipe; exit status says if up to date.\n"),
|
||||
N_("\
|
||||
-r, --no-builtin-rules Disable the built-in implicit rules.\n"),
|
||||
N_("\
|
||||
-R, --no-builtin-variables Disable the built-in variable settings.\n"),
|
||||
N_("\
|
||||
-s, --silent, --quiet Don't echo commands.\n"),
|
||||
-s, --silent, --quiet Don't echo recipes.\n"),
|
||||
N_("\
|
||||
-S, --no-keep-going, --stop\n\
|
||||
Turns off -k.\n"),
|
||||
@ -1117,6 +1117,7 @@ main (int argc, char **argv, char **envp)
|
||||
/* Initialize the special variables. */
|
||||
define_variable (".VARIABLES", 10, "", o_default, 0)->special = 1;
|
||||
/* define_variable (".TARGETS", 8, "", o_default, 0)->special = 1; */
|
||||
define_variable (".RECIPEPREFIX", 13, "", o_default, 0)->special = 1;
|
||||
|
||||
/* Set up .FEATURES */
|
||||
define_variable (".FEATURES", 9,
|
||||
|
3
make.h
3
make.h
@ -496,6 +496,9 @@ extern int second_expansion, clock_skew_detected, rebuilding_makefiles;
|
||||
/* can we run commands via 'sh -c xxx' or must we use batch files? */
|
||||
extern int batch_mode_shell;
|
||||
|
||||
/* Resetting the command script introduction prefix character. */
|
||||
#define RECIPEPREFIX_NAME ".RECIPEPREFIX"
|
||||
#define RECIPEPREFIX_DEFAULT '\t'
|
||||
extern char cmd_prefix;
|
||||
|
||||
extern unsigned int job_slots;
|
||||
|
41
read.c
41
read.c
@ -536,18 +536,31 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
/* Yep, this is a shell command, and we don't care. */
|
||||
continue;
|
||||
|
||||
/* Append this command line to the line being accumulated. */
|
||||
/* Append this command line to the line being accumulated.
|
||||
Strip command prefix chars that appear after newlines. */
|
||||
if (commands_idx == 0)
|
||||
cmds_started = ebuf->floc.lineno;
|
||||
|
||||
if (linelen + 1 + commands_idx > commands_len)
|
||||
if (linelen + commands_idx > commands_len)
|
||||
{
|
||||
commands_len = (linelen + 1 + commands_idx) * 2;
|
||||
commands_len = (linelen + commands_idx) * 2;
|
||||
commands = xrealloc (commands, commands_len);
|
||||
}
|
||||
memcpy (&commands[commands_idx], line, linelen);
|
||||
commands_idx += linelen;
|
||||
commands[commands_idx++] = '\n';
|
||||
p = &commands[commands_idx];
|
||||
p2 = line + 1;
|
||||
while (--linelen)
|
||||
{
|
||||
++commands_idx;
|
||||
*(p++) = *p2;
|
||||
if (p2[0] == '\n' && p2[1] == cmd_prefix)
|
||||
{
|
||||
++p2;
|
||||
--linelen;
|
||||
}
|
||||
++p2;
|
||||
}
|
||||
*p = '\n';
|
||||
++commands_idx;
|
||||
|
||||
continue;
|
||||
}
|
||||
@ -844,7 +857,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
was no preceding target, and the line might have been usable as a
|
||||
variable definition. But now we know it is definitely lossage. */
|
||||
if (line[0] == cmd_prefix)
|
||||
fatal(fstart, _("commands commence before first target"));
|
||||
fatal(fstart, _("recipe commences before first target"));
|
||||
|
||||
/* This line describes some target files. This is complicated by
|
||||
the existence of target-specific variables, because we can't
|
||||
@ -895,7 +908,7 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
{
|
||||
case w_eol:
|
||||
if (cmdleft != 0)
|
||||
fatal(fstart, _("missing rule before commands"));
|
||||
fatal(fstart, _("missing rule before recipe"));
|
||||
/* This line contained something but turned out to be nothing
|
||||
but whitespace (a comment?). */
|
||||
continue;
|
||||
@ -983,8 +996,8 @@ eval (struct ebuffer *ebuf, int set_default)
|
||||
/* There's no need to be ivory-tower about this: check for
|
||||
one of the most common bugs found in makefiles... */
|
||||
fatal (fstart, _("missing separator%s"),
|
||||
!strneq(line, " ", 8) ? ""
|
||||
: _(" (did you mean TAB instead of 8 spaces?)"));
|
||||
(cmd_prefix == '\t' && !strneq(line, " ", 8))
|
||||
? "" : _(" (did you mean TAB instead of 8 spaces?)"));
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -1871,7 +1884,7 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
at this time, since they won't get snapped and we'll get core dumps.
|
||||
See Savannah bug # 12124. */
|
||||
if (snapped_deps)
|
||||
fatal (flocp, _("prerequisites cannot be defined in command scripts"));
|
||||
fatal (flocp, _("prerequisites cannot be defined in recipes"));
|
||||
|
||||
if (commands_idx > 0)
|
||||
{
|
||||
@ -1971,10 +1984,10 @@ record_files (struct nameseq *filenames, const char *pattern,
|
||||
else if (cmds != 0 && f->cmds != 0 && f->is_target)
|
||||
{
|
||||
error (&cmds->fileinfo,
|
||||
_("warning: overriding commands for target `%s'"),
|
||||
_("warning: overriding recipe for target `%s'"),
|
||||
f->name);
|
||||
error (&f->cmds->fileinfo,
|
||||
_("warning: ignoring old commands for target `%s'"),
|
||||
_("warning: ignoring old recipe for target `%s'"),
|
||||
f->name);
|
||||
}
|
||||
|
||||
@ -2962,7 +2975,7 @@ construct_include_path (const char **arg_dirs)
|
||||
--len;
|
||||
if (len > max_incl_len)
|
||||
max_incl_len = len;
|
||||
dirs[idx++] = strcache_add_len (*cpp, len - 1);
|
||||
dirs[idx++] = strcache_add_len (*cpp, len);
|
||||
}
|
||||
}
|
||||
|
||||
|
6
remake.c
6
remake.c
@ -460,7 +460,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
if (file->cmds == 0 && !file->is_target
|
||||
&& default_file != 0 && default_file->cmds != 0)
|
||||
{
|
||||
DBF (DB_IMPLICIT, _("Using default commands for `%s'.\n"));
|
||||
DBF (DB_IMPLICIT, _("Using default recipe for `%s'.\n"));
|
||||
file->cmds = default_file->cmds;
|
||||
}
|
||||
|
||||
@ -711,7 +711,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
{
|
||||
must_make = 0;
|
||||
DBF (DB_VERBOSE,
|
||||
_("No commands for `%s' and no prerequisites actually changed.\n"));
|
||||
_("No recipe for `%s' and no prerequisites actually changed.\n"));
|
||||
}
|
||||
else if (!must_make && file->cmds != 0 && always_make_flag)
|
||||
{
|
||||
@ -761,7 +761,7 @@ update_file_1 (struct file *file, unsigned int depth)
|
||||
|
||||
if (file->command_state != cs_finished)
|
||||
{
|
||||
DBF (DB_VERBOSE, _("Commands of `%s' are being run.\n"));
|
||||
DBF (DB_VERBOSE, _("Recipe of `%s' is being run.\n"));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1,3 +1,16 @@
|
||||
2007-11-04 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/functions/eval: Update error message for command -> recipe.
|
||||
|
||||
* test_driver.pl (compare_output): Allow the answer to be a regex,
|
||||
if surrounded by '/'.
|
||||
* scripts/misc/close_stdout: Use a regex for the answer, since
|
||||
sometimes the error will have a description and sometimes it won't.
|
||||
|
||||
2007-09-10 Paul Smith <psmith@gnu.org>
|
||||
|
||||
* scripts/variables/special: Add tests for .RECIPEPREFIX variable.
|
||||
|
||||
2007-08-15 Paul Smith <psmith@gnu.org>
|
||||
|
||||
These test cases were contributed by
|
||||
|
@ -163,7 +163,7 @@ world');
|
||||
# See Savannah bug # 12124.
|
||||
|
||||
run_make_test('deps: ; $(eval deps: foo)', '',
|
||||
'#MAKEFILE#:1: *** prerequisites cannot be defined in command scripts. Stop.',
|
||||
'#MAKEFILE#:1: *** prerequisites cannot be defined in recipes. Stop.',
|
||||
512);
|
||||
|
||||
1;
|
||||
|
@ -3,7 +3,7 @@
|
||||
$description = "Make sure make exits with an error if stdout is full.";
|
||||
|
||||
if (-e '/dev/full') {
|
||||
run_make_test('', '-v > /dev/full', '#MAKE#: write error', 256);
|
||||
run_make_test('', '-v > /dev/full', '/^#MAKE#: write error/', 256);
|
||||
}
|
||||
|
||||
1;
|
||||
|
@ -50,5 +50,68 @@ all:
|
||||
# $answer = "X1 =\nX2 = all\nLAST = all foo\n";
|
||||
# &compare_output($answer, &get_logfile(1));
|
||||
|
||||
# Test the .RECIPEPREFIX variable
|
||||
&run_make_test('
|
||||
define foo
|
||||
: foo-one \
|
||||
foo-two
|
||||
: foo-three
|
||||
: foo-four
|
||||
endef
|
||||
|
||||
orig: ; : orig-one
|
||||
: orig-two \
|
||||
orig-three \
|
||||
orig-four \
|
||||
orig-five \\\\
|
||||
: orig-six
|
||||
$(foo)
|
||||
|
||||
.RECIPEPREFIX = >
|
||||
test: ; : test-one
|
||||
>: test-two \
|
||||
test-three \
|
||||
>test-four \
|
||||
> test-five \\\\
|
||||
>: test-six
|
||||
>$(foo)
|
||||
|
||||
.RECIPEPREFIX =
|
||||
reset: ; : reset-one
|
||||
: reset-two \
|
||||
reset-three \
|
||||
reset-four \
|
||||
reset-five \\\\
|
||||
: reset-six
|
||||
$(foo)
|
||||
',
|
||||
'orig test reset',
|
||||
': orig-one
|
||||
: orig-two \
|
||||
orig-three \
|
||||
orig-four \
|
||||
orig-five \\\\
|
||||
: orig-six
|
||||
: foo-one foo-two
|
||||
: foo-three
|
||||
: foo-four
|
||||
: test-one
|
||||
: test-two \
|
||||
test-three \
|
||||
test-four \
|
||||
test-five \\\\
|
||||
: test-six
|
||||
: foo-one foo-two
|
||||
: foo-three
|
||||
: foo-four
|
||||
: reset-one
|
||||
: reset-two \
|
||||
reset-three \
|
||||
reset-four \
|
||||
reset-five \\\\
|
||||
: reset-six
|
||||
: foo-one foo-two
|
||||
: foo-three
|
||||
: foo-four');
|
||||
|
||||
1;
|
||||
|
@ -661,15 +661,23 @@ sub compare_output
|
||||
$answer_matched = 1;
|
||||
} else {
|
||||
# See if it is a slash or CRLF problem
|
||||
local ($answer_mod) = $answer;
|
||||
local ($answer_mod, $slurp_mod) = ($answer, $slurp);
|
||||
|
||||
$answer_mod =~ tr,\\,/,;
|
||||
$answer_mod =~ s,\r\n,\n,gs;
|
||||
|
||||
$slurp =~ tr,\\,/,;
|
||||
$slurp =~ s,\r\n,\n,gs;
|
||||
$slurp_mod =~ tr,\\,/,;
|
||||
$slurp_mod =~ s,\r\n,\n,gs;
|
||||
|
||||
$answer_matched = ($slurp eq $answer_mod);
|
||||
$answer_matched = ($slurp_mod eq $answer_mod);
|
||||
|
||||
# If it still doesn't match, see if the answer might be a regex.
|
||||
if (!$answer_matched && $answer =~ m,^/(.+)/$,) {
|
||||
$answer_matched = ($slurp =~ /$1/);
|
||||
if (!$answer_matched && $answer_mod =~ m,^/(.+)/$,) {
|
||||
$answer_matched = ($slurp_mod =~ /$1/);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($answer_matched && $test_passed)
|
||||
|
22
variable.c
22
variable.c
@ -252,7 +252,7 @@ define_variable_in_set (const char *name, unsigned int length,
|
||||
#define EXPANSION_INCREMENT(_l) ((((_l) / 500) + 1) * 500)
|
||||
|
||||
static struct variable *
|
||||
handle_special_var (struct variable *var)
|
||||
lookup_special_var (struct variable *var)
|
||||
{
|
||||
static unsigned long last_var_count = 0;
|
||||
|
||||
@ -352,7 +352,7 @@ lookup_variable (const char *name, unsigned int length)
|
||||
|
||||
v = (struct variable *) hash_find_item ((struct hash_table *) &set->table, &var_key);
|
||||
if (v)
|
||||
return v->special ? handle_special_var (v) : v;
|
||||
return v->special ? lookup_special_var (v) : v;
|
||||
}
|
||||
|
||||
#ifdef VMS
|
||||
@ -985,6 +985,20 @@ target_environment (struct file *file)
|
||||
return result_0;
|
||||
}
|
||||
|
||||
static struct variable *
|
||||
set_special_var (struct variable *var)
|
||||
{
|
||||
if (streq (var->name, RECIPEPREFIX_NAME))
|
||||
{
|
||||
/* The user is resetting the command introduction prefix. This has to
|
||||
happen immediately, so that subsequent rules are interpreted
|
||||
properly. */
|
||||
cmd_prefix = var->value[0]=='\0' ? RECIPEPREFIX_DEFAULT : var->value[0];
|
||||
}
|
||||
|
||||
return var;
|
||||
}
|
||||
|
||||
/* Given a variable, a value, and a flavor, define the variable.
|
||||
See the try_variable_definition() function for details on the parameters. */
|
||||
|
||||
@ -1019,7 +1033,7 @@ do_variable_definition (const struct floc *flocp, const char *varname,
|
||||
The value is set IFF the variable is not defined yet. */
|
||||
v = lookup_variable (varname, strlen (varname));
|
||||
if (v)
|
||||
return v;
|
||||
return v->special ? set_special_var (v) : v;
|
||||
|
||||
conditional = 1;
|
||||
flavor = f_recursive;
|
||||
@ -1227,7 +1241,7 @@ do_variable_definition (const struct floc *flocp, const char *varname,
|
||||
if (alloc_value)
|
||||
free (alloc_value);
|
||||
|
||||
return v;
|
||||
return v->special ? set_special_var (v) : v;
|
||||
}
|
||||
|
||||
/* Try to interpret LINE (a null-terminated string) as a variable definition.
|
||||
|
Loading…
Reference in New Issue
Block a user