Various cleanups reported by people using the alpha release.
authorPaul Smith <psmith@gnu.org>
Mon, 8 Jul 2002 13:05:02 +0000 (13:05 +0000)
committerPaul Smith <psmith@gnu.org>
Mon, 8 Jul 2002 13:05:02 +0000 (13:05 +0000)
Incorporate "order-only" prerequisites patch.  Wrote a test for it.
The test shows what might be a bug in the code; I need to look at it
more closely (anyway it doesn't behave as I expected).  Also I haven't
done the docs yet.

16 files changed:
ChangeLog
Makefile.DOS.template
README.cvs
commands.c
config.h.W32.template
configh.dos.template
dep.h
dosbuild.bat
implicit.c
main.c
maintMakefile
po/LINGUAS
read.c
remake.c
rule.c
tests/scripts/features/order_only [new file with mode: 0644]

index 2e22c52676bb8101d913ad602f67151ec7ea6067..65ba46f99dba32e15fbcd96064e6d1859caafffc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,17 @@
+2002-07-08  Paul D. Smith  <psmith@gnu.org>
+
+       * maintMakefile: Add "update" targets for wget'ing the latest
+       versions of various external files.  Taken from Makefile.maint in
+       autoconf, etc.
+
+       * dosbuild.bat: Somehow we got _extra_ ^M's.  Remove them.
+       Reported by Eli Zaretskii  <eliz@is.elta.co.il>.
+
 2002-07-07  Paul D. Smith  <psmith@gnu.org>
 
+       * po/*.po: Remove.  We'll use wget to retrieve them at release
+       time.
+
        * variable.c (do_variable_definition) [W32]: On W32 using cmd
        rather than a shell you get an exception.  Make sure we look up
        the variable.  Patch provided by Eli Zaretskii <eliz@is.elta.co.il>.
        want to define our variables from evaluated makefile code in the
        global scope.
 
+2002-07-03  Greg McGary  <greg@mcgary.org>
+
+       * dep.h (struct dep) [ignore_mtime]: New member.
+       [changed]: convert to a bitfield.
+       * implicit.c (pattern_search): Zero ignore_mtime.
+       * main.c (main, handle_non_switch_argument): Likewise.
+       * rule.c (convert_suffix_rule): Likewise.
+       * read.c (read_all_makefiles, read_makefile, multi_glob): Likewise.
+       (read_makefile): Parse '|' in prerequisite list.
+        (uniquize_deps): Consider ignore_mtime when comparing deps.
+       * remake.c (update_file_1, check_dep): Don't force remake for
+       dependencies that have d->ignore_mtime.
+       * commands.c (FILE_LIST_SEPARATOR): New constant.
+        (set_file_variables): Don't include a
+       prerequisite in $+, $^ or $? if d->ignore_mtime.
+        Define $|.
+
 2002-06-18  Paul D. Smith  <psmith@gnu.org>
 
        * make.texinfo: Updates for next revision.  New date/rev/etc.
        MAKEFILE_LIST.
        (read_makefile): Add each makefile read in to this variable value.
 
+2002-05-18  Eli Zaretskii  <eliz@is.elta.co.il>
+
+        * Makefile.DOS.template: Tweak according to changes in the
+        distribution.  Add back the dependencies of *.o files.
+
+        * configh.dos.template: Synchronize with config.h.in.
+
 2002-05-09  Paul D. Smith  <psmith@gnu.org>
 
        * file.c (file_timestamp_now): Use K&R function declaration.
index 8819f1bceb02f2fdf2ffdc7dedebd5248830de63..2f9eff59196d8c91b4ebd17676182463b216c57d 100644 (file)
@@ -1,7 +1,7 @@
 # -*-Makefile-*- template for DJGPP
 # Makefile.in generated automatically by automake 1.2 from Makefile.am
 
-# Copyright (C) 1994, 1995-1998, 1999 Free Software Foundation, Inc.
+# Copyright (C) 1994, 1995-1998, 1999, 2002 Free Software Foundation, Inc.
 # This Makefile.DOS is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 
@@ -47,7 +47,11 @@ POST_INSTALL = :
 NORMAL_UNINSTALL = :
 PRE_UNINSTALL = :
 POST_UNINSTALL = :
+EXEEXT = .exe
+OBJEXT = o
+
 AR = ar
+AWK = gawk
 CC = gcc
 CPP = gcc -E
 LIBOBJS =
@@ -60,7 +64,7 @@ VERSION = %VERSION%
 
 AUTOMAKE_OPTIONS = 1.2
 
-bin_PROGRAMS = %PROGRAMS%
+bin_PROGRAMS = %PROGRAMS%$(EXEEXT)
 
 make_SOURCES = %SOURCES%
 # This should include the glob/ prefix
@@ -99,7 +103,7 @@ CFLAGS = -O2 -g
 COMPILE = $(CC) $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS)
 LINK = $(CC) $(CFLAGS) $(LDFLAGS) -o $@
 TEXI2DVI = texi2dvi
-TEXINFO_TEX = $(srcdir)/texinfo.tex
+TEXINFO_TEX = $(srcdir)/config/texinfo.tex
 INFO_DEPS = make.info
 DVIS = make.dvi
 TEXINFOS = make.texinfo
@@ -107,8 +111,7 @@ man1dir = $(mandir)/man1
 MANS = $(man_MANS)
 
 NROFF = nroff
-DIST_COMMON =  README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am  Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh.in config.h.in  configure configure.in getloadavg.c gettext.c install-sh missing mkinstalldirs  stamp-h.in texinfo.tex
-
+DIST_COMMON =  README ABOUT-NLS AUTHORS COPYING ChangeLog INSTALL Makefile.am  Makefile.in NEWS acconfig.h aclocal.m4 alloca.c build.sh-in config.h-in  configure configure.in getloadavg.c
 
 DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
 
@@ -121,7 +124,7 @@ HEADERS = $(wildcard $(srcdir)/*.h)
 default: all
 
 .SUFFIXES:
-.SUFFIXES: .S .c .dvi .info .o .ps .s .texi .texinfo .txi
+.SUFFIXES: .c .dvi .info .o .obj .ps .texinfo .tex
 
 mostlyclean-hdr:
 
@@ -153,17 +156,11 @@ uninstall-binPROGRAMS:
 .c.o:
        $(COMPILE) -c $<
 
-.s.o:
-       $(COMPILE) -c $<
-
-.S.o:
-       $(COMPILE) -c $<
-
 clean-noinstLIBRARIES:
        -test -z "$(noinst_LIBRARIES)" || rm -f $(noinst_LIBRARIES)
 
 mostlyclean-compile:
-       -rm -f *.o *.exe make.new core
+       -rm -f *.$(OBJEXT) *$(EXEEXT) make.new core
 
 clean-compile:
 
@@ -172,7 +169,7 @@ distclean-compile:
 
 maintainer-clean-compile:
 
-make: $(make_OBJECTS) $(make_DEPENDENCIES)
+make$(EXEEXT): $(make_OBJECTS) $(make_DEPENDENCIES)
        @command.com /c if exist make del make
        @command.com /c if exist make.exe del make.exe
        $(LINK) $(make_LDFLAGS) $(make_OBJECTS) $(make_LDADD) $(LIBS)
@@ -183,29 +180,19 @@ make.dvi: make.texinfo
 
 DVIPS = dvips
 
-.texi.info:
-       $(MAKEINFO) $(srcdir)/$< -o ./$@
-
-.texi.dvi:
-       TEXINPUTS="$(srcdir);$$TEXINPUTS"    MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
-
-.texi:
-       $(MAKEINFO) $(srcdir)/$< -o ./$@
-
 .texinfo.info:
-       $(MAKEINFO) $(srcdir)/$< -o ./$@
+       @command.com /c if exist make.info* del make.info*
+       @command.com /c if exist make.i* del make.i*
+       $(MAKEINFO) -I$(srcdir) $< -o ./$@
 
 .texinfo:
-       $(MAKEINFO) $(srcdir)/$< -o ./$@
+       @command.com /c if exist make.info* del make.info*
+       @command.com /c if exist make.i* del make.i*
+       $(MAKEINFO) -I$(srcdir) $< -o ./$@
 
 .texinfo.dvi:
        TEXINPUTS="$(srcdir);$$TEXINPUTS"    MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
 
-.txi.info:
-       $(MAKEINFO) $(srcdir)/$< -o ./$@
-
-.txi.dvi:
-       TEXINPUTS="$(srcdir);$$TEXINPUTS"    MAKEINFO='$(MAKEINFO) -I $(srcdir)' $(TEXI2DVI) $<
 
 .dvi.ps:
        $(DVIPS) $< -o $@
@@ -542,3 +529,40 @@ check-regression:
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
 # Otherwise a system limit (for SysV at least) may be exceeded.
 .NOEXPORT:
+
+# --------------- DEPENDENCIES
+ar.o: ar.c make.h config.h gettext.h filedef.h dep.h glob/fnmatch.h
+arscan.o: arscan.c make.h config.h gettext.h
+commands.o: commands.c make.h config.h gettext.h dep.h filedef.h \
+       variable.h job.h commands.h
+default.o: default.c make.h config.h gettext.h rule.h dep.h filedef.h \
+       job.h commands.h variable.h
+dir.o: dir.c make.h config.h gettext.h glob/glob.h
+expand.o: expand.c make.h config.h gettext.h filedef.h job.h commands.h \
+       variable.h rule.h
+file.o: file.c make.h config.h gettext.h dep.h filedef.h job.h \
+       commands.h variable.h debug.h
+function.o: function.c make.h config.h gettext.h filedef.h variable.h \
+       dep.h job.h commands.h debug.h
+getopt.o: getopt.c config.h gettext.h getopt.h
+getopt1.o: getopt1.c config.h getopt.h
+implicit.o: implicit.c make.h config.h gettext.h rule.h dep.h filedef.h \
+       debug.h
+job.o: job.c make.h config.h gettext.h job.h debug.h filedef.h \
+       commands.h variable.h
+main.o: main.c make.h config.h gettext.h dep.h filedef.h variable.h \
+       job.h commands.h rule.h debug.h getopt.h
+misc.o: misc.c make.h config.h gettext.h dep.h debug.h
+read.o: read.c make.h config.h gettext.h glob/glob.h dep.h filedef.h \
+       job.h commands.h variable.h rule.h debug.h
+remake.o: remake.c make.h config.h gettext.h filedef.h job.h commands.h \
+       dep.h variable.h debug.h
+remote-stub.o: remote-stub.c make.h config.h gettext.h filedef.h job.h \
+       commands.h
+rule.o: rule.c make.h config.h gettext.h dep.h filedef.h job.h \
+       commands.h variable.h rule.h
+signame.o: signame.c make.h config.h gettext.h
+variable.o: variable.c make.h config.h gettext.h dep.h filedef.h job.h \
+       commands.h variable.h rule.h
+version.o: version.c config.h
+vpath.o: vpath.c make.h config.h gettext.h filedef.h variable.h
index 96898e1892f2520ae521d655110a8797e2a782c9..a6f9c9ca35e799cc476cc3a63d383d55ef779ebe 100644 (file)
@@ -25,13 +25,11 @@ Building From CVS
 
 To build GNU make from CVS, you will need Autoconf 2.53 (or better),
 Automake 1.6.1 (or better), and Gettext 0.11.3-pre2 (or better), and any
-tools that those utilities require (GNU m4, Perl, etc.).
+tools that those utilities require (GNU m4, Perl, etc.).  You will also
+need a copy of wget.
 
 After checking out the code, you will need to perform these steps to get
-to the point where you can run "configure" then "make".
-
-Hopefully at some point in the (near) future this will all be obsolete
-and you can just run "autoreconf" and have it DTRT.
+to the point where you can run "make".
 
 
  1) $ autopoint
@@ -70,12 +68,23 @@ and you can just run "autoreconf" and have it DTRT.
     Generate a "configure" script from configure.in and acinclude.m4.
 
 
+ 6) $ ./configure
+
+    Generate a Makefile
+
+
+ 7) $ make update
+
+    Use wget to retrieve various other files that GNU make relies on,
+    but does not keep in its own source tree.
+
+
 At this point you have successfully brought your CVS copy of the GNU
 make source directory up to the point where it can be treated
 more-or-less like the official package you would get from ftp.gnu.org.
 That is, you can just run:
 
-  $ ./configure && make && make check && make install
+  $ make && make check && make install
 
 to build and install GNU make.
 
@@ -127,6 +136,7 @@ autoheader
 automake --add-missing
 autoconf
 ./configure
+make update
 make
 make check
 make distcheck
index 67bba15e5a15d6c69d31653b895133e25a601dfc..19a175e0063600fb5472644f182b4be2d32dd0a5 100644 (file)
@@ -24,6 +24,12 @@ Boston, MA 02111-1307, USA.  */
 #include "job.h"
 #include "commands.h"
 
+#if VMS
+# define FILE_LIST_SEPARATOR ','
+#else
+# define FILE_LIST_SEPARATOR ' '
+#endif
+
 extern int remote_kill PARAMS ((int id, int sig));
 
 #ifndef        HAVE_UNISTD_H
@@ -36,7 +42,6 @@ static void
 set_file_variables (file)
      register struct file *file;
 {
-  register char *p;
   char *at, *percent, *star, *less;
 
 #ifndef        NO_ARCHIVES
@@ -46,6 +51,8 @@ set_file_variables (file)
   if (ar_name (file->name))
     {
       unsigned int len;
+      char *p;
+
       p = strchr (file->name, '(');
       at = (char *) alloca (p - file->name + 1);
       bcopy (file->name, at, p - file->name);
@@ -120,12 +127,14 @@ set_file_variables (file)
   /* Compute the values for $^, $+, and $?.  */
 
   {
-    register unsigned int qmark_len, plus_len;
+    unsigned int qmark_len, plus_len, bar_len;
     char *caret_value, *plus_value;
-    register char *cp;
+    char *cp;
     char *qmark_value;
-    register char *qp;
-    register struct dep *d;
+    char *bar_value;
+    char *qp;
+    char *bp;
+    struct dep *d;
     unsigned int len;
 
     /* Compute first the value for $+, which is supposed to contain
@@ -133,36 +142,35 @@ set_file_variables (file)
 
     plus_len = 0;
     for (d = file->deps; d != 0; d = d->next)
-      plus_len += strlen (dep_name (d)) + 1;
+      if (! d->ignore_mtime)
+       plus_len += strlen (dep_name (d)) + 1;
+    if (plus_len == 0)
+      plus_len++;
 
-    len = plus_len == 0 ? 1 : plus_len;
-    cp = plus_value = (char *) alloca (len);
+    cp = plus_value = (char *) alloca (plus_len);
 
     qmark_len = plus_len;      /* Will be this or less.  */
     for (d = file->deps; d != 0; d = d->next)
-      {
-       char *c = dep_name (d);
+      if (! d->ignore_mtime)
+        {
+          char *c = dep_name (d);
 
 #ifndef        NO_ARCHIVES
-       if (ar_name (c))
-         {
-           c = strchr (c, '(') + 1;
-           len = strlen (c) - 1;
-         }
-       else
+          if (ar_name (c))
+            {
+              c = strchr (c, '(') + 1;
+              len = strlen (c) - 1;
+            }
+          else
 #endif
-         len = strlen (c);
+            len = strlen (c);
 
-       bcopy (c, cp, len);
-       cp += len;
-#if VMS
-        *cp++ = ',';
-#else
-       *cp++ = ' ';
-#endif
-       if (! d->changed)
-         qmark_len -= len + 1; /* Don't space in $? for this one.  */
-      }
+          bcopy (c, cp, len);
+          cp += len;
+          *cp++ = FILE_LIST_SEPARATOR;
+          if (! d->changed)
+            qmark_len -= len + 1;      /* Don't space in $? for this one.  */
+        }
 
     /* Kill the last space and define the variable.  */
 
@@ -175,11 +183,18 @@ set_file_variables (file)
 
     uniquize_deps (file->deps);
 
-    /* Compute the values for $^ and $?.  */
+    bar_len = 0;
+    for (d = file->deps; d != 0; d = d->next)
+      if (d->ignore_mtime)
+       bar_len += strlen (dep_name (d)) + 1;
+    if (bar_len == 0)
+      bar_len++;
+
+    /* Compute the values for $^, $?, and $|.  */
 
     cp = caret_value = plus_value; /* Reuse the buffer; it's big enough.  */
-    len = qmark_len == 0 ? 1 : qmark_len;
-    qp = qmark_value = (char *) alloca (len);
+    qp = qmark_value = (char *) alloca (qmark_len);
+    bp = bar_value = (char *) alloca (bar_len);
 
     for (d = file->deps; d != 0; d = d->next)
       {
@@ -195,23 +210,24 @@ set_file_variables (file)
 #endif
          len = strlen (c);
 
-       bcopy (c, cp, len);
-       cp += len;
-#if VMS
-       *cp++ = ',';
-#else
-       *cp++ = ' ';
-#endif
-       if (d->changed)
-         {
-           bcopy (c, qp, len);
-           qp += len;
-#if VMS
-           *qp++ = ',';
-#else
-           *qp++ = ' ';
-#endif
+        if (d->ignore_mtime)
+          {
+           bcopy (c, bp, len);
+           bp += len;
+           *bp++ = FILE_LIST_SEPARATOR;
          }
+       else
+         {
+            bcopy (c, cp, len);
+            cp += len;
+            *cp++ = FILE_LIST_SEPARATOR;
+            if (d->changed)
+              {
+                bcopy (c, qp, len);
+                qp += len;
+                *qp++ = FILE_LIST_SEPARATOR;
+              }
+          }
       }
 
     /* Kill the last spaces and define the variables.  */
@@ -221,6 +237,9 @@ set_file_variables (file)
 
     qp[qp > qmark_value ? -1 : 0] = '\0';
     DEFINE_VARIABLE ("?", 1, qmark_value);
+
+    bp[bp > bar_value ? -1 : 0] = '\0';
+    DEFINE_VARIABLE ("|", 1, bar_value);
   }
 
 #undef DEFINE_VARIABLE
index 43357760917f5ecd7a50cef5c36a771ffda8b448..148b21765c9a005e2e56d52dcc2bcf1af6217682 100644 (file)
 /* Define if you have the sun library (-lsun).  */
 /* #undef HAVE_LIBSUN */
 
+/* Use high resolution file timestamps if nonzero. */
+#define FILE_TIMESTAMP_HI_RES 0
+
 /* Build host information. */
 #define MAKE_HOST "Windows32"
 
index ba7485b9d2536cd5afd16fac6594047562920257..8fe16febc52453b46543eb7872116750aa0336fc 100644 (file)
@@ -1,58 +1,91 @@
-\r
-/* Many things are defined already by a system header.  */\r
-#include <sys/config.h>\r
-\r
-/* Name of this package (needed by automake) */\r
-#define PACKAGE "%PACKAGE%"\r
-\r
-/* Version of this package (needed by automake) */\r
-#define VERSION "%VERSION%"\r
-\r
-#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1\r
-\r
-/* Define if `sys_siglist' is declared by <signal.h>.  */\r
-# define SYS_SIGLIST_DECLARED 1\r
-\r
-/* Define this if the C library defines the variable `_sys_siglist'.  */\r
-# define HAVE_SYS_SIGLIST 1\r
-\r
-#else\r
-\r
-/* Define NSIG.  */\r
-# define NSIG SIGMAX\r
-\r
-#endif\r
-\r
-/* Define if you have the fdopen function.  */\r
-#define HAVE_FDOPEN 1\r
-\r
-/* Define if you have sigsetmask.  */\r
-#define HAVE_SIGSETMASK 1\r
-\r
-/* Define if you have the <memory.h> header file.  */\r
-#define HAVE_MEMORY_H 1\r
-\r
-/* Define if you have the memmove function.  */\r
-#define HAVE_MEMMOVE 1\r
-\r
-/* Define if you have the mkstemp function.  */\r
-#define HAVE_MKSTEMP 1\r
-\r
-#define SCCS_GET "get"\r
-\r
-/* Define to `unsigned long' or `unsigned long long'\r
-   if <inttypes.h> doesn't define.  */\r
-#define uintmax_t unsigned long long\r
-\r
-/* Define the type of the first arg to select().  */\r
-#define fd_set_size_t int\r
-\r
-/* Define if you have the select function.  */\r
-#define HAVE_SELECT 1\r
-\r
-/* Define if you have the vprintf library function.  */\r
-#undef HAVE_VPRINTF\r
-#define HAVE_VPRINTF 1\r
-\r
-/* Build host information. */\r
-#define MAKE_HOST "i386-pc-msdosdjgpp"\r
+
+/* Many things are defined already by a system header.  */
+#include <sys/config.h>
+
+#if __DJGPP__ > 2 || __DJGPP_MINOR__ > 1
+
+/* Define if `sys_siglist' is declared by <signal.h>.  */
+# define SYS_SIGLIST_DECLARED 1
+
+/* Define this if the C library defines the variable `_sys_siglist'.  */
+# define HAVE_SYS_SIGLIST 1
+
+#else
+
+/* Define NSIG.  */
+# define NSIG SIGMAX
+
+#endif
+
+/* Use high resolution file timestamps if nonzero. */
+#define FILE_TIMESTAMP_HI_RES 0
+
+/* Define to 1 if you have `alloca', as a function or macro. */
+#define HAVE_ALLOCA 1
+
+/* Define if you have the fdopen function.  */
+#define HAVE_FDOPEN 1
+
+/* Define to 1 if you have the `getgroups' function. */
+#define HAVE_GETGROUPS 1
+
+/* Define if you have the <memory.h> header file.  */
+#define HAVE_MEMORY_H 1
+
+/* Define if you have the mkstemp function.  */
+#define HAVE_MKSTEMP 1
+
+/* Define to 1 if you have the `mktemp' function. */
+#define HAVE_MKTEMP 1
+
+/* Define to 1 if you have the `setlinebuf' function. */
+#define HAVE_SETLINEBUF 1
+
+/* Define to 1 if you have the `setvbuf' function. */
+#define HAVE_SETVBUF 1
+
+#define SCCS_GET "get"
+
+/* Define to `unsigned long' or `unsigned long long'
+   if <inttypes.h> doesn't define.  */
+#define uintmax_t unsigned long long
+
+/* Define the type of the first arg to select().  */
+#define fd_set_size_t int
+
+/* Define if you have the select function.  */
+#define HAVE_SELECT 1
+
+/* Define if you have the vprintf library function.  */
+#undef HAVE_VPRINTF
+#define HAVE_VPRINTF 1
+
+/* Name of the package */
+#define PACKAGE "%PACKAGE%"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "bug-%PACKAGE%@gnu.org"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "GNU %PACKAGE%"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "GNU %PACKAGE% %VERSION%"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "%PACKAGE%"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "%VERSION%"
+
+/* Define to 1 if the C compiler supports function prototypes. */
+#define PROTOTYPES 1
+
+/* Define to 1 if `sys_siglist' is declared by <signal.h> or <unistd.h>. */
+#define SYS_SIGLIST_DECLARED 1
+
+/* Version number of package */
+#define VERSION "%VERSION%"
+
+/* Build host information. */
+#define MAKE_HOST "i386-pc-msdosdjgpp"
diff --git a/dep.h b/dep.h
index e64992193e034505b685e2c0e1ff28f73daa1b93..7f4380b71a1938339dea8add520222d1cccf496e 100644 (file)
--- a/dep.h
+++ b/dep.h
@@ -38,7 +38,8 @@ struct dep
     struct dep *next;
     char *name;
     struct file *file;
-    int changed;
+    unsigned int changed : 8;
+    unsigned int ignore_mtime : 1;
   };
 
 
index 34ca4b43b903f0694604a7690144907732074c94..ac1e6cd63240c1c8a75a459017818f63e954c3ff 100644 (file)
@@ -1,42 +1,42 @@
-@echo Building Make for MSDOS\r\r
-@rem Echo ON so they will see what is going on.\r\r
-@echo on\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c -o remake.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o\r\r
-gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o\r\r
-@cd glob\r\r
-@if exist libglob.a del libglob.a\r\r
-gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o\r\r
-gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o\r\r
-ar rv libglob.a glob.o fnmatch.o\r\r
-@echo off\r\r
-cd ..\r\r
-echo commands.o > respf.$$$\r\r
-for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$\r\r
-for %%f in (expand function vpath version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$\r\r
-echo glob/libglob.a >> respf.$$$\r\r
-@echo Linking...\r\r
-@echo on\r\r
-gcc -o make.new @respf.$$$\r\r
-@if exist make.exe echo Make.exe is now built!\r\r
-@if not exist make.exe echo Make.exe build failed...\r\r
-@if exist make.exe del respf.$$$\r\r
+@echo Building Make for MSDOS\r
+@rem Echo ON so they will see what is going on.\r
+@echo on\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g commands.c -o commands.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g job.c -o job.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g dir.c -o dir.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g file.c -o file.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g misc.c -o misc.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g main.c -o main.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -DINCLUDEDIR=\"c:/djgpp/include\" -O2 -g read.c -o read.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -DLIBDIR=\"c:/djgpp/lib\" -O2 -g remake.c -o remake.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g rule.c -o rule.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g implicit.c -o implicit.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g default.c -o default.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g variable.c -o variable.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g expand.c -o expand.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g function.c -o function.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g vpath.c -o vpath.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g version.c -o version.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g ar.c -o ar.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g arscan.c -o arscan.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g signame.c -o signame.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g remote-stub.c -o remote-stub.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt.c -o getopt.o\r
+gcc  -c -I. -I./glob -DHAVE_CONFIG_H -O2 -g getopt1.c -o getopt1.o\r
+@cd glob\r
+@if exist libglob.a del libglob.a\r
+gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g glob.c -o glob.o\r
+gcc -I. -c -DHAVE_CONFIG_H -I.. -O2 -g fnmatch.c -o fnmatch.o\r
+ar rv libglob.a glob.o fnmatch.o\r
+@echo off\r
+cd ..\r
+echo commands.o > respf.$$$\r
+for %%f in (job dir file misc main read remake rule implicit default variable) do echo %%f.o >> respf.$$$\r
+for %%f in (expand function vpath version ar arscan signame remote-stub getopt getopt1) do echo %%f.o >> respf.$$$\r
+echo glob/libglob.a >> respf.$$$\r
+@echo Linking...\r
+@echo on\r
+gcc -o make.new @respf.$$$\r
+@if exist make.exe echo Make.exe is now built!\r
+@if not exist make.exe echo Make.exe build failed...\r
+@if exist make.exe del respf.$$$\r
index 05eaa7f4a5f15549db6688db3aefa1992378f4b2..0a2b8d28f11d690a9b01de998b498ab60af33daf 100644 (file)
@@ -546,6 +546,7 @@ pattern_search (file, archive, depth, recursions)
        }
 
       dep = (struct dep *) xmalloc (sizeof (struct dep));
+      dep->ignore_mtime = 0;
       s = found_files[deps_found];
       if (recursions == 0)
        {
@@ -611,6 +612,8 @@ pattern_search (file, archive, depth, recursions)
       if (i != matches[foundrule])
        {
          struct dep *new = (struct dep *) xmalloc (sizeof (struct dep));
+         /* GKM FIMXE: handle '|' here too */
+         new->ignore_mtime = 0;
          new->name = p = (char *) xmalloc (rule->lens[i] + fullstemlen + 1);
          bcopy (rule->targets[i], p,
                 rule->suffixes[i] - rule->targets[i] - 1);
diff --git a/main.c b/main.c
index 798bde9dc026a40856ed42625ef82ae9a3d83a38..39f0bd3e149189b9ab6b2009c636768736b5f0dc 100644 (file)
--- a/main.c
+++ b/main.c
@@ -904,20 +904,6 @@ int main (int argc, char ** argv)
 
   /* Make sure stdout is line-buffered.  */
 
-#ifdef HAVE_SETVBUF
-# ifndef SETVBUF_REVERSED
-  setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
-_WAIT_NOHANG
-# if defined SIGCHLD
-  (void) bsd_signal (SIGCHLD, SIG_DFL);
-# endif
-# if defined SIGCLD && SIGCLD != SIGCHLD
-  (void) bsd_signal (SIGCLD, SIG_DFL);
-# endif
-#endif
-
-  /* Make sure stdout is line-buffered.  */
-
 #ifdef HAVE_SETVBUF
 # ifdef SETVBUF_REVERSED
   setvbuf (stdout, _IOLBF, xmalloc (BUFSIZ), BUFSIZ);
@@ -1899,6 +1885,7 @@ _WAIT_NOHANG
            goals = (struct dep *) xmalloc (sizeof (struct dep));
            goals->next = 0;
            goals->name = 0;
+            goals->ignore_mtime = 0;
            goals->file = default_goal_file;
          }
       }
@@ -2056,6 +2043,7 @@ handle_non_switch_argument (arg, env)
        }
       lastgoal->name = 0;
       lastgoal->file = f;
+      lastgoal->ignore_mtime = 0;
 
       {
         /* Add this target name to the MAKECMDGOALS variable. */
@@ -2180,9 +2168,11 @@ print_usage (bad)
               buf, gettext (cs->description));
     }
 
-  fprintf (usageto, _("\nBuilt for %s"), make_host);
-  if (remote_description != 0 && *remote_description != '\0')
-    fprintf (usageto, " (%s)", remote_description);
+  if (!remote_description || *remote_description == '\0')
+    fprintf (usageto, _("\nBuilt for %s"), make_host);
+  else
+    fprintf (usageto, "\nBuilt for %s (%s)", make_host, remote_description);
+
   fprintf (usageto, _("\nReport bugs to <bug-make@gnu.org>\n"));
 }
 
