Ignore:
Timestamp:
May 23, 2007, 5:13:11 AM (18 years ago)
Author:
bird
Message:

Load /home/bird/src/Gnu/make/2007-05-23 into vendor/gnumake/current.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/gnumake/current/remake.c

    r501 r900  
    4040#endif
    4141
    42 extern int try_implicit_rule PARAMS ((struct file *file, unsigned int depth));
     42extern int try_implicit_rule (struct file *file, unsigned int depth);
    4343
    4444
     
    6161static unsigned int considered;
    6262
    63 static int update_file PARAMS ((struct file *file, unsigned int depth));
    64 static int update_file_1 PARAMS ((struct file *file, unsigned int depth));
    65 static int check_dep PARAMS ((struct file *file, unsigned int depth, FILE_TIMESTAMP this_mtime, int *must_make_ptr));
    66 static int touch_file PARAMS ((struct file *file));
    67 static void remake_file PARAMS ((struct file *file));
    68 static FILE_TIMESTAMP name_mtime PARAMS ((char *name));
    69 static int library_search PARAMS ((char **lib, FILE_TIMESTAMP *mtime_ptr));
     63static int update_file (struct file *file, unsigned int depth);
     64static int update_file_1 (struct file *file, unsigned int depth);
     65static int check_dep (struct file *file, unsigned int depth,
     66                      FILE_TIMESTAMP this_mtime, int *must_make_ptr);
     67static int touch_file (struct file *file);
     68static void remake_file (struct file *file);
     69static FILE_TIMESTAMP name_mtime (const char *name);
     70static const char *library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr);
    7071
    7172
     
    239240
    240241              /* Free the storage.  */
    241               free ((char *) g);
     242              free (g);
    242243
    243244              g = lastgoal == 0 ? goals : lastgoal->next;
     
    538539      if (!running)
    539540        /* The prereq is considered changed if the timestamp has changed while
    540            it was built, OR it doesn't exist.
    541            This causes the Linux kernel build to break.  We'll defer this
    542            fix until GNU make 3.82 to give them time to update.  */
     541           it was built, OR it doesn't exist.  */
    543542        d->changed = ((file_mtime (d->file) != mtime)
    544                       /* || (mtime == NONEXISTENT_MTIME) */);
     543                      || (mtime == NONEXISTENT_MTIME));
    545544
    546545      lastd = d;
     
    809808  if (touch_flag
    810809      /* The update status will be:
    811                 -1      if this target was not remade;
     810                -1      if this target was not remade;
    812811                0       if 0 or more commands (+ or ${MAKE}) were run and won;
    813812                1       if some commands were run and lost.
     
    919918             so that a vpath_search can happen.  Otherwise, it would
    920919             never be done because the target is already updated.  */
    921           (void) f_mtime (d->file, 0);
     920          f_mtime (d->file, 0);
    922921      }
    923922  else if (file->update_status == -1)
     
    928927
    929928
    930 /* Check whether another file (whose mtime is THIS_MTIME)
    931    needs updating on account of a dependency which is file FILE.
    932    If it does, store 1 in *MUST_MAKE_PTR.
    933    In the process, update any non-intermediate files
    934    that FILE depends on (including FILE itself).
    935    Return nonzero if any updating failed.  */
     929/* Check whether another file (whose mtime is THIS_MTIME) needs updating on
     930   account of a dependency which is file FILE.  If it does, store 1 in
     931   *MUST_MAKE_PTR.  In the process, update any non-intermediate files that
     932   FILE depends on (including FILE itself).  Return nonzero if any updating
     933   failed.  */
    936934
    937935static int
     
    947945  if (file->phony || !file->intermediate)
    948946    {
    949       /* If this is a non-intermediate file, update it and record
    950          whether it is newer than THIS_MTIME.  */
     947      /* If this is a non-intermediate file, update it and record whether it
     948         is newer than THIS_MTIME.  */
    951949      FILE_TIMESTAMP mtime;
    952950      dep_status = update_file (file, depth);
     
    977975        }
    978976
    979       /* If the intermediate file actually exists
    980          and is newer, then we should remake from it.  */
    981977      check_renamed (file);
    982978      mtime = file_mtime (file);
    983979      check_renamed (file);
    984980      if (mtime != NONEXISTENT_MTIME && mtime > this_mtime)
     981        /* If the intermediate file actually exists and is newer, then we
     982           should remake from it.  */
    985983        *must_make_ptr = 1;
    986           /* Otherwise, update all non-intermediate files we depend on,
    987              if necessary, and see whether any of them is more
    988              recent than the file on whose behalf we are checking.  */
    989984      else
    990985        {
     986          /* Otherwise, update all non-intermediate files we depend on, if
     987             necessary, and see whether any of them is more recent than the
     988             file on whose behalf we are checking.  */
    991989          struct dep *lastd;
    992990
     
    10671065        {
    10681066          struct stat statbuf;
    1069           char buf;
     1067          char buf = 'x';
    10701068          int e;
    10711069
     
    11631161      char *arname, *memname;
    11641162      struct file *arfile;
    1165       int arname_used = 0;
    11661163      time_t member_date;
    11671164
     
    11731170      arfile = lookup_file (arname);
    11741171      if (arfile == 0)
    1175         {
    1176           arfile = enter_file (arname);
    1177           arname_used = 1;
    1178         }
     1172        arfile = enter_file (strcache_add (arname));
    11791173      mtime = f_mtime (arfile, search);
    11801174      check_renamed (arfile);
     
    11871181          unsigned int arlen, memlen;
    11881182
    1189           if (!arname_used)
    1190             {
    1191               free (arname);
    1192               arname_used = 1;
    1193             }
    1194 
    1195           arname = arfile->hname;
    1196           arlen = strlen (arname);
     1183          arlen = strlen (arfile->hname);
    11971184          memlen = strlen (memname);
    11981185
    1199           /* free (file->name); */
    1200 
    1201           name = (char *) xmalloc (arlen + 1 + memlen + 2);
    1202           bcopy (arname, name, arlen);
     1186          name = xmalloc (arlen + 1 + memlen + 2);
     1187          memcpy (name, arfile->hname, arlen);
    12031188          name[arlen] = '(';
    1204           bcopy (memname, name + arlen + 1, memlen);
     1189          memcpy (name + arlen + 1, memname, memlen);
    12051190          name[arlen + 1 + memlen] = ')';
    12061191          name[arlen + 1 + memlen + 1] = '\0';
     
    12151200        }
    12161201
    1217       if (!arname_used)
    1218         free (arname);
    1219       free (memname);
     1202      free (arname);
    12201203
    12211204      file->low_resolution_time = 1;
     
    12381221        {
    12391222          /* If name_mtime failed, search VPATH.  */
    1240           char *name = file->name;
    1241           if (vpath_search (&name, &mtime)
     1223          const char *name = vpath_search (file->name, &mtime);
     1224          if (name
    12421225              /* Last resort, is it a library (-lxxx)?  */
    1243               || (name[0] == '-' && name[1] == 'l'
    1244                   && library_search (&name, &mtime)))
     1226              || (file->name[0] == '-' && file->name[1] == 'l'
     1227                  && (name = library_search (file->name, &mtime)) != 0))
    12451228            {
    12461229              if (mtime != UNKNOWN_MTIME)
     
    13611344
    13621345static FILE_TIMESTAMP
    1363 name_mtime (char *name)
     1346name_mtime (const char *name)
    13641347{
    13651348  FILE_TIMESTAMP mtime;
     
    14551438   directories.  */
    14561439
    1457 static int
    1458 library_search (char **lib, FILE_TIMESTAMP *mtime_ptr)
     1440static const char *
     1441library_search (const char *lib, FILE_TIMESTAMP *mtime_ptr)
    14591442{
    14601443  static char *dirs[] =
     
    14771460  static char *libpatterns = NULL;
    14781461
    1479   char *libname = &(*lib)[2];   /* Name without the `-l'.  */
     1462  const char *libname = lib+2;  /* Name without the '-l'.  */
    14801463  FILE_TIMESTAMP mtime;
    14811464
    14821465  /* Loop variables for the libpatterns value.  */
    1483   char *p, *p2;
     1466  char *p;
     1467  const char *p2;
    14841468  unsigned int len;
    14851469
    1486   char *file, **dp;
     1470  char **dp;
    14871471
    14881472  /* If we don't have libpatterns, get it.  */
     
    15331517      if (mtime != NONEXISTENT_MTIME)
    15341518        {
    1535           *lib = xstrdup (libbuf);
    15361519          if (mtime_ptr != 0)
    15371520            *mtime_ptr = mtime;
    1538           return 1;
     1521          return strcache_add (libbuf);
    15391522        }
    15401523
    15411524      /* Now try VPATH search on that.  */
    15421525
    1543       file = libbuf;
    1544       if (vpath_search (&file, mtime_ptr))
    1545         {
    1546           *lib = file;
    1547           return 1;
    1548         }
     1526      {
     1527        const char *file = vpath_search (libbuf, mtime_ptr);
     1528        if (file)
     1529          return file;
     1530      }
    15491531
    15501532      /* Now try the standard set of directories.  */
     
    15731555          if (mtime != NONEXISTENT_MTIME)
    15741556            {
    1575               *lib = xstrdup (buf);
    15761557              if (mtime_ptr != 0)
    15771558                *mtime_ptr = mtime;
    1578               return 1;
     1559              return strcache_add (buf);
    15791560            }
    15801561        }
Note: See TracChangeset for help on using the changeset viewer.