Changeset 1993 for trunk/src/kmk/file.c


Ignore:
Timestamp:
Oct 29, 2008, 1:37:51 AM (17 years ago)
Author:
bird
Message:

Merged in current GNU Make code (CVS from 2008-10-28). Ref #55.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/file.c

    r1980 r1993  
    11/* Target file management for GNU Make.
    22Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
    3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
     31998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software
    44Foundation, Inc.
    55This file is part of GNU Make.
     
    77GNU Make is free software; you can redistribute it and/or modify it under the
    88terms of the GNU General Public License as published by the Free Software
    9 Foundation; either version 2, or (at your option) any later version.
     9Foundation; either version 3 of the License, or (at your option) any later
     10version.
    1011
    1112GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     
    1415
    1516You should have received a copy of the GNU General Public License along with
    16 GNU Make; see the file COPYING.  If not, write to the Free Software
    17 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
     17this program.  If not, see <http://www.gnu.org/licenses/>.  */
    1818
    1919#include "make.h"
     
    337337          if (to_file->cmds->fileinfo.filenm != 0)
    338338            error (&from_file->cmds->fileinfo,
    339                    _("Commands were specified for file `%s' at %s:%lu,"),
     339                   _("Recipe was specified for file `%s' at %s:%lu,"),
    340340                   from_file->name, to_file->cmds->fileinfo.filenm,
    341341                   to_file->cmds->fileinfo.lineno);
    342342          else
    343343            error (&from_file->cmds->fileinfo,
    344                    _("Commands for file `%s' were found by implicit rule search,"),
     344                   _("Recipe for file `%s' was found by implicit rule search,"),
    345345                   from_file->name);
    346346          error (&from_file->cmds->fileinfo,
     
    348348                 from_file->name, to_hname);
    349349          error (&from_file->cmds->fileinfo,
    350                  _("Commands for `%s' will be ignored in favor of those for `%s'."),
     350                 _("Recipe for `%s' will be ignored in favor of the one for `%s'."),
    351351                 to_hname, from_file->name);
    352352        }
     
    458458        /* Is this file eligible for automatic deletion?
    459459           Yes, IFF: it's marked intermediate, it's not secondary, it wasn't
    460            given on the command-line, and it's either a -include makefile or
     460           given on the command line, and it's either a -include makefile or
    461461           it's not precious.  */
    462462        if (f->intermediate && (f->dontcare || !f->precious)
     
    580580  for (d = old; d != 0; d = d->next)
    581581    {
    582       size_t buffer_offset; /* bird */
    583582      struct dep *new, *d1;
    584583      char *p;
     
    628627        {
    629628          p = variable_expand ("");
    630           buffer_offset = p - variable_buffer;
    631629#ifndef CONFIG_WITH_STRCACHE2
    632630          variable_buffer_output (p, d->name, strlen (d->name) + 1);
     
    635633          variable_buffer_output (p, d->name, len + 1);
    636634#endif
    637           p = variable_buffer + buffer_offset; /* bird - variable_buffer may have been reallocated. (observed it) */
     635          p = variable_buffer;
    638636        }
    639637      else
     
    645643              char *o;
    646644              char *buffer = variable_expand ("");
    647               buffer_offset = buffer - variable_buffer; /* bird */
    648645
    649646              o = subst_expand (buffer, d->name, "%", "$*", 1, 2, 0);
    650               buffer = variable_buffer + buffer_offset; /* bird - variable_buffer may have been reallocated. */
    651 
    652               d->name = strcache_add_len (buffer, o - buffer);
     647              buffer = variable_buffer; /* bird - variable_buffer may have been reallocated. */
     648
     649              d->name = strcache_add_len (variable_buffer,
     650                                          o - variable_buffer);
    653651              d->staticpattern = 0; /* Clear staticpattern so that we don't
    654652                                       re-expand %s below. */
     
    691689          const char *pattern = "%";
    692690          char *buffer = variable_expand ("");
    693           const size_t buffer_offset = buffer - variable_buffer; /* bird */
    694691          struct dep *dp = new, *dl = 0;
    695692
     
    732729                                                                the if case does and strcache would appreciate it. */
    733730                    }
    734                   buffer = variable_buffer + buffer_offset; /* bird fix - variable_buffer may have been reallocated. */
     731                  buffer = variable_buffer; /* bird fix - variable_buffer may have been reallocated. */
    735732
    736733
     
    11931190    puts (_("#  Phony target (prerequisite of .PHONY)."));
    11941191  if (f->cmd_target)
    1195     puts (_("#  Command-line target."));
     1192    puts (_("#  Command line target."));
    11961193  if (f->dontcare)
    11971194    puts (_("#  A default, MAKEFILES, or -include/sinclude makefile."));
     
    12271224    {
    12281225    case cs_running:
    1229       puts (_("#  Commands currently running (THIS IS A BUG)."));
     1226      puts (_("#  Recipe currently running (THIS IS A BUG)."));
    12301227      break;
    12311228    case cs_deps_running:
    1232       puts (_("#  Dependencies commands running (THIS IS A BUG)."));
     1229      puts (_("#  Dependencies recipe running (THIS IS A BUG)."));
    12331230      break;
    12341231    case cs_not_started:
Note: See TracChangeset for help on using the changeset viewer.