* A few fixes.
authorPaul Smith <psmith@gnu.org>
Sun, 23 Jan 2000 07:05:16 +0000 (07:05 +0000)
committerPaul Smith <psmith@gnu.org>
Sun, 23 Jan 2000 07:05:16 +0000 (07:05 +0000)
ChangeLog
NEWS
filedef.h
main.c
remake.c
tests/ChangeLog
tests/scripts/features/include

index ca42bb8b033b4526ea4748b428d28a33d90a7793..d25de2f6a64687842e27cb331a0af0af36b93204 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2000-01-23  Paul D. Smith  <psmith@gnu.org>
+
+       * main.c (decode_debug_flags): If debug_flag is set, enable all
+       debugging levels.
+       (debug_flag): Resurrect this flag variable.
+       (switches): Make -d give the old behavior of turning on all
+       debugging.  Change --debug alone to emit basic debugging and take
+       optional arguments to expand debugging.
+       * NEWS: Document the new debugging options.
+
+       * remake.c (no_rule_error): Remove this function.  This tries to
+       fix a real problem--see the description with the introduction of
+       this function below.  However, the cure is worse than the disease
+       and this approach won't work.
+       (remake_file): Put the code from no_rule_error back here.
+       (update_file_1): Remove call to no_rule_error.
+
+       * filedef.h (struct file): Remove mfile_status field.
+
 2000-01-22  Paul D. Smith  <psmith@gnu.org>
 
        Integrate GNU gettext support.
@@ -18,6 +37,7 @@
        * po/POTFILES.in, po/Makefile.in.in: New files.  Take
        Makefile.in.in from the latest GNU tar distribution, as that
        version works better than the one that comes with gettext.
+       * NEWS: Mention i18n ability.
 
 2000-01-21  Paul D. Smith  <psmith@gnu.org>
 
diff --git a/NEWS b/NEWS
index 0f9fcb3db290452a48fd5d2bc3acd97dc6c92bf6..55820a6667f6f43e7f202608a307f31775c7fd85 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -42,12 +42,15 @@ Version 3.79
   function and have it work properly.  This was suggested by Damien
   GIBOU <damien.gibou@st.com>.
 
-* The -d (--debug) option has changed: it now allows optional flags
+* The --debug option has changed: it now allows optional flags
   controlling the amount and type of debugging output.  By default only
   a minimal amount information is generated, displaying the names of
   "normal" targets (not makefiles) were deemed out of date and in need
   of being rebuilt.
 
+  Note that the -d option behaves as before: all debugging information
+  is generated.
+
 * Hartmut Becker provided many updates for the VMS port of GNU make.
   See the readme.vms file for more details.
 \f
index 425bb0482bc378587d5b7263222ef31910f43dfb..f39b82a388daecbec26b93442cdb24fb52c197dd 100644 (file)
--- a/filedef.h
+++ b/filedef.h
@@ -87,8 +87,6 @@ struct file
     unsigned int secondary:1;
     unsigned int dontcare:1;   /* Nonzero if no complaint is to be made if
                                   this target cannot be remade.  */
-    unsigned int mfile_status:1;/* Nonzero if update_status was obtained
-                                   while remaking a makefile.  */
     unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name.  */
     unsigned int pat_searched:1;/* Nonzero if we already searched for
                                    pattern-specific variables.  */
diff --git a/main.c b/main.c
index f84efd36d7e9b1fe249163c3b78c9f6d55dcd117..9891b434d1f6ace33cbbcc66e81b02eeb2060ff0 100644 (file)
--- a/main.c
+++ b/main.c
@@ -142,6 +142,7 @@ int just_print_flag;
 /* Print debugging info (--debug).  */
 
 static struct stringlist *db_flags;
+static int debug_flag = 0;
 
 int db_level = 0;
 
@@ -260,10 +261,13 @@ static const struct command_switch switches[] =
     { 'C', string, (char *) &directories, 0, 0, 0, 0, 0,
        "directory", N_("DIRECTORY"),
        N_("Change to DIRECTORY before doing anything") },
-    { 'd', string, (char *) &db_flags, 1, 1, 0,
+    { 'd', flag, (char *) &debug_flag, 1, 1, 0, 0, 0,
+       0, 0,
+       N_("Print lots of debugging information") },
+    { CHAR_MAX+1, string, (char *) &db_flags, 1, 1, 0,
         "basic", 0,
        "debug", N_("FLAGS"),
-       N_("Print different types of debugging information") },
+       N_("Print various types of debugging information") },
 #ifdef WINDOWS32
     { 'D', flag, (char *) &suspend_flag, 1, 1, 0, 0, 0,
         "suspend-for-debug", 0,
@@ -289,7 +293,7 @@ static const struct command_switch switches[] =
        (char *) &inf_jobs, (char *) &default_job_slots,
        "jobs", "N",
        N_("Allow N jobs at once; infinite jobs with no arg") },