@@ -2828,21 +2818,34 @@ log_working_directory (entering)
   if (print_data_base_flag)
     fputs ("# ", stdout);
 
-  if (makelevel == 0)
-    printf ("%s: ", program);
-  else
-    printf ("%s[%u]: ", program, makelevel);
-
   /* Use entire sentences to give the translators a fighting chance.  */
 
-  if (starting_directory == 0)
-    if (entering)
-      puts (_("Entering an unknown directory"));
+  if (makelevel == 0)
+    if (starting_directory == 0)
+      if (entering)
+        printf (_("%s: Entering an unknown directory"), program);
+      else
+        printf (_("%s: Leaving an unknown directory"), program);
     else
-      puts (_("Leaving an unknown directory"));
+      if (entering)
+        printf (_("%s: Entering directory `%s'\n"),
+                program, starting_directory);
+      else
+        printf (_("%s: Leaving directory `%s'\n"),
+                program, starting_directory);
   else
-    if (entering)
-      printf (_("Entering directory `%s'\n"), starting_directory);
+    if (starting_directory == 0)
+      if (entering)
+        printf (_("%s[%u]: Entering an unknown directory"),
+                program, makelevel);
+      else
+        printf (_("%s[%u]: Leaving an unknown directory"),
+                program, makelevel);
     else
