Compare commits

...

23 Commits

Author SHA1 Message Date
Roland McGrath
f6d5cdba19 (main): Pass missing arg to tmpnam. 1995-02-22 03:19:53 +00:00
Roland McGrath
fcb29e5e96 Check for strsignal. 1995-02-22 03:18:18 +00:00
Roland McGrath
d7a043b46c (child_error): Use strsignal. 1995-02-22 03:17:54 +00:00
Roland McGrath
d85ab5953a (main): Don't call signame_init #ifdef HAVE_STRSIGNAL. 1995-02-22 03:17:22 +00:00
Roland McGrath
93dd485ab6 (strsignal): Declare it. 1995-02-22 03:15:51 +00:00
Roland McGrath
5c350f4fd5 [! HAVE_STRSIGNAL] (strsignal): New function. 1995-02-22 03:13:12 +00:00
Roland McGrath
514c4bac33 (strerror): Fix swapped args in sprintf. 1995-02-22 03:10:16 +00:00
Roland McGrath
8f24715a10 (CFLAGS, LDFLAGS): Don't set these variables. 1995-02-13 16:50:03 +00:00
Roland McGrath
4c7f18cd09 (print_version): Add 95 to copyright years. 1995-02-11 01:39:58 +00:00
Roland McGrath
c5af4810ff (start_job_command): Remember to call notice_finsihed_file under -n when
not recursing.  To do this, consolidate that code under the empty command
case and goto there for the -n case.
1995-02-10 23:44:03 +00:00
Richard M. Stallman
551c4322cb real-clean renamed to maintainer-clean.
Description changed too.
1995-02-07 23:45:48 +00:00
Roland McGrath
e33c50b1e2 [! STDC_HEADERS]: Don't declare qsort. Sun headers declare it int. 1995-02-07 18:36:00 +00:00
Roland McGrath
bc1e6b66f1 (read_makefile): For bogus line starting with tab, ignore it if blank after
removing comments.
1995-02-06 22:58:07 +00:00
Roland McGrath
bbd5e695f5 Cast results of alloca' to char *'. 1995-02-06 22:37:36 +00:00
Roland McGrath
f3cfccf0b8 Cast results of alloca' to char *' in two places. 1995-02-06 22:36:43 +00:00
Roland McGrath
016e1beef5 Check for mktemp. 1995-02-05 23:50:12 +00:00
Roland McGrath
21a8ec0d72 (main) [! HAVE_MKTEMP]: Use tmpnam instead of mktemp. 1995-02-05 23:49:40 +00:00
Roland McGrath
fecd9e661a (make_cv_sysconf_open_max): New check for `sysconf (_SC_OPEN_MAX)'. 1995-02-05 23:45:49 +00:00
Roland McGrath
2914c705e5 Added #undef HAVE_SYSCONF_OPEN_MAX. 1995-02-05 23:36:04 +00:00
Roland McGrath
3f506aaf90 [HAVE_SYSCONF_OPEN_MAX] (getdtablesize): Define as macro using sysconf. 1995-02-05 23:35:39 +00:00
Roland McGrath
75ea6c3ce2 (update_file_1): When !MUST_MAKE, don't set FILE->update_status to zero
before calling notice_finished_file.
(notice_finished_file): Touch only when FILE->update_status is zero.
(remake_file): Set FILE->update_status to zero after not calling
execute_file_command and deciding to touch instead.
1995-01-27 09:42:00 +00:00
Roland McGrath
3fb9ebf83f (debug_signal_handler): New function; toggles debug_flag.
(main): Handle SIGUSR1 with that.
1995-01-26 06:29:18 +00:00
Roland McGrath
b4890bdb1c (realclean): Remove Info files. 1995-01-16 20:46:50 +00:00
13 changed files with 123 additions and 51 deletions

View File

@@ -12,3 +12,6 @@
/* Define this if you have the `union wait' type in <sys/wait.h>. */ /* Define this if you have the `union wait' type in <sys/wait.h>. */
#undef HAVE_UNION_WAIT #undef HAVE_UNION_WAIT
/* Define this if the POSIX.1 call `sysconf (_SC_OPEN_MAX)' works properly. */
#undef HAVE_SYSCONF_OPEN_MAX

View File

