- Fix Savannah bug #13401

This commit is contained in:
Paul Smith 2009-06-13 23:10:52 +00:00
parent 38b23bc3f0
commit dceb954f9c
5 changed files with 38 additions and 7 deletions

View File

@ -1,5 +1,10 @@
2009-06-13 Paul Smith <psmith@gnu.org> 2009-06-13 Paul Smith <psmith@gnu.org>
* doc/make.texi (MAKEFILES Variable): Be explicit that files
included by MAKEFILES cannot give default goals.
* read.c (eval): If set_default is not set, pass the no-default-goal
value when we read included makefiles. Fixes Savannah bug #13401.
* ar.c (ar_name): Ensure that targets with empty parens aren't * ar.c (ar_name): Ensure that targets with empty parens aren't
considered archive member references: archive members must have a considered archive member references: archive members must have a
non-empty "member" string. Fixes Savannah bug #18435. non-empty "member" string. Fixes Savannah bug #18435.

View File

@ -1191,11 +1191,12 @@ For compatibility with some other @code{make} implementations,
@vindex MAKEFILES @vindex MAKEFILES
If the environment variable @code{MAKEFILES} is defined, @code{make} If the environment variable @code{MAKEFILES} is defined, @code{make}
considers its value as a list of names (separated by whitespace) of considers its value as a list of names (separated by whitespace) of
additional makefiles to be read before the others. This works much like additional makefiles to be read before the others. This works much
the @code{include} directive: various directories are searched for those like the @code{include} directive: various directories are searched
files (@pxref{Include, ,Including Other Makefiles}). In addition, the for those files (@pxref{Include, ,Including Other Makefiles}). In
default goal is never taken from one of these makefiles and it is not an addition, the default goal is never taken from one of these makefiles
error if the files listed in @code{MAKEFILES} are not found.@refill (or any makefile included by them) and it is not an error if the files
listed in @code{MAKEFILES} are not found.@refill
@cindex recursion, and @code{MAKEFILES} variable @cindex recursion, and @code{MAKEFILES} variable
The main use of @code{MAKEFILES} is in communication between recursive The main use of @code{MAKEFILES} is in communication between recursive

6
read.c
View File

@ -857,8 +857,10 @@ eval (struct ebuffer *ebuf, int set_default)
free (files); free (files);
files = next; files = next;
r = eval_makefile (name, (RM_INCLUDED | RM_NO_TILDE r = eval_makefile (name,
| (noerror ? RM_DONTCARE : 0))); (RM_INCLUDED | RM_NO_TILDE
| (noerror ? RM_DONTCARE : 0)
| (set_default ? 0 : RM_NO_DEFAULT_GOAL)));
if (!r && !noerror) if (!r && !noerror)
error (fstart, "%s: %s", name, strerror (errno)); error (fstart, "%s: %s", name, strerror (errno));
} }

View File

@ -1,5 +1,9 @@
2009-06-13 Paul Smith <psmith@gnu.org> 2009-06-13 Paul Smith <psmith@gnu.org>
* scripts/variables/MAKEFILES: Verify that MAKEFILES included
files (and files included by them) don't set the default goal.
Savannah bug #13401.
* scripts/functions/wildcard: Test that wildcards with * scripts/functions/wildcard: Test that wildcards with
non-existent glob matchers return empty. non-existent glob matchers return empty.

View File

@ -31,4 +31,23 @@ close(MAKEFILE);
$answer = "DEFAULT RULE: M2=m2 M3=m3\n"; $answer = "DEFAULT RULE: M2=m2 M3=m3\n";
&compare_output($answer,&get_logfile(1)); &compare_output($answer,&get_logfile(1));
# TEST 2: Verify that included makefiles don't set the default goal.
# See Savannah bug #13401.
create_file('xx-inc.mk', '
include_goal: ; @echo $@
include xx-ind.mk
');
create_file('xx-ind.mk', '
indirect_goal: ; @echo $@
');
run_make_test(q!
top: ; @echo $@
!,
'MAKEFILES=xx-inc.mk', "top\n");
unlink(qw(xx-inc.mk xx-ind.mk));
1; 1;