-      printf (_("Leaving directory `%s'\n"), starting_directory);
+      if (entering)
+        printf (_("%s[%u]: Entering directory `%s'\n"),
+                program, makelevel, starting_directory);
+      else
+        printf (_("%s[%u]: Leaving directory `%s'\n"),
+                program, makelevel, starting_directory);
 }
index a499972b8d93ec0ebfeff82b086751e0824ac86a..1910674bbba10db9cc6ef39bb49e9123df8d80db 100644 (file)
@@ -189,4 +189,34 @@ cvs-update: $(cvs-targets)
 # --------------------- #
 
 .PHONY: update
-update: wget-update cvs-update po-update
+update: wget-update po-update
+
+# cvs-update
+
+
+## --------------- ##
+## Sanity checks.  ##
+## --------------- ##
+
+# Checks that don't require cvs.  Run `changelog-check' last as
+# previous test may reveal problems requiring new ChangeLog entries.
+local-check: po-check changelog-check
+
+# copyright-check writable-files
+
+changelog-check:
+       if head ChangeLog | grep 'Version $(VERSION)' >/dev/null; then \
+         :; \
+       else \
+         echo "$(VERSION) not in ChangeLog" 1>&2; \
+         exit 1; \
+       fi
+
+# Verify that all source files using _() are listed in po/POTFILES.in.
+po-check:
+       if test -f po/POTFILES.in; then \
+         grep -E -v '^(#|$$)' po/POTFILES.in | sort > $@-1; \
+         grep -E -l '\b_\(' lib/*.c src/*.c | sort > $@-2; \
+         diff -u $@-1 $@-2 || exit 1; \
+         rm -f $@-1 $@-2; \
+       fi
index d2d66e3aaaf8ae1499a58a14805eae19b9794c8b..cce36011e160050cba6c6dcc6fbdc38591149d38 100644 (file)
@@ -1,4 +1,4 @@
-# Set of available languages.
+# Set of available languages: 14 languages
 
 da de es fr gl he hr ja ko nl pl pt_BR ru tr
 
diff --git a/read.c b/read.c
index 3578ca857e9111fc5066d7c7912394668319ea4b..510266a0896dfaa05ae9c30f4f79cbd246750627 100644 (file)
--- a/read.c
+++ b/read.c
@@ -251,6 +251,7 @@ read_all_makefiles (makefiles)
              d->name = 0;
              d->file = enter_file (*p);
              d->file->dontcare = 1;
+              d->ignore_mtime = 0;
              /* Tell update_goal_chain to bail out as soon as this file is
                 made, and main not to die if we can't make this file.  */
              d->changed = RM_DONTCARE;
