Ignore:
Timestamp:
Mar 14, 2018, 10:28:10 PM (7 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 4.2.1 (2e55f5e4abdc0e38c1d64be703b446695e70b3b6 / https://git.savannah.gnu.org/git/make.git).

Location:
trunk/src/kmk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

  • trunk/src/kmk/filedef.h

    r2788 r3140  
    11/* Definition of target file data structures for GNU Make.
    2 Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997,
    3 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
    4 2010 Free Software Foundation, Inc.
     2Copyright (C) 1988-2016 Free Software Foundation, Inc.
    53This file is part of GNU Make.
    64
     
    2018/* Structure that represents the info on one file
    2119   that the makefile says how to make.
    22    All of these are chained together through `next'.  */
     20   All of these are chained together through 'next'.  */
    2321
    2422#include "hash.h"
     
    3432                                   demaned by func_deps. */
    3533#endif
    36     struct commands *cmds;      /* Commands to execute for this target.  */
    37     int command_flags;          /* Flags OR'd in for cmds; see commands.h.  */
    38     const char *stem;           /* Implicit stem, if an implicit
     34    struct commands *cmds;      /* Commands to execute for this target.  */
     35    const char *stem;           /* Implicit stem, if an implicit
    3936                                   rule has been used */
    40     struct dep *also_make;      /* Targets that are made by making this.  */
    41     FILE_TIMESTAMP last_mtime;  /* File's modtime, if already known.  */
    42     FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
    43                                            has been performed.  */
    44     struct file *prev;          /* Previous entry for same file name;
    45                                    used when there are multiple double-colon
    46                                    entries for the same file.  */
     37    struct dep *also_make;      /* Targets that are made by making this.  */
     38    struct file *prev;          /* Previous entry for same file name;
     39                                   used when there are multiple double-colon
     40                                   entries for the same file.  */
    4741    struct file *last;          /* Last entry for the same file name.  */
    4842
    4943    /* File that this file was renamed to.  After any time that a
    50        file could be renamed, call `check_renamed' (below).  */
     44       file could be renamed, call 'check_renamed' (below).  */
    5145    struct file *renamed;
    5246
     
    7872#endif
    7973
    80     short int update_status;    /* Status of the last attempt to update,
    81                                    or -1 if none has been made.  */
    82 
    83     enum cmd_state              /* State of the commands.  */
    84       {         /* Note: It is important that cs_not_started be zero.  */
    85         cs_not_started,         /* Not yet started.  */
    86         cs_deps_running,        /* Dep commands running.  */
    87         cs_running,             /* Commands running.  */
    88         cs_finished             /* Commands finished.  */
     74    FILE_TIMESTAMP last_mtime;  /* File's modtime, if already known.  */
     75    FILE_TIMESTAMP mtime_before_update; /* File's modtime before any updating
     76                                           has been performed.  */
     77    unsigned int considered;    /* equal to 'considered' if file has been
     78                                   considered on current scan of goal chain */
     79    int command_flags;          /* Flags OR'd in for cmds; see commands.h.  */
     80    enum update_status          /* Status of the last attempt to update.  */
     81      {
     82        us_success = 0,         /* Successfully updated.  Must be 0!  */
     83        us_none,                /* No attempt to update has been made.  */
     84        us_question,            /* Needs to be updated (-q is is set).  */
     85        us_failed               /* Update failed.  */
     86      } update_status ENUM_BITFIELD (2);
     87    enum cmd_state              /* State of the commands.  */
     88      {
     89        cs_not_started = 0,     /* Not yet started.  Must be 0!  */
     90        cs_deps_running,        /* Dep commands running.  */
     91        cs_running,             /* Commands running.  */
     92        cs_finished             /* Commands finished.  */
    8993      } command_state ENUM_BITFIELD (2);
    9094
    91     unsigned int precious:1;    /* Non-0 means don't delete file on quit */
    92     unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
    93                                            has only one-second resolution.  */
     95    unsigned int builtin:1;     /* True if the file is a builtin rule. */
     96    unsigned int precious:1;    /* Non-0 means don't delete file on quit */
     97    unsigned int loaded:1;      /* True if the file is a loaded object. */
     98    unsigned int low_resolution_time:1; /* Nonzero if this file's time stamp
     99                                           has only one-second resolution.  */
    94100    unsigned int tried_implicit:1; /* Nonzero if have searched
    95                                       for implicit rule for making
    96                                       this file; don't search again.  */
    97     unsigned int updating:1;    /* Nonzero while updating deps of this file */
    98     unsigned int updated:1;     /* Nonzero if this file has been remade.  */
    99     unsigned int is_target:1;   /* Nonzero if file is described as target.  */
    100     unsigned int cmd_target:1;  /* Nonzero if file was given on cmd line.  */
    101     unsigned int phony:1;       /* Nonzero if this is a phony file
    102                                    i.e., a prerequisite of .PHONY.  */
     101                                      for implicit rule for making
     102                                      this file; don't search again.  */
     103    unsigned int updating:1;    /* Nonzero while updating deps of this file */
     104    unsigned int updated:1;     /* Nonzero if this file has been remade.  */
     105    unsigned int is_target:1;   /* Nonzero if file is described as target.  */
     106    unsigned int cmd_target:1;  /* Nonzero if file was given on cmd line.  */
     107    unsigned int phony:1;       /* Nonzero if this is a phony file
     108                                   i.e., a prerequisite of .PHONY.  */
    103109    unsigned int intermediate:1;/* Nonzero if this is an intermediate file.  */
    104110    unsigned int secondary:1;   /* Nonzero means remove_intermediates should
    105111                                   not delete it.  */
    106     unsigned int dontcare:1;    /* Nonzero if no complaint is to be made if
    107                                    this target cannot be remade.  */
     112    unsigned int dontcare:1;    /* Nonzero if no complaint is to be made if
     113                                   this target cannot be remade.  */
    108114    unsigned int ignore_vpath:1;/* Nonzero if we threw out VPATH name.  */
    109115    unsigned int pat_searched:1;/* Nonzero if we already searched for
    110116                                   pattern-specific variables.  */
    111     unsigned int considered:1;  /* equal to 'considered' if file has been
    112                                    considered on current scan of goal chain */
    113117    unsigned int no_diag:1;     /* True if the file failed to update and no
    114118                                   diagnostics has been issued (dontcare). */
     
    130134
    131135
    132 extern struct file *suffix_file, *default_file;
     136extern struct file *default_file;
    133137
    134138
     
    147151void notice_finished_file (struct file *file);
    148152void init_hash_files (void);
     153void verify_file_data_base (void);
    149154char *build_target_list (char *old_list);
    150155void print_prereqs (const struct dep *deps);
    151156void print_file_data_base (void);
     157int try_implicit_rule (struct file *file, unsigned int depth);
     158int stemlen_compare (const void *v1, const void *v2);
    152159
    153160#if FILE_TIMESTAMP_HI_RES
    154161# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
    155     file_timestamp_cons (fname, (st).st_mtime, (st).st_mtim.ST_MTIM_NSEC)
     162    file_timestamp_cons (fname, (st).st_mtime, (st).ST_MTIM_NSEC)
    156163#else
    157164# define FILE_TIMESTAMP_STAT_MODTIME(fname, st) \
     
    168175
    169176#define FILE_TIMESTAMP_S(ts) (((ts) - ORDINARY_MTIME_MIN) \
    170                               >> FILE_TIMESTAMP_LO_BITS)
     177                              >> FILE_TIMESTAMP_LO_BITS)
    171178#define FILE_TIMESTAMP_NS(ts) ((int) (((ts) - ORDINARY_MTIME_MIN) \
    172                                       & ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))
     179                                      & ((1 << FILE_TIMESTAMP_LO_BITS) - 1)))
    173180
    174181/* Upper bound on length of string "YYYY-MM-DD HH:MM:SS.NNNNNNNNN"
    175    representing a file timestamp.  The upper bound is not necessarily 19,
     182   representing a file timestamp.  The upper bound is not necessarily 29,
    176183   since the year might be less than -999 or greater than 9999.
    177184
     
    190197   + 1 + 1 + 4 + 25)
    191198
    192 FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, int);
     199FILE_TIMESTAMP file_timestamp_cons (char const *, time_t, long int);
    193200FILE_TIMESTAMP file_timestamp_now (int *);
    194201void file_timestamp_sprintf (char *p, FILE_TIMESTAMP ts);
     
    225232#else
    226233#define ORDINARY_MTIME_MAX ((FILE_TIMESTAMP_S (NEW_MTIME) \
    227                              << FILE_TIMESTAMP_LO_BITS) \
    228                             + ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
    229 #endif
    230 
    231 /* Modtime value to use for `infinitely new'.  We used to get the current time
    232    from the system and use that whenever we wanted `new'.  But that causes
     234                             << FILE_TIMESTAMP_LO_BITS) \
     235                            + ORDINARY_MTIME_MIN + FILE_TIMESTAMPS_PER_S - 1)
     236#endif
     237
     238/* Modtime value to use for 'infinitely new'.  We used to get the current time
     239   from the system and use that whenever we wanted 'new'.  But that causes
    233240   trouble when the machine running make and the machine holding a file have
    234    different ideas about what time it is; and can also lose for `force'
     241   different ideas about what time it is; and can also lose for 'force'
    235242   targets, which need to be considered newer than anything that depends on
    236243   them, even if said dependents' modtimes are in the future.  */
Note: See TracChangeset for help on using the changeset viewer.