@@ -249,6 +249,7 @@ distclean: clean glob-realclean
-rm -f make.?? make.??s make.log make.toc make.*aux -rm -f make.?? make.??s make.log make.toc make.*aux
-rm -f loadavg.c -rm -f loadavg.c
realclean: distclean realclean: distclean
-rm -f make.info*
mostlyclean: clean mostlyclean: clean
.PHONY: glob-clean glob-realclean .PHONY: glob-clean glob-realclean

View File

@@ -5,10 +5,6 @@ AC_INIT(vpath.c)dnl dnl A distinctive file to look for in srcdir.
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory. AC_CONFIG_SUBDIRS(glob) dnl Run configure in glob subdirectory.
# We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS=-g AC_SUBST(CFLAGS)
test -z "$LDFLAGS" && LDFLAGS=-g AC_SUBST(LDFLAGS)
AC_PROG_MAKE_SET AC_PROG_MAKE_SET
AC_PROG_CC AC_PROG_CC
AC_PROG_INSTALL AC_PROG_INSTALL
@@ -43,9 +39,9 @@ changequote([,])dnl
fi fi
AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl AC_MSG_RESULT($ac_cv_check_symbol_$1)])dnl
AC_CHECK_FUNCS(getdtablesize psignal \ AC_CHECK_FUNCS(getdtablesize psignal mktemp \
dup2 getcwd sigsetmask getgroups setlinebuf \ dup2 getcwd sigsetmask getgroups setlinebuf \
seteuid setegid setreuid setregid strerror) seteuid setegid setreuid setregid strerror strsignal)
AC_CHECK_SYMBOL(sys_siglist) AC_CHECK_SYMBOL(sys_siglist)
AC_CHECK_SYMBOL(_sys_siglist) AC_CHECK_SYMBOL(_sys_siglist)
AC_FUNC_ALLOCA AC_FUNC_ALLOCA
@@ -54,6 +50,17 @@ AC_FUNC_SETVBUF_REVERSED
AC_FUNC_GETLOADAVG AC_FUNC_GETLOADAVG
AC_FUNC_STRCOLL AC_FUNC_STRCOLL
if test $ac_cv_func_getdtablesize = no; then
AC_MSG_CHECKING(for sysconf (_SC_OPEN_MAX))
AC_CACHE_VAL(make_cv_sysconf_open_max, [dnl
AC_TRY_LINK([#include <unistd.h>], [int max = sysconf (_SC_OPEN_MAX);],
[make_cv_sysconf_open_max=yes], [make_cv_sysconf_open_max=no])])
if test $make_cv_sysconf_open_max = yes; then
AC_DEFINE(HAVE_SYSCONF_OPEN_MAX)
fi
AC_MSG_RESULT($make_cv_sysconf_open_max)
fi
# Check out the wait reality. # Check out the wait reality.
AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3) AC_CHECK_HEADERS(sys/wait.h) AC_CHECK_FUNCS(waitpid wait3)
AC_MSG_CHECKING(for union wait) AC_MSG_CHECKING(for union wait)

View File