@@ -347,6 +348,7 @@ eval_makefile (filename, flags)
     free (filename);
   filename = deps->file->name;
   deps->changed = flags;
+  deps->ignore_mtime = 0;
 
   /* If the makefile can't be found at all, give up entirely.  */
 
@@ -1117,8 +1119,24 @@ eval (ebuf, set_default)
 
         /* Parse the dependencies.  */
         deps = (struct dep *)
-          multi_glob (parse_file_seq (&p2, '\0', sizeof (struct dep), 1),
+          multi_glob (parse_file_seq (&p2, '|', sizeof (struct dep), 1),
                       sizeof (struct dep));
+        if (*p2)
+          {
+            /* Files that follow '|' are special prerequisites that
+               need only exist in order to satisfy the dependency.
+               Their modification times are irrelevant.  */
+            struct dep **deps_ptr = &deps;
+            struct dep *d;
+            for (deps_ptr = &deps; *deps_ptr; deps_ptr = &(*deps_ptr)->next)
+              ;
+            ++p2;
+            *deps_ptr = (struct dep *)
+              multi_glob (parse_file_seq (&p2, '\0', sizeof (struct dep), 1),
+                          sizeof (struct dep));
+            for (d = *deps_ptr; d != 0; d = d->next)
+              d->ignore_mtime = 1;
+          }
 
         commands_idx = 0;
         if (cmdleft != 0)
@@ -1506,7 +1524,8 @@ uniquize_deps (chain)
       last = d;
       next = d->next;
       while (next != 0)
-       if (streq (dep_name (d), dep_name (next)))
+       if (streq (dep_name (d), dep_name (next))
+            && d->ignore_mtime == next->ignore_mtime)
          {
            struct dep *n = next->next;
            last->next = n;
@@ -2825,10 +2844,13 @@ multi_glob (chain, size)
                    if (found == 0)
                      {
                        /* No matches.  Use MEMNAME as-is.  */
-                       struct nameseq *elt
-                         = (struct nameseq *) xmalloc (size);
                        unsigned int alen = strlen (gl.gl_pathv[i]);
                        unsigned int mlen = strlen (memname);
+                       struct nameseq *elt
+                         = (struct nameseq *) xmalloc (size);
+                        if (size > sizeof (struct nameseq))
+                          bzero (((char *) elt) + sizeof (struct nameseq),
+                                 size - sizeof (struct nameseq));
                        elt->name = (char *) xmalloc (alen + 1 + mlen + 2);
                        bcopy (gl.gl_pathv[i], elt->name, alen);
                        elt->name[alen] = '(';
@@ -2857,6 +2879,9 @@ multi_glob (chain, size)
 #endif /* !NO_ARCHIVES */
                  {
                    struct nameseq *elt = (struct nameseq *) xmalloc (size);
+                    if (size > sizeof (struct nameseq))
+                      bzero (((char *) elt) + sizeof (struct nameseq),
+                             size - sizeof (struct nameseq));
                    elt->name = xstrdup (gl.gl_pathv[i]);
                    elt->next = new;
                    new = elt;
index 084816bbe9ed610412f301ed5dd7308887a813fb..fcefdc771feaed0ef14eb2db1d6afe55d30bf579 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -349,6 +349,7 @@ update_file_1 (file, depth)
   int dep_status = 0;
   register struct dep *d, *lastd;
   int running = 0;
+  int maybe_make;
 
   DBF (DB_VERBOSE, _("Considering target file `%s'.\n"));
 
@@ -457,7 +458,11 @@ update_file_1 (file, depth)
        }
 
       d->file->parent = file;
-      dep_status |= check_dep (d->file, depth, this_mtime, &must_make);
+      maybe_make = must_make;
+      dep_status |= check_dep (d->file, depth, this_mtime, &maybe_make);
+      if (! d->ignore_mtime)
+        must_make = maybe_make;
+
       check_renamed (d->file);
 
       {
@@ -570,17 +575,21 @@ update_file_1 (file, depth)
       FILE_TIMESTAMP d_mtime = file_mtime (d->file);
       check_renamed (d->file);
 
-#if 1  /* %%% In version 4, remove this code completely to
+      if (! d->ignore_mtime)
+        {
+#if 1
+          /* %%% In version 4, remove this code completely to
           implement not remaking deps if their deps are newer
           than their parents.  */
-      if (d_mtime == NONEXISTENT_MTIME && !d->file->intermediate)
-       /* We must remake if this dep does not
-          exist and is not intermediate.  */
-       must_make = 1;
+          if (d_mtime == NONEXISTENT_MTIME && !d->file->intermediate)
+            /* We must remake if this dep does not
+               exist and is not intermediate.  */
+            must_make = 1;
 #endif
 
-      /* Set DEPS_CHANGED if this dep actually changed.  */
-      deps_changed |= d->changed;
+          /* Set DEPS_CHANGED if this dep actually changed.  */
+          deps_changed |= d->changed;
+        }
 
       /* Set D->changed if either this dep actually changed,
         or its dependent, FILE, is older or does not exist.  */
@@ -590,7 +599,12 @@ update_file_1 (file, depth)
        {
           const char *fmt = 0;
 
-         if (d_mtime == NONEXISTENT_MTIME)
+          if (d->ignore_mtime)
+            {
+              if (ISDB (DB_VERBOSE))
+                fmt = _("Prerequisite `%s' is order-only for target `%s'.\n");
+            }
+          else if (d_mtime == NONEXISTENT_MTIME)
             {
               if (ISDB (DB_BASIC))
                 fmt = _("Prerequisite `%s' of target `%s' does not exist.\n");
@@ -822,8 +836,9 @@ check_dep (file, depth, this_mtime, must_make_ptr)
      FILE_TIMESTAMP this_mtime;
      int *must_make_ptr;
 {
-  register struct dep *d;
+  struct dep *d;
   int dep_status = 0;
+  int maybe_make;
 
   ++depth;
   start_updating (file);
@@ -898,8 +913,11 @@ check_dep (file, depth, this_mtime, must_make_ptr)
                }
 
              d->file->parent = file;
+              maybe_make = *must_make_ptr;
              dep_status |= check_dep (d->file, depth, this_mtime,
-                                       must_make_ptr);
+                                       &maybe_make);
+              if (! d->ignore_mtime)
+                *must_make_ptr = maybe_make;
              check_renamed (d->file);
              if (dep_status != 0 && !keep_going_flag)
                break;
diff --git a/rule.c b/rule.c
index fdaa1c4f7e3079d5a6beae28052f22be1a2adc66..e693c022fec3818cd435482ca6dd0a402e24f1b8 100644 (file)
--- a/rule.c
+++ b/rule.c
@@ -230,6 +230,7 @@ convert_suffix_rule (target, source, cmds)
       deps = (struct dep *) xmalloc (sizeof (struct dep));
       deps->next = 0;
       deps->name = depname;
+      deps->ignore_mtime = 0;
     }
 
   create_pattern_rule (names, percents, 0, deps, cmds, 0);
diff --git a/tests/scripts/features/order_only b/tests/scripts/features/order_only
new file mode 100644 (file)
index 0000000..81284c5
--- /dev/null
@@ -0,0 +1,79 @@
+#                                                                    -*-perl-*-
+$description = "Test order-only prerequisites.";
+
+$details = "\
+Create makefiles with various combinations of normal and order-only
+prerequisites and ensure they behave properly.  Test the \$| variable.";
+
+open(MAKEFILE,"> $makefile");
+
+print MAKEFILE <<'EOF';
+foo: bar | baz
+       @echo '$$^ = $^'
+       @echo '$$? = $?'
+       @echo '$$| = $|'
+       touch $@
+
+.PHONY: baz
+
+bar baz:
+       touch $@
+EOF
+
+close(MAKEFILE);
+
+
+# TEST #1 -- just the syntax
+
+&run_make_with_options($makefile, "", &get_logfile);
+$answer = "touch bar\ntouch baz\n\$^ = bar\n\$? = bar\n\$| = baz\ntouch foo\n";
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated
+
+&run_make_with_options($makefile, "", &get_logfile);
+$answer = "touch baz\n";
+&compare_output($answer,&get_logfile(1));
+
+unlink(qw(foo bar baz));
+
+# Test prereqs that are both order and non-order
+
+$makefile2 = &get_tmpfile;
+
+open(MAKEFILE,"> $makefile2");
+
+print MAKEFILE <<'EOF';
+foo: bar | baz
+       @echo '$$^ = $^'
+       @echo '$$? = $?'
+       @echo '$$| = $|'
+       touch $@
+
+foo: baz
+
+.PHONY: baz
+
+bar baz:
+       touch $@
+EOF
+
+close(MAKEFILE);
+
+# TEST #3 -- just the syntax
+
+&run_make_with_options($makefile2, "", &get_logfile);
+$answer = "touch bar\ntouch baz\n\$^ = bar baz\n\$? = bar baz\n\$| = baz\ntouch foo\n";
+&compare_output($answer,&get_logfile(1));
+
+
+# TEST #2 -- now we do it again: baz is PHONY but foo should _NOT_ be updated
+
+&run_make_with_options($makefile2, "", &get_logfile);
+$answer = "touch baz\$^ = bar baz\n\$? = baz\n\$| = baz\ntouch foo\n";
+&compare_output($answer,&get_logfile(1));
+
+unlink(qw(foo bar baz));
+
+1;