-    { CHAR_MAX+1, string, (char *) &jobserver_fds, 1, 1, 0, 0, 0,
+    { CHAR_MAX+2, string, (char *) &jobserver_fds, 1, 1, 0, 0, 0,
         "jobserver-fds", 0,
         0 },
     { 'k', flag, (char *) &keep_going_flag, 1, 1, 0,
@@ -344,13 +348,13 @@ static const struct command_switch switches[] =
     { 'w', flag, (char *) &print_directory_flag, 1, 1, 0, 0, 0,
        "print-directory", 0,
        N_("Print the current directory") },
-    { CHAR_MAX+2, flag, (char *) &inhibit_print_directory_flag, 1, 1, 0, 0, 0,
+    { CHAR_MAX+3, flag, (char *) &inhibit_print_directory_flag, 1, 1, 0, 0, 0,
        "no-print-directory", 0,
        N_("Turn off -w, even if it was turned on implicitly") },
     { 'W', string, (char *) &new_files, 0, 0, 0, 0, 0,
        "what-if", N_("FILE"),
        N_("Consider FILE to be infinitely new") },
-    { CHAR_MAX+3, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0,
+    { CHAR_MAX+4, flag, (char *) &warn_undefined_variables_flag, 1, 1, 0, 0, 0,
        "warn-undefined-variables", 0,
        N_("Warn when an undefined variable is referenced") },
     { '\0', }
@@ -497,6 +501,9 @@ decode_debug_flags ()
 {
   char **pp;
 
+  if (debug_flag)
+    db_level = DB_ALL;
+
   if (!db_flags)
     return;
 
@@ -515,13 +522,13 @@ decode_debug_flags ()
               db_level |= DB_BASIC;
               break;
             case 'i':
-              db_level |= DB_IMPLICIT;
+              db_level |= DB_BASIC | DB_IMPLICIT;
               break;
             case 'j':
               db_level |= DB_JOBS;
               break;
             case 'm':
-              db_level |= DB_MAKEFILES;
+              db_level |= DB_BASIC | DB_MAKEFILES;
               break;
             case 'v':
               db_level |= DB_BASIC | DB_VERBOSE;
index 4242e2ffa90308effb91812c2c2344587bcb5ccf..d4c8a03aad0c68224c7e3a7fda7de9500c876e90 100644 (file)
--- a/remake.c
+++ b/remake.c
@@ -258,39 +258,6 @@ update_goal_chain (goals, makefiles)
   return status;
 }
 \f
-/* Generate an error/fatal message if no rules are available for the target.
- */
-static void
-no_rule_error(file)
-  struct file *file;
-{
-  const char *msg_noparent
-    = _("%sNo rule to make target `%s'%s");
-  const char *msg_parent
-    = _("%sNo rule to make target `%s', needed by `%s'%s");
-
-  if (keep_going_flag || file->dontcare)
-    {
-      /* If the previous attempt was made while we were creating
-         makefiles, but we aren't anymore, print an error now.  */
-      if (!file->dontcare
-          || (file->mfile_status && !updating_makefiles))
-        {
-          if (file->parent == 0)
-            error (NILF, msg_noparent, "*** ", file->name, ".");
-          else
-            error (NILF, msg_parent, "*** ",
-                   file->name, file->parent->name, ".");
-        }
-      file->update_status = 2;
-      file->mfile_status = updating_makefiles;
-    }
-  else if (file->parent == 0)
-    fatal (NILF, msg_noparent, "", file->name, "");
-  else
-    fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
-}
-\f
 /* If FILE is not up to date, execute the commands for it.
    Return 0 if successful, 1 if unsuccessful;
    but with some flag settings, just call `exit' if unsuccessful.
@@ -381,7 +348,6 @@ update_file_1 (file, depth)
        {
          DBF (DB_VERBOSE,
                _("Recently tried and failed to update file `%s'.\n"));
-          no_rule_error(file);
          return file->update_status;
        }
 
@@ -996,7 +962,31 @@ remake_file (file)
           Pretend it was successfully remade.  */
        file->update_status = 0;
       else
-        no_rule_error (file);
+        {
+          const char *msg_noparent
+            = _("%sNo rule to make target `%s'%s");
+          const char *msg_parent
+            = _("%sNo rule to make target `%s', needed by `%s'%s");
+
+          /* This is a dependency file we cannot remake.  Fail.  */
+          if (!keep_going_flag && !file->dontcare)
+            {
+              if (file->parent == 0)
+                fatal (NILF, msg_noparent, "", file->name, "");
+
+              fatal (NILF, msg_parent, "", file->name, file->parent->name, "");
+            }
+
+          if (!file->dontcare)
+            {
+              if (file->parent == 0)
+                error (NILF, msg_noparent, "*** ", file->name, ".");
+              else
+                error (NILF, msg_parent, "*** ",
+                       file->name, file->parent->name, ".");
+            }
+          file->update_status = 2;
+        }
     }
   else
     {
index e613d8de22ee4a2776d4ecdb7301b9eb4ee0caa8..68825fa58c1fc8d9cce724dc073fb97fef634e75 100644 (file)
@@ -1,3 +1,9 @@
+2000-01-23  Paul D. Smith  <psmith@gnu.org>
+
+       * scripts/features/include: Remove a check; the fix caused more
+       problems than the error, so I removed it and removed the test for
+       it.
+
 2000-01-11  Paul D. Smith  <psmith@gnu.org>
 
        * scripts/functions/call: Add a test for PR/1517 and PR/1527: make
index 2a48fbd303124c018761fefc2681a2b3faa2f747..60f4482db4ed8fa8bc7a28f06e9ec35c92f52700 100644 (file)
@@ -51,8 +51,11 @@ $answer = "This is another included makefile\n";
 # the -include suppressed it during the makefile read phase, we should
 # see one during the makefile run phase).
 
-&run_make_with_options($makefile, "error", &get_logfile, 512);
-$answer = "$make_name: *** No rule to make target `makeit.mk', needed by `error'.\n";
-&compare_output($answer, &get_logfile(1));
+# The fix to this caused more problems than the error, so I removed it.
+# pds -- 22 Jan 2000
+
+#&run_make_with_options($makefile, "error", &get_logfile, 512);
+#$answer = "$make_name: *** No rule to make target `makeit.mk', needed by `error'.\n";
+#&compare_output($answer, &get_logfile(1));
 
 1;