@@ -292,7 +292,8 @@ variable_expand (line)
} }
else else
{ {
pattern = alloca (subst_end - subst_beg + 1); pattern = (char *) alloca (subst_end - subst_beg
+ 1);
bcopy (subst_beg, pattern, subst_end - subst_beg); bcopy (subst_beg, pattern, subst_end - subst_beg);
pattern[subst_end - subst_beg] = '\0'; pattern[subst_end - subst_beg] = '\0';
} }
@@ -307,7 +308,8 @@ variable_expand (line)
} }
else else
{ {
replace = alloca (replace_end - replace_beg replace = (char *) alloca (replace_end
- replace_beg
+ 1); + 1);
bcopy (replace_beg, replace, bcopy (replace_beg, replace,
replace_end - replace_beg); replace_end - replace_beg);

19
job.c
View File

@@ -122,6 +122,9 @@ extern int setgid (), getgid ();
#ifdef HAVE_GETDTABLESIZE #ifdef HAVE_GETDTABLESIZE
extern int getdtablesize (); extern int getdtablesize ();
#else #else
#ifdef HAVE_SYSCONF_OPEN_MAX
#define getdtablesize() ((int) sysconf (_SC_OPEN_MAX))
#else
#include <sys/param.h> #include <sys/param.h>
#define getdtablesize() NOFILE #define getdtablesize() NOFILE
#if !defined (NOFILE) && defined (NOFILES_MAX) #if !defined (NOFILE) && defined (NOFILES_MAX)
@@ -130,6 +133,7 @@ extern int getdtablesize ();
#endif #endif
#endif #endif
#endif #endif
#endif
extern int getloadavg (); extern int getloadavg ();
extern int start_remote_job_p (); extern int start_remote_job_p ();
@@ -170,14 +174,9 @@ child_error (target_name, exit_code, exit_sig, coredump, ignored)
"*** [%s] Error %d", "*** [%s] Error %d",
target_name, exit_code); target_name, exit_code);
else else
{
char *coredump_string = coredump ? " (core dumped)" : "";
if (exit_sig > 0 && exit_sig < NSIG)
error ("*** [%s] %s%s", error ("*** [%s] %s%s",
target_name, sys_siglist[exit_sig], coredump_string); target_name, strsignal (exit_sig),
else coredump ? " (core dumped)" : "");
error ("*** [%s] Signal %d%s", target_name, exit_sig, coredump_string);
}
} }
static unsigned int dead_children = 0; static unsigned int dead_children = 0;
@@ -588,6 +587,7 @@ start_job_command (child)
if (argv == 0) if (argv == 0)
{ {
next_command:
/* This line has no commands. Go to the next. */ /* This line has no commands. Go to the next. */
if (job_next_command (child)) if (job_next_command (child))
start_job_command (child); start_job_command (child);
@@ -620,10 +620,7 @@ start_job_command (child)
{ {
free (argv[0]); free (argv[0]);
free ((char *) argv); free ((char *) argv);
if (job_next_command (child)) goto next_command;
start_job_command (child);
child->file->update_status = 0;
return;
} }
/* Flush the output streams so they won't have things written twice. */ /* Flush the output streams so they won't have things written twice. */

27
main.c
View File

@@ -397,6 +397,15 @@ enter_command_line_file (name)
return enter_file (savestring (name, strlen (name))); return enter_file (savestring (name, strlen (name)));
} }
/* Toggle -d on receipt of SIGUSR1. */
static RETSIGTYPE
debug_signal_handler (sig)
int sig;
{
debug_flag = ! debug_flag;
}
int int
main (argc, argv, envp) main (argc, argv, envp)
int argc; int argc;
@@ -415,7 +424,7 @@ main (argc, argv, envp)
reading_filename = 0; reading_filename = 0;
reading_lineno_ptr = 0; reading_lineno_ptr = 0;
#ifndef HAVE_SYS_SIGLIST #if !defined (HAVE_STRSIGNAL) && !defined (HAVE_SYS_SIGLIST)
signame_init (); signame_init ();
#endif #endif
@@ -589,7 +598,7 @@ main (argc, argv, envp)
} }
/* Now allocate a buffer big enough and fill it. */ /* Now allocate a buffer big enough and fill it. */
p = value = alloca (len); p = value = (char *) alloca (len);
for (cv = command_variables; cv != 0; cv = cv->next) for (cv = command_variables; cv != 0; cv = cv->next)
{ {
v = cv->variable; v = cv->variable;
@@ -691,11 +700,16 @@ main (argc, argv, envp)
/* This makefile is standard input. Since we may re-exec /* This makefile is standard input. Since we may re-exec
and thus re-read the makefiles, we read standard input and thus re-read the makefiles, we read standard input
into a temporary file and read from that. */ into a temporary file and read from that. */
static char name[] = "/tmp/GmXXXXXX";
FILE *outfile; FILE *outfile;
/* Make a unique filename. */ /* Make a unique filename. */
#ifdef HAVE_MKTEMP
static char name[] = "/tmp/GmXXXXXX";
(void) mktemp (name); (void) mktemp (name);
#else
static char name[L_tmpnam];
(void) tmpnam (name);
#endif
outfile = fopen (name, "w"); outfile = fopen (name, "w");
if (outfile == 0) if (outfile == 0)
@@ -744,6 +758,11 @@ main (argc, argv, envp)
(void) signal (SIGCLD, child_handler); (void) signal (SIGCLD, child_handler);
#endif #endif
/* Let the user send us SIGUSR1 to toggle the -d flag during the run. */
#ifdef SIGUSR1
(void) signal (SIGUSR1, debug_signal_handler);
#endif
/* Define the initial list of suffixes for old-style rules. */ /* Define the initial list of suffixes for old-style rules. */
set_default_suffixes (); set_default_suffixes ();
@@ -1837,7 +1856,7 @@ print_version ()
printf ("-%s", remote_description); printf ("-%s", remote_description);
printf (", by Richard Stallman and Roland McGrath.\n\ printf (", by Richard Stallman and Roland McGrath.\n\
%sCopyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.\n\ %sCopyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc.\n\
%sThis is free software; see the source for copying conditions.\n\ %sThis is free software; see the source for copying conditions.\n\
%sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\ %sThere is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A\n\
%sPARTICULAR PURPOSE.\n\n", precede, precede, precede, precede); %sPARTICULAR PURPOSE.\n\n", precede, precede, precede, precede);

View File

@@ -236,17 +236,34 @@ normally don't want to recompile. For example, the @samp{mostlyclean}
target for GCC does not delete @file{libgcc.a}, because recompiling it target for GCC does not delete @file{libgcc.a}, because recompiling it
is rarely necessary and takes a lot of time. is rarely necessary and takes a lot of time.
@item realclean @item maintainer-clean
Delete everything from the current directory that can be reconstructed Delete almost everything from the current directory that can be
with this Makefile. This typically includes everything deleted by reconstructed with this Makefile. This typically includes everything
@code{distclean}, plus more: C source files produced by Bison, tags tables, deleted by @code{distclean}, plus more: C source files produced by
Info files, and so on. Bison, tags tables, Info files, and so on.
One exception, however: @samp{make realclean} should not delete The reason we say ``almost everything'' is that @samp{make
@file{configure} even if @file{configure} can be remade using a rule in maintainer-clean} should not delete @file{configure} even if
the Makefile. More generally, @samp{make realclean} should not delete @file{configure} can be remade using a rule in the Makefile. More
anything that needs to exist in order to run @file{configure} generally, @samp{make maintainer-clean} should not delete anything that
and then begin to build the program. needs to exist in order to run @file{configure} and then begin to build
the program. This is the only exception; @code{maintainer-clean} should
delete everything else that can be rebuilt.
The @samp{maintainer-clean} is intended to be used by a maintainer of
the package, not by ordinary users. You may need special tools to
reconstruct some of the files that @samp{make maintainer-clean} deletes.
Since these files are normally included in the distribution, we don't
take care to make them easy to reconstruct. If you find you need to
unpack the full distribution again, don't blame us.
To help make users aware of this, the commands for
@code{maintainer-clean} should start with these two:
@example
@@echo "This command is intended for maintainers to use;"
@@echo "it deletes files that may require special tools to rebuild."
@end example
@item TAGS @item TAGS
Update a tags table for this program. Update a tags table for this program.

3
make.h
View File

@@ -1,5 +1,5 @@
/* Miscellaneous global declarations and portability cruft for GNU Make. /* Miscellaneous global declarations and portability cruft for GNU Make.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 95 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify GNU Make is free software; you can redistribute it and/or modify
@@ -173,7 +173,6 @@ extern unsigned int get_path_max ();
extern char *malloc (), *realloc (); extern char *malloc (), *realloc ();
extern void free (); extern void free ();
extern void qsort ();
extern void abort (), exit (); extern void abort (), exit ();
#endif /* Standard headers. */ #endif /* Standard headers. */

4
misc.c
View File

@@ -1,5 +1,5 @@
/* Miscellaneous generic support functions for GNU Make. /* Miscellaneous generic support functions for GNU Make.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify GNU Make is free software; you can redistribute it and/or modify
@@ -260,7 +260,7 @@ strerror (errnum)
if (errno < sys_nerr) if (errno < sys_nerr)
return sys_errlist[errnum]; return sys_errlist[errnum];
sprintf ("Unknown error %d", buf, errnum); sprintf (buf, "Unknown error %d", errnum);
return buf; return buf;
} }
#endif #endif

4
read.c
View File

@@ -1,5 +1,5 @@
/* Reading and parsing of makefiles for GNU Make. /* Reading and parsing of makefiles for GNU Make.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify GNU Make is free software; you can redistribute it and/or modify
@@ -631,7 +631,7 @@ read_makefile (filename, flags)
; ;
else if (lb.buffer[0] == '\t') else if (lb.buffer[0] == '\t')
{ {
p = lb.buffer; p = collapsed; /* Ignore comments. */
while (isblank (*p)) while (isblank (*p))
++p; ++p;
if (*p == '\0') if (*p == '\0')

View File

@@ -1,5 +1,5 @@
/* Basic dependency engine for GNU Make. /* Basic dependency engine for GNU Make.
Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc. Copyright (C) 1988, 89, 90, 91, 92, 93, 94, 1995 Free Software Foundation, Inc.
This file is part of GNU Make. This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify GNU Make is free software; you can redistribute it and/or modify
@@ -556,7 +556,6 @@ update_file_1 (file, depth)
if (!must_make) if (!must_make)
{ {
DEBUGPR ("No need to remake target `%s'.\n"); DEBUGPR ("No need to remake target `%s'.\n");
file->update_status = 0;
notice_finished_file (file); notice_finished_file (file);
return 0; return 0;
} }
@@ -605,12 +604,12 @@ notice_finished_file (file)
if (touch_flag if (touch_flag
/* The update status will be: /* The update status will be:
-1 if no commands were run; -1 if this target was not remade;
0 if some commands (+ or ${MAKE}) were run and won; 0 if 0 or more commands (+ or ${MAKE}) were run and won;
1 if some commands were run and lost. 1 if some commands were run and lost.
The only time we don't want to touch the target is if We touch the target if it has commands which either were not run
it had some recursive commands, and they lost. */ or won when they ran (i.e. status is 0). */
&& file->update_status != 1) && file->update_status == 0)
{ {
if (file->cmds != 0 && file->cmds->any_recurse) if (file->cmds != 0 && file->cmds->any_recurse)
{ {
@@ -854,6 +853,9 @@ remake_file (file)
execute_file_commands (file); execute_file_commands (file);
return; return;
} }
else
/* This tells notice_finished_file it is ok to touch the file. */
file->update_status = 0;
} }
/* This does the touching under -t. */ /* This does the touching under -t. */

View File

@@ -1,5 +1,5 @@
/* Convert between signal names and numbers. /* Convert between signal names and numbers.
Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc. Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -273,3 +273,20 @@ psignal (signal, message)
fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]); fprintf (stderr, "%s: %s\n", message, sys_siglist[signal]);
} }
#endif #endif
#ifndef HAVE_STRSIGNAL
/* Return the string associated with the signal number. */
char *
strsignal (signal)
int signal;
{
static char buf[] = "Signal 12345678901234567890";
if (signal > 0 || signal < NSIG)
return sys_siglist[signal];
sprintf (buf, "Signal %d", signal);
return buf;
}
#endif

View File

@@ -1,5 +1,5 @@
/* Convert between signal names and numbers. /* Convert between signal names and numbers.
Copyright (C) 1990, 1992, 1993 Free Software Foundation, Inc. Copyright (C) 1990, 1992, 1993, 1995 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by it under the terms of the GNU General Public License as published by
@@ -29,7 +29,7 @@ char *sig_abbrev (int number);
signal by that name. */ signal by that name. */
int sig_number (const char *abbrev); int sig_number (const char *abbrev);
/* Avoid conflicts with a system header file that might define these two. */ /* Avoid conflicts with a system header file that might define these three. */
#ifndef HAVE_PSIGNAL #ifndef HAVE_PSIGNAL
/* Print to standard error the name of SIGNAL, preceded by MESSAGE and /* Print to standard error the name of SIGNAL, preceded by MESSAGE and
@@ -37,6 +37,11 @@ int sig_number (const char *abbrev);
void psignal (int signal, const char *message); void psignal (int signal, const char *message);
#endif #endif
#ifndef HAVE_STRSIGNAL
/* Return the name of SIGNAL. */
char *strsignal (int signal);
#endif
#if !defined (HAVE_SYS_SIGLIST) #if !defined (HAVE_SYS_SIGLIST)
/* Names for signals from 0 to NSIG-1. */ /* Names for signals from 0 to NSIG-1. */
extern const char *sys_siglist[]; extern const char *sys_siglist[];
@@ -50,6 +55,9 @@ int sig_number ();
#if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_PSIGNAL) #if !defined (HAVE_SYS_SIGLIST) && !defined (HAVE_PSIGNAL)
void psignal (); void psignal ();
#endif #endif
#ifndef HAVE_STRSIGNAL
char *strsignal (int signal);
#endif
#if !defined (HAVE_SYS_SIGLIST) #if !defined (HAVE_SYS_SIGLIST)
extern char *sys_siglist[]; extern char *sys_siglist[];
#endif #endif