2000-06-19 Paul D. Smith <psmith@gnu.org>
+ * 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.
See the README file and the GNU make manual for details on sending bug
reports.
\f
+Version 3.79.1
+
+* .SECONDARY with no prerequisites now causes all targets to be treated
+ as .SECONDARY, not just those listed in the makefile.
+\f
Version 3.79
* GNU make optionally supports internationalization and locales via the
/* Define to `unsigned long' or `unsigned long long'
if <inttypes.h> 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
])
-dnl ---------------------------------------------------------------------------
-dnl From Steve Robbins <steve@nyongwa.montreal.qc.ca>
-
-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 <lhecking@nmrc.ucc.ie> 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 <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#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 <sys/time.h>
-#endif
-#ifdef HAVE_SYS_TYPES_H
-#include <sys/types.h>
-#endif
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#ifdef HAVE_SYS_SELECT_H
-#include <sys/select.h>
-#endif
-#ifdef HAVE_SYS_SOCKET_H
-#include <sys/socket.h>
-#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.
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
+/* Define to `unsigned long' or `unsigned long long'
+ if <inttypes.h> doesn't define. */
+#define uintmax_t unsigned long
+
/* Define to `int' if <sys/types.h> doesn't define. */
#define gid_t int
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
+/* Define to `unsigned long' or `unsigned long long'
+ if <inttypes.h> doesn't define. */
+#define uintmax_t unsigned long
+
/* Define to `int' if <sys/types.h> doesn't define. */
/* #undef gid_t */
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
/* #undef GETLOADAVG_PRIVILEGED */
+/* Define to `unsigned long' or `unsigned long long'
+ if <inttypes.h> doesn't define. */
+#define uintmax_t unsigned long long
+
/* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t
#define gid_t int
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...?
#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,
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;
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");
error (NILF, _("%s: Timestamp out of range; substituting %s"),
fname ? fname : _("Current time"), buf);
}
-
+
return ts;
}
\f
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;
end = beg + len;
}
- p = beg;
- nargs = 0;
for (p=beg, nargs=0; p <= end; ++argvp)
{
char *next;
dep->name = 0;
dep->file->tried_implicit |= dep->changed;
}
- num_intermediates++;
}
dep = (struct dep *) xmalloc (sizeof (struct dep));
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}
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
@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})
# 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
/* 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));