From 3e6f48b444d890fd9bde802e35387e27eba33b2d Mon Sep 17 00:00:00 2001 From: Paul Smith Date: Tue, 20 Jun 2000 05:48:40 +0000 Subject: * More updates and fixes. --- ChangeLog | 23 +++++++++++++ NEWS | 5 +++ acconfig.h | 11 ------- acinclude.m4 | 89 --------------------------------------------------- config.ami.template | 4 +++ config.h-vms.template | 4 +++ config.h.W32.template | 4 +++ configure.in | 1 - file.c | 30 ++++++----------- filedef.h | 7 ---- function.c | 2 -- implicit.c | 1 - make.texinfo | 16 +++++---- misc.c | 1 + remake.c | 3 ++ 15 files changed, 63 insertions(+), 138 deletions(-) diff --git a/ChangeLog b/ChangeLog index b88026b..db0a7c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,28 @@ 2000-06-19 Paul D. Smith + * config.h-vms.template: #define uintmax_t for this system. + * config.ami.template: Ditto. + * config.h.W32.template: Ditto. + + * configure.in: We don't use select(2) anymore, so don't bother + checking for it. + * acconfig.h: Ditto. + * acinclude.m4: Ditto. + + * file.c (all_secondary): New static global; if 1 it means + .SECONDARY with no prerequisites was seen in the makefile. + (snap_deps): Set it appropriately. + (remove_intermediates): Check it. + (num_intermediates): Remove this global, it's not used anywhere. + (considered): Move this to remake.c and make it static. + + * NEWS: Document the change to .SECONDARY. + * make.texinfo (Special Targets): Document the change to .SECONDARY. + + * implicit.c (pattern_search): Remove the increment of + num_intermediates; it's not used. + * filedef.h: Remove num_intermediates and considered. + * function.c (handle_function): If the last argument was empty, we were pretending it didn't exist rather than providing an empty value. Keep looking until we're past the end, not just at the end. diff --git a/NEWS b/NEWS index ef11308..e20ec54 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,11 @@ Please send GNU make bug reports to . See the README file and the GNU make manual for details on sending bug reports. +Version 3.79.1 + +* .SECONDARY with no prerequisites now causes all targets to be treated + as .SECONDARY, not just those listed in the makefile. + Version 3.79 * GNU make optionally supports internationalization and locales via the diff --git a/acconfig.h b/acconfig.h index c656057..7e11f17 100644 --- a/acconfig.h +++ b/acconfig.h @@ -26,14 +26,3 @@ /* Define to `unsigned long' or `unsigned long long' if doesn't define. */ #undef uintmax_t - -/* These are for AC_FUNC_SELECT */ - -/* Define if the system doesn't provide fd_set. */ -#undef fd_set - -/* Define the type of the first arg to select(). */ -#undef fd_set_size_t - -/* Define this if select() args need to be cast away from fd_set (HP-UX). */ -#undef SELECT_FD_SET_CAST diff --git a/acinclude.m4 b/acinclude.m4 index 53b77cc..8acc895 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -298,95 +298,6 @@ AC_DEFUN(jm_AC_TYPE_UINTMAX_T, ]) -dnl --------------------------------------------------------------------------- -dnl From Steve Robbins - -dnl From a proposed change made on the autoconf list on 2 Feb 1999 -dnl http://sourceware.cygnus.com/ml/autoconf/1999-02/msg00001.html -dnl Patch for AIX 3.2 by Lars Hecking on 17 May 1999 - -AC_DEFUN(AC_FUNC_SELECT, -[AC_CHECK_FUNCS(select) -if test "$ac_cv_func_select" = yes; then - AC_CHECK_HEADERS(unistd.h sys/types.h sys/time.h sys/select.h sys/socket.h) - AC_MSG_CHECKING([argument types of select()]) - AC_CACHE_VAL(ac_cv_type_fd_set_size_t,dnl - [AC_CACHE_VAL(ac_cv_type_fd_set,dnl - [for ac_cv_type_fd_set in 'fd_set' 'int' 'void'; do - for ac_cv_type_fd_set_size_t in 'int' 'size_t' 'unsigned long' 'unsigned'; do - for ac_type_timeval in 'struct timeval' 'const struct timeval'; do - AC_TRY_COMPILE(dnl -[#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif], -[#ifdef __STDC__ -extern select ($ac_cv_type_fd_set_size_t, - $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, $ac_cv_type_fd_set *, - $ac_type_timeval *); -#else -extern select (); - $ac_cv_type_fd_set_size_t s; - $ac_cv_type_fd_set *p; - $ac_type_timeval *t; -#endif], -[ac_found=yes ; break 3],ac_found=no) - done - done - done - ])dnl AC_CACHE_VAL - ])dnl AC_CACHE_VAL - if test "$ac_found" = no; then - AC_MSG_ERROR([can't determine argument types]) - fi - - AC_MSG_RESULT([select($ac_cv_type_fd_set_size_t,$ac_cv_type_fd_set *,...)]) - AC_DEFINE_UNQUOTED(fd_set_size_t, $ac_cv_type_fd_set_size_t) - ac_cast= - if test "$ac_cv_type_fd_set" != fd_set; then - # Arguments 2-4 are not fd_set. Some weirdo systems use fd_set type for - # FD_SET macros, but insist that you cast the argument to select. I don't - # understand why that might be, but it means we cannot define fd_set. - AC_EGREP_CPP(dnl -changequote(<<,>>)dnl -<<(^|[^a-zA-Z_0-9])fd_set[^a-zA-Z_0-9]>>dnl -changequote([,]),dnl -[#ifdef HAVE_SYS_TIME_H -#include -#endif -#ifdef HAVE_SYS_TYPES_H -#include -#endif -#ifdef HAVE_UNISTD_H -#include -#endif -#ifdef HAVE_SYS_SELECT_H -#include -#endif -#ifdef HAVE_SYS_SOCKET_H -#include -#endif],dnl - # We found fd_set type in a header, need special cast - ac_cast="($ac_cv_type_fd_set *)",dnl - # No fd_set type; it is safe to define it - AC_DEFINE_UNQUOTED(fd_set,$ac_cv_type_fd_set)) - fi - AC_DEFINE_UNQUOTED(SELECT_FD_SET_CAST,$ac_cast) -fi -]) - - # The following is taken from automake 1.4, # except that it prefers the compiler option -Ae to "-Aa -D_HPUX_SOURCE" # because only the former supports 64-bit integral types on HP-UX 10.20. diff --git a/config.ami.template b/config.ami.template index 65bda1e..c0548b2 100644 --- a/config.ami.template +++ b/config.ami.template @@ -26,6 +26,10 @@ /* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* #undef GETLOADAVG_PRIVILEGED */ +/* Define to `unsigned long' or `unsigned long long' + if doesn't define. */ +#define uintmax_t unsigned long + /* Define to `int' if doesn't define. */ #define gid_t int diff --git a/config.h-vms.template b/config.h-vms.template index 2d060bb..1dbf04c 100644 --- a/config.h-vms.template +++ b/config.h-vms.template @@ -50,6 +50,10 @@ /* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* #undef GETLOADAVG_PRIVILEGED */ +/* Define to `unsigned long' or `unsigned long long' + if doesn't define. */ +#define uintmax_t unsigned long + /* Define to `int' if doesn't define. */ /* #undef gid_t */ diff --git a/config.h.W32.template b/config.h.W32.template index 53c0e07..606c93c 100644 --- a/config.h.W32.template +++ b/config.h.W32.template @@ -26,6 +26,10 @@ /* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* #undef GETLOADAVG_PRIVILEGED */ +/* Define to `unsigned long' or `unsigned long long' + if doesn't define. */ +#define uintmax_t unsigned long long + /* Define to `int' if doesn't define. */ #undef gid_t #define gid_t int diff --git a/configure.in b/configure.in index 2388328..2f61d24 100644 --- a/configure.in +++ b/configure.in @@ -102,7 +102,6 @@ AC_FUNC_VPRINTF AC_FUNC_STRCOLL AC_FUNC_CLOSEDIR_VOID AC_FUNC_SETVBUF_REVERSED -AC_FUNC_SELECT AC_CHECK_LIB(kstat, kstat_open) dnl _Must_ come before AC_FUNC_GETLOADAVG. AC_CHECK_FUNCS(pstat_getdynamic) dnl Supposedly in AC_FUNC_GETLOADAVG, but...? diff --git a/file.c b/file.c index ede6859..90cb873 100644 --- a/file.c +++ b/file.c @@ -35,13 +35,8 @@ Boston, MA 02111-1307, USA. */ #endif static struct file *files[FILE_BUCKETS]; -/* Number of files with the `intermediate' flag set. */ - -unsigned int num_intermediates = 0; - -/* Current value for pruning the scan of the goal chain (toggle 0/1). */ - -unsigned int considered = 0; +/* Whether or not .SECONDARY with no prerequisites was given. */ +static int all_secondary = 0; /* Access the hash table of all file records. lookup_file given a name, return the struct file * for that name, @@ -385,8 +380,10 @@ remove_intermediates (sig) register struct file *f; char doneany; - if (question_flag || touch_flag) + /* If there's no way we will ever remove anything anyway, punt early. */ + if (question_flag || touch_flag || all_secondary) return; + if (sig && just_print_flag) return; @@ -500,19 +497,12 @@ snap_deps () but unlike real intermediate files, these are not deleted after make finishes. */ if (f->deps) - { - for (d = f->deps; d != 0; d = d->next) - for (f2 = d->file; f2 != 0; f2 = f2->prev) - f2->intermediate = f2->secondary = 1; - } + for (d = f->deps; d != 0; d = d->next) + for (f2 = d->file; f2 != 0; f2 = f2->prev) + f2->intermediate = f2->secondary = 1; /* .SECONDARY with no deps listed marks *all* files that way. */ else - { - int i; - for (i = 0; i < FILE_BUCKETS; i++) - for (f2 = files[i]; f2; f2= f2->next) - f2->intermediate = f2->secondary = 1; - } + all_secondary = 1; } f = lookup_file (".EXPORT_ALL_VARIABLES"); @@ -586,7 +576,7 @@ file_timestamp_cons (fname, s, ns) error (NILF, _("%s: Timestamp out of range; substituting %s"), fname ? fname : _("Current time"), buf); } - + return ts; } diff --git a/filedef.h b/filedef.h index 5743d6a..68c72de 100644 --- a/filedef.h +++ b/filedef.h @@ -94,13 +94,6 @@ struct file considered on current scan of goal chain */ }; -/* Number of intermediate files entered. */ - -extern unsigned int num_intermediates; - -/* Current value for pruning the scan of the goal chain (toggle 0/1). */ - -extern unsigned int considered; extern struct file *default_goal_file, *suffix_file, *default_file; diff --git a/function.c b/function.c index 5d15ff6..8b6895c 100644 --- a/function.c +++ b/function.c @@ -1776,8 +1776,6 @@ handle_function (op, stringp) end = beg + len; } - p = beg; - nargs = 0; for (p=beg, nargs=0; p <= end; ++argvp) { char *next; diff --git a/implicit.c b/implicit.c index 15c5487..cce1795 100644 --- a/implicit.c +++ b/implicit.c @@ -543,7 +543,6 @@ pattern_search (file, archive, depth, recursions) dep->name = 0; dep->file->tried_implicit |= dep->changed; } - num_intermediates++; } dep = (struct dep *) xmalloc (sizeof (struct dep)); diff --git a/make.texinfo b/make.texinfo index 7bbd1d2..d6434cb 100644 --- a/make.texinfo +++ b/make.texinfo @@ -2396,10 +2396,11 @@ these commands executed on its behalf. @xref{Implicit Rule Search, The targets which @code{.PRECIOUS} depends on are given the following special treatment: if @code{make} is killed or interrupted during the execution of their commands, the target is not deleted. -@xref{Interrupts, ,Interrupting or Killing @code{make}}. -Also, if the target is an intermediate file, it will not be deleted -after it is no longer needed, as is normally done. -@xref{Chained Rules, ,Chains of Implicit Rules}. +@xref{Interrupts, ,Interrupting or Killing @code{make}}. Also, if the +target is an intermediate file, it will not be deleted after it is no +longer needed, as is normally done. @xref{Chained Rules, ,Chains of +Implicit Rules}. In this latter respect it overlaps with the +@code{.SECONDARY} special target. You can also list the target pattern of an implicit rule (such as @samp{%.o}) as a prerequisite file of the special target @code{.PRECIOUS} @@ -2423,8 +2424,9 @@ The targets which @code{.SECONDARY} depends on are treated as intermediate files, except that they are never automatically deleted. @xref{Chained Rules, ,Chains of Implicit Rules}. -@code{.SECONDARY} with no prerequisites marks all file targets mentioned -in the makefile as secondary. +@code{.SECONDARY} with no prerequisites causes all targets to be treated +as secondary (i.e., no target is removed because it is considered +intermediate). @findex .DELETE_ON_ERROR @item .DELETE_ON_ERROR @@ -6829,7 +6831,7 @@ space-separated. @table @code @item a (@i{all}) -All types of debugging output is enabled. This is equivalent to using +All types of debugging output are enabled. This is equivalent to using @samp{-d}. @item b (@i{basic}) diff --git a/misc.c b/misc.c index 98dc7a9..276706e 100644 --- a/misc.c +++ b/misc.c @@ -49,6 +49,7 @@ Boston, MA 02111-1307, USA. */ # define va_alist a1, a2, a3, a4, a5, a6, a7, a8 # define va_dcl char *a1, *a2, *a3, *a4, *a5, *a6, *a7, *a8; # define VA_START(args, lastarg) +# define VA_PRINTF(fp, lastarg, args) fprintf((fp), (lastarg), va_alist) # define VA_END(args) #endif diff --git a/remake.c b/remake.c index d7d7102..1ea0df2 100644 --- a/remake.c +++ b/remake.c @@ -58,6 +58,9 @@ extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth)); /* Incremented when a command is started (under -n, when one would be). */ unsigned int commands_started = 0; +/* Current value for pruning the scan of the goal chain (toggle 0/1). */ +static unsigned int considered; + static int update_file PARAMS ((struct file *file, unsigned int depth)); static int update_file_1 PARAMS ((struct file *file, unsigned int depth)); static int check_dep PARAMS ((struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int *must_make_ptr)); -- cgit v1.2.3