Thread View: gnu.utils.bug
1 messages
1 total messages
Started by Alexander Dupuy
Tue, 24 Jan 1989 22:02
Misfeatures in Make 3.27 (-[nt] options and MAKEFLAGS)
Author: Alexander Dupuy
Date: Tue, 24 Jan 1989 22:02
Date: Tue, 24 Jan 1989 22:02
163 lines
4590 bytes
4590 bytes
Description:
These are pretty much nits, but people should be aware of them.
With Gnu Make 3.27, "make -n" will execute all commands in a rule where
any of the commands contains "$(MAKE)". This also occurs with the -t
option. While a strict reading of the documentation indicates that
this is intended, this is not what the Sun/USG make does when passed
the -n option, nor is it what is usually desired.
Also, "make -t" will touch phony targets, as specified with ".PHONY:".
It doesn't say anywhere that it shouldn't, but it seems a little odd.
Finally, while the definition of the MAKEFLAGS macro in the manual
describes it identically to the Sun/USG MAKEFLAGS, the behavior is
nearly that of the MFLAGS macro, except without a leading space. I
suspect that this is due to the arrival of the "-j#" option, but if
it's impossible to restore MAKEFLAGS to its old behavior, the new
behavior and the incompatibility with Sun/USG should be documented.
Repeat-By:
cs% cat Makefile
example:
echo $(MAKEFLAGS) should not be echoed
$(MAKE) nothing
touch example
.PHONY: nothing
nothing:
echo $(MFLAGS) should not be echoed either
cs% ls
Makefile
cs% make -v -n
GNU Make version 3.27, by Richard Stallman and Roland McGrath.
Copyright (C) 1988 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
echo -j1 -n -S should not be echoed
-j1 -n -S should not be echoed
make nothing
echo -j1 -n -S should not be echoed either
touch example
cs% ls
Makefile example
cs% rm example
cs% make -t
echo -j1 -S -t should not be echoed
-j1 -S -t should not be echoed
make nothing
touch nothing
touch example
cs% ls
Makefile example nothing
cs% rm example nothing
cs% what /bin/make | grep main
main.c 1.47 88/02/08 Copyr 1986 Sun Micro
cs% /bin/make -n
echo n should not be echoed
make nothing
echo -n should not be echoed either
touch example
cs% ls
Makefile
Fix:
Fixing the first misfeature involves messing around with the internal
representation of commands in a rule, and their recursiveness - I
haven't had time to rewrite all that stuff. Following are patches for
the second and third misfeatures:
*** /tmp/,RCSt1a14374 Tue Jan 24 16:59:44 1989
--- remake.c Tue Jan 24 16:54:37 1989
***************
*** 501,507 ****
fflush (stdout);
}
! if (ar_name (file->name))
status = ar_touch (file->name);
else
{
--- 501,509 ----
fflush (stdout);
}
! if (file->phony)
! status = 0;
! else if (ar_name (file->name))
status = ar_touch (file->name);
else
{
*** /tmp/,RCSt1a14374 Tue Jan 24 16:59:43 1989
--- make.c Tue Jan 24 16:54:27 1989
***************
*** 900,913 ****
if ((cs->type == flag && *(int *) cs->value_ptr)
|| (cs->type == flag_off && !*(int *) cs->value_ptr))
{
! flags[i++] = '-';
flags[i++] = cs->c;
- flags[i++] = ' ';
}
else if (cs->type == positive_int)
{
! char *p = &flags[i];
! sprintf (p, " -%c%u ", cs->c,
cs->c == 'j' ? 1 : *(unsigned int *) cs->value_ptr);
i += strlen (p);
}
--- 900,919 ----
if ((cs->type == flag && *(int *) cs->value_ptr)
|| (cs->type == flag_off && !*(int *) cs->value_ptr))
{
! if (i == 0)
! flags[i++] = '-';
!
flags[i++] = cs->c;
}
else if (cs->type == positive_int)
{
! char *p;
!
! if (i == 0)
! flags[i++] = '-';
!
! p = &flags[i];
! sprintf (p, "%c%u", cs->c,
cs->c == 'j' ? 1 : *(unsigned int *) cs->value_ptr);
i += strlen (p);
}
***************
*** 916,922 ****
if (i == 0)
return "";
! flags[i - 1] = '\0';
return flags;
}
--- 922,928 ----
if (i == 0)
return "";
! flags[i] = '\0';
return flags;
}
--
inet: dupuy@cs.columbia.edu
uucp: ...!rutgers!cs.columbia.edu!dupuy
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