Thread View: gnu.utils.bug
1 messages
1 total messages
Started by John Martin
Tue, 18 Aug 1992 16:03
Bug in make -t
Author: John Martin
Date: Tue, 18 Aug 1992 16:03
Date: Tue, 18 Aug 1992 16:03
94 lines
2997 bytes
2997 bytes
GNU make 3.62 has a discrepancy between the documentation and the
action of the -t switch. The info file says:
The `-n', `-t', and `-q' options do not affect command lines that
begin with `+' characters or contain the strings `$(MAKE)' or
`${MAKE}'. Note that only the line containing the `+' character or
the strings `$(MAKE)' or `${MAKE}' is run regardless of these options.
Other lines in the same rule are not run unless they too begin with
`+' or contain `$(MAKE)' or `${MAKE}'.
But what make did was to execute the entire rule if any of its lines
sets the recursive flag. E.g.:
% gnumake -rtf -
all:
rm -rf all
$(MAKE) -$(MAKEFLAGS) foo
rm -rf all
gnumake -rt foo
gnumake[1]: *** No way to make target `foo'. Stop.
gnumake: *** [all] Error 1
According to the documentation, the rm command should not have been
executed.
The patches I made to get the behavior to match the documentation,
which seems preferable to documenting the current actual behavior,
are:
In remake.c:
*** 758,765 ****
{
chop_commands (file->cmds);
! if (touch_flag && !file->cmds->any_recurse)
{
if (file->phony)
file->update_status = 0;
else
--- 758,767 ----
{
chop_commands (file->cmds);
! if (touch_flag)
{
+ if (file->cmds->any_recurse)
+ execute_file_commands( file);
if (file->phony)
file->update_status = 0;
else
In job.c:
*** 631,637 ****
/* Print out the command. */
! if (just_print_flag || (!noprint && !silent_flag))
puts (p);
if (argv == 0)
--- 631,637 ----
/* Print out the command. */
! if (just_print_flag || (!noprint && !silent_flag && !(touch_flag && !recursive)))
puts (p);
if (argv == 0)
***************
*** 643,649 ****
/* If -n was given, recurse to get the next line in the sequence. */
! if (just_print_flag && !recursive)
{
free (argv[0]);
free ((char *) argv);
--- 643,649 ----
/* If -n was given, recurse to get the next line in the sequence. */
! if ((just_print_flag || touch_flag) && !recursive)
{
free (argv[0]);
free ((char *) argv);
---
John H. Martin, johnm@ksr.com, ksr!johnm@uunet.uu.net <The Usual Disclaimer>
The most wonderful things are brought about in many instances by
means the most absurd and ridiculous, in the most ridiculous modes,
and apparently by the most contemptible instruments. -- Edmund Burke
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads