Ignore:
Timestamp:
Sep 15, 2006, 7:09:38 AM (19 years ago)
Author:
bird
Message:

Untested merge with GNU Make v3.81 (vendor/gnumake/2005-05-16 -> vendor/gnumake/current).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gmake/vpath.c

    r154 r503  
    11/* Implementation of pattern-matching file search paths for GNU Make.
    2 Copyright (C) 1988,89,91,92,93,94,95,96,97 Free Software Foundation, Inc.
     2Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
     31998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software
     4Foundation, Inc.
    35This file is part of GNU Make.
    46
    5 GNU Make is free software; you can redistribute it and/or modify
    6 it under the terms of the GNU General Public License as published by
    7 the Free Software Foundation; either version 2, or (at your option)
    8 any later version.
    9 
    10 GNU Make is distributed in the hope that it will be useful,
    11 but WITHOUT ANY WARRANTY; without even the implied warranty of
    12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13 GNU General Public License for more details.
    14 
    15 You should have received a copy of the GNU General Public License
    16 along with GNU Make; see the file COPYING.  If not, write to
    17 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    18 Boston, MA 02111-1307, USA.  */
     7GNU Make is free software; you can redistribute it and/or modify it under the
     8terms of the GNU General Public License as published by the Free Software
     9Foundation; either version 2, or (at your option) any later version.
     10
     11GNU Make is distributed in the hope that it will be useful, but WITHOUT ANY
     12WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
     13A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
     14
     15You should have received a copy of the GNU General Public License along with
     16GNU Make; see the file COPYING.  If not, write to the Free Software
     17Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.  */
    1918
    2019#include "make.h"
     
    471470         In December 1993 I loosened this restriction to allow a file
    472471         to be chosen if it is mentioned as a target in a makefile.  This
    473          seem logical.  */
     472         seem logical.
     473
     474         Special handling for -W / -o: make sure we preserve the special
     475         values here.  Actually this whole thing is a little bogus: I think
     476         we should ditch the name/hname thing and look into the renamed
     477         capability that already exists for files: that is, have a new struct
     478         file* entry for the VPATH-found file, and set the renamed field if
     479         we use it.
     480      */
    474481      {
    475482        struct file *f = lookup_file (name);
    476483        if (f != 0)
    477           exists = not_target || f->is_target;
     484          {
     485            exists = not_target || f->is_target;
     486            if (exists && mtime_ptr
     487                && (f->last_mtime == OLD_MTIME || f->last_mtime == NEW_MTIME))
     488              {
     489                *mtime_ptr = f->last_mtime;
     490                mtime_ptr = 0;
     491              }
     492          }
    478493      }
    479494
     
    522537                  continue;
    523538                }
     539
     540              /* Store the modtime into *MTIME_PTR for the caller.  */
     541              if (mtime_ptr != 0)
     542                {
     543                  *mtime_ptr = FILE_TIMESTAMP_STAT_MODTIME (name, st);
     544                  mtime_ptr = 0;
     545                }
    524546            }
    525547
     
    529551          *file = savestring (name, (n + 1 - name) + flen);
    530552
     553          /* If we get here and mtime_ptr hasn't been set, record
     554             UNKNOWN_MTIME to indicate this.  */
    531555          if (mtime_ptr != 0)
    532             /* Store the modtime into *MTIME_PTR for the caller.
    533                If we have had no need to stat the file here,
    534                we record UNKNOWN_MTIME to indicate this.  */
    535             *mtime_ptr = (exists_in_cache
    536                           ? FILE_TIMESTAMP_STAT_MODTIME (name, st)
    537                           : UNKNOWN_MTIME);
     556            *mtime_ptr = UNKNOWN_MTIME;
    538557
    539558          free (name);
Note: See TracChangeset for help on using the changeset viewer.