mirror of
https://github.com/mirror/make.git
synced 2025-02-05 09:10:12 +08:00
* A few cleanups, and 3.77.94 release.
This commit is contained in:
parent
d0b03e9355
commit
b134da5505
19
ChangeLog
19
ChangeLog
@ -1,3 +1,18 @@
|
|||||||
|
1999-08-25 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
|
* Version 3.77.94 released.
|
||||||
|
|
||||||
|
* main.c (main) [__MSDOS__]: If the user uses -j, warn that it's
|
||||||
|
not supported and reset it.
|
||||||
|
|
||||||
|
* make.h (ISDIGIT): Obtained this from the textutils distribution.
|
||||||
|
* main.c (decode_switches): Use it.
|
||||||
|
* function.c (is_numeric): Use it.
|
||||||
|
|
||||||
|
* main.c (struct command_switch): Store the switch char in an
|
||||||
|
unsigned char to shut up GCC about using it with ctype.h macros.
|
||||||
|
Besides, it _is_ always unsigned.
|
||||||
|
|
||||||
1999-08-24 Paul D. Smith <psmith@gnu.org>
|
1999-08-24 Paul D. Smith <psmith@gnu.org>
|
||||||
|
|
||||||
* make.texinfo: Change "dependency" to "prerequisite" and
|
* make.texinfo: Change "dependency" to "prerequisite" and
|
||||||
@ -13,8 +28,8 @@
|
|||||||
|
|
||||||
* remake.c (update_file): Move the considered check into the
|
* remake.c (update_file): Move the considered check into the
|
||||||
double-colon rule loop, so we consider double-colon rules
|
double-colon rule loop, so we consider double-colon rules
|
||||||
individually (otherwise after the first is pruned, the rest might
|
individually (otherwise after the first is pruned, the rest won't
|
||||||
not get run).
|
get run).
|
||||||
|
|
||||||
* README.template: Minor changes.
|
* README.template: Minor changes.
|
||||||
|
|
||||||
|
@ -702,13 +702,10 @@ is_numeric (p)
|
|||||||
char *end = p + strlen (p) - 1;
|
char *end = p + strlen (p) - 1;
|
||||||
char *beg = p;
|
char *beg = p;
|
||||||
strip_whitespace (&p, &end);
|
strip_whitespace (&p, &end);
|
||||||
while (p <= end)
|
|
||||||
{
|
|
||||||
if (!isdigit (*p))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
p++;
|
while (p <= end)
|
||||||
}
|
if (!ISDIGIT (*(p++))) /* ISDIGIT only evals its arg once: see make.h. */
|
||||||
|
return 0;
|
||||||
|
|
||||||
return (end - beg >= 0);
|
return (end - beg >= 0);
|
||||||
}
|
}
|
||||||
|
23
main.c
23
main.c
@ -79,7 +79,7 @@ static char *quote_as_word PARAMS ((char *out, char *in, int double_dollars));
|
|||||||
|
|
||||||
struct command_switch
|
struct command_switch
|
||||||
{
|
{
|
||||||
char c; /* The switch character. */
|
unsigned char c; /* The switch character. */
|
||||||
|
|
||||||
enum /* Type of the value. */
|
enum /* Type of the value. */
|
||||||
{
|
{
|
||||||
@ -1270,7 +1270,7 @@ int main (int argc, char ** argv)
|
|||||||
/* We need to know what kind of shell we will be using. */
|
/* We need to know what kind of shell we will be using. */
|
||||||
{
|
{
|
||||||
extern int _is_unixy_shell (const char *_path);
|
extern int _is_unixy_shell (const char *_path);
|
||||||
struct variable *shv = lookup_variable("SHELL", 5);
|
struct variable *shv = lookup_variable ("SHELL", 5);
|
||||||
extern int unixy_shell;
|
extern int unixy_shell;
|
||||||
extern char *default_shell;
|
extern char *default_shell;
|
||||||
|
|
||||||
@ -1294,6 +1294,15 @@ int main (int argc, char ** argv)
|
|||||||
decode_env_switches ("MFLAGS", 6);
|
decode_env_switches ("MFLAGS", 6);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __MSDOS__
|
||||||
|
if (job_slots != 1)
|
||||||
|
{
|
||||||
|
error (NILF, _("Parallel jobs (-j) are not supported on MS-DOS."));
|
||||||
|
error (NILF, _("Resetting to single job mode."));
|
||||||
|
job_slots = 1;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef MAKE_JOBSERVER
|
#ifdef MAKE_JOBSERVER
|
||||||
/* If the jobserver-fds option is seen, make sure that -j is reasonable. */
|
/* If the jobserver-fds option is seen, make sure that -j is reasonable. */
|
||||||
|
|
||||||
@ -1851,8 +1860,7 @@ handle_non_switch_argument (arg, env)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
lastgoal->next
|
lastgoal->next = (struct dep *) xmalloc (sizeof (struct dep));
|
||||||
= (struct dep *) xmalloc (sizeof (struct dep));
|
|
||||||
lastgoal = lastgoal->next;
|
lastgoal = lastgoal->next;
|
||||||
}
|
}
|
||||||
lastgoal->name = 0;
|
lastgoal->name = 0;
|
||||||
@ -2075,7 +2083,7 @@ decode_switches (argc, argv, env)
|
|||||||
|
|
||||||
case positive_int:
|
case positive_int:
|
||||||
if (optarg == 0 && argc > optind
|
if (optarg == 0 && argc > optind
|
||||||
&& isdigit (argv[optind][0]))
|
&& ISDIGIT (argv[optind][0]))
|
||||||
optarg = argv[optind++];
|
optarg = argv[optind++];
|
||||||
|
|
||||||
if (!doit)
|
if (!doit)
|
||||||
@ -2087,8 +2095,7 @@ decode_switches (argc, argv, env)
|
|||||||
if (i < 1)
|
if (i < 1)
|
||||||
{
|
{
|
||||||
if (doit)
|
if (doit)
|
||||||
error (NILF, _("the `-%c' option requires a \
|
error (NILF, _("the `-%c' option requires a positive integral argument"),
|
||||||
positive integral argument"),
|
|
||||||
cs->c);
|
cs->c);
|
||||||
bad = 1;
|
bad = 1;
|
||||||
}
|
}
|
||||||
@ -2103,7 +2110,7 @@ positive integral argument"),
|
|||||||
#ifndef NO_FLOAT
|
#ifndef NO_FLOAT
|
||||||
case floating:
|
case floating:
|
||||||
if (optarg == 0 && optind < argc
|
if (optarg == 0 && optind < argc
|
||||||
&& (isdigit (argv[optind][0]) || argv[optind][0] == '.'))
|
&& (ISDIGIT (argv[optind][0]) || argv[optind][0] == '.'))
|
||||||
optarg = argv[optind++];
|
optarg = argv[optind++];
|
||||||
|
|
||||||
if (doit)
|
if (doit)
|
||||||
|
11
make.h
11
make.h
@ -299,6 +299,17 @@ extern char *alloca ();
|
|||||||
# endif /* HAVE_ALLOCA_H. */
|
# endif /* HAVE_ALLOCA_H. */
|
||||||
#endif /* GCC. */
|
#endif /* GCC. */
|
||||||
|
|
||||||
|
/* ISDIGIT offers the following features:
|
||||||
|
- Its arg may be any int or unsigned int; it need not be an unsigned char.
|
||||||
|
- It's guaranteed to evaluate its argument exactly once.
|
||||||
|
NOTE! Make relies on this behavior, don't change it!
|
||||||
|
- It's typically faster.
|
||||||
|
Posix 1003.2-1992 section 2.5.2.1 page 50 lines 1556-1558 says that
|
||||||
|
only '0' through '9' are digits. Prefer ISDIGIT to isdigit() unless
|
||||||
|
it's important to use the locale's definition of `digit' even when the
|
||||||
|
host does not conform to Posix. */
|
||||||
|
#define ISDIGIT(c) ((unsigned) (c) - '0' <= 9)
|
||||||
|
|
||||||
#ifndef iAPX286
|
#ifndef iAPX286
|
||||||
# define streq(a, b) \
|
# define streq(a, b) \
|
||||||
((a) == (b) || \
|
((a) == (b) || \
|
||||||
|
@ -954,7 +954,7 @@ print_variable (v, prefix)
|
|||||||
register struct variable *v;
|
register struct variable *v;
|
||||||
char *prefix;
|
char *prefix;
|
||||||
{
|
{
|
||||||
char *origin;
|
const char *origin;
|
||||||
|
|
||||||
switch (v->origin)
|
switch (v->origin)
|
||||||
{
|
{
|
||||||
@ -982,7 +982,6 @@ print_variable (v, prefix)
|
|||||||
case o_invalid:
|
case o_invalid:
|
||||||
default:
|
default:
|
||||||
abort ();
|
abort ();
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
printf ("# %s\n", origin);
|
printf ("# %s\n", origin);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user