Ignore:
Timestamp:
Jun 17, 2012, 10:45:31 PM (13 years ago)
Author:
bird
Message:

kmk: Merged in changes from GNU make 3.82. Previous GNU make base version was gnumake-2008-10-28-CVS.

Location:
trunk/src/kmk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk

    • Property svn:ignore
      •  

        old new  
        1313stamp-*
        1414makebook*
         15
        1516.*gdbinit
         17.gdb_history
         18
        1619*.dep
        1720*.dvi
         
        3134*.pg
        3235*.pgs
         36
        3337README
        3438README.DOS
        3539README.W32
         40README.OS2
        3641aclocal.m4
        3742autom4te.cache
         
        5257config.h.W32
        5358config.h-vms
         59
        5460loadavg
        5561loadavg.c
        5662make
         63
        5764.deps
        5865.dep_segment
         66ID
         67TAGS
         68
        5969_*
        6070sun4
         
        7282sol2
        7383i486-linux
         84
        7485customs
         86
        7587install-sh
        7688mkinstalldirs
         89
         90.directive.asc
  • trunk/src/kmk/incdep.c

    r2546 r2591  
    114114};
    115115
    116 struct incdep_recorded_files
    117 {
    118     struct incdep_recorded_files *next;
     116struct incdep_recorded_file
     117{
     118    struct incdep_recorded_file *next;
    119119
    120120    /* the parameters */
    121121    struct strcache2_entry *filename_entry; /* dep strcache; converted to a nameseq record. */
    122     const char *pattern;                    /* NULL */
    123     const char *pattern_percent;            /* NULL */
    124122    struct dep *deps;                       /* All the names are dep strcache entries. */
    125     unsigned int cmds_started;              /* 0 */
    126     char *commands;                         /* NULL */
    127     unsigned int commands_idx;              /* 0 */
    128     int two_colon;                          /* 0 */
    129123    const struct floc *flocp;               /* NILF */
    130124};
     
    149143  struct incdep_variable_def *recorded_variable_defs_tail;
    150144
    151   struct incdep_recorded_files *recorded_files_head;
    152   struct incdep_recorded_files *recorded_files_tail;
     145  struct incdep_recorded_file *recorded_file_head;
     146  struct incdep_recorded_file *recorded_file_tail;
    153147#endif
    154148
     
    232226static void incdep_flush_it (struct floc *);
    233227static void eval_include_dep_file (struct incdep *, struct floc *);
     228static void incdep_commit_recorded_file (const char *filename, struct dep *deps,
     229                                         const struct floc *flocp);
    234230
    235231
     
    501497  assert (!cur->recorded_variables_in_set_head);
    502498  assert (!cur->recorded_variable_defs_head);
    503   assert (!cur->recorded_files_head);
     499  assert (!cur->recorded_file_head);
    504500#endif
    505501
     
    727723          if (rec_size < sizeof (struct incdep_variable_def))
    728724            rec_size = sizeof (struct incdep_variable_def);
    729           if (rec_size < sizeof (struct incdep_recorded_files))
    730             rec_size = sizeof (struct incdep_recorded_files);
     725          if (rec_size < sizeof (struct incdep_recorded_file))
     726            rec_size = sizeof (struct incdep_recorded_file);
    731727          alloccache_init (&incdep_rec_caches[i], rec_size, "incdep rec",
    732728                           incdep_cache_allocator, (void *)(size_t)i);
     
    849845  struct incdep_variable_in_set *rec_vis;
    850846  struct incdep_variable_def *rec_vd;
    851   struct incdep_recorded_files *rec_f;
     847  struct incdep_recorded_file *rec_f;
    852848
    853849  /* define_variable_in_set */
     
    898894  /* record_files */
    899895
    900   rec_f = cur->recorded_files_head;
    901   cur->recorded_files_head = cur->recorded_files_tail = NULL;
     896  rec_f = cur->recorded_file_head;
     897  cur->recorded_file_head = cur->recorded_file_tail = NULL;
    902898  if (rec_f)
    903899    do
     
    905901        void *free_me = rec_f;
    906902        struct dep *dep;
    907         struct nameseq *filenames;
    908903
    909904        for (dep = rec_f->deps; dep; dep = dep->next)
    910905          dep->name = incdep_flush_strcache_entry ((struct strcache2_entry *)dep->name);
    911906
    912         filenames = (struct nameseq *) alloccache_alloc (&nameseq_cache);
    913         filenames->next = 0;
    914         filenames->name = incdep_flush_strcache_entry (rec_f->filename_entry);
    915 
    916         record_files (filenames,
    917                       rec_f->pattern,
    918                       rec_f->pattern_percent,
    919                       rec_f->deps,
    920                       rec_f->cmds_started,
    921                       rec_f->commands,
    922                       rec_f->commands_idx,
    923                       rec_f->two_colon,
    924                       rec_f->flocp);
     907        incdep_commit_recorded_file (incdep_flush_strcache_entry (rec_f->filename_entry),
     908                                     rec_f->deps,
     909                                     rec_f->flocp);
    925910
    926911        rec_f = rec_f->next;
     
    10741059}
    10751060
    1076 /* Record files.*/
     1061/* Similar to record_files in read.c, only much much simpler. */
    10771062static void
    1078 incdep_record_files (struct incdep *cur,
    1079                      const char *filename, const char *pattern,
    1080                      const char *pattern_percent, struct dep *deps,
    1081                      unsigned int cmds_started, char *commands,
    1082                      unsigned int commands_idx, int two_colon,
    1083                      const struct floc *flocp)
     1063incdep_commit_recorded_file (const char *filename, struct dep *deps,
     1064                             const struct floc *flocp)
     1065{
     1066  struct file *f;
     1067
     1068  /* Perform some validations. */
     1069  if (filename[0] == '.'
     1070      && (   streq(filename, ".POSIX")
     1071          || streq(filename, ".EXPORT_ALL_VARIABLES")
     1072          || streq(filename, ".INTERMEDIATE")
     1073          || streq(filename, ".LOW_RESOLUTION_TIME")
     1074          || streq(filename, ".NOTPARALLEL")
     1075          || streq(filename, ".ONESHELL")
     1076          || streq(filename, ".PHONY")
     1077          || streq(filename, ".PRECIOUS")
     1078          || streq(filename, ".SECONDARY")
     1079          || streq(filename, ".SECONDTARGETEXPANSION")
     1080          || streq(filename, ".SILENT")
     1081          || streq(filename, ".SHELLFLAGS")
     1082          || streq(filename, ".SUFFIXES")
     1083         )
     1084     )
     1085    {
     1086      error (flocp, _("reserved filename '%s' used in dependency file, ignored"), filename);
     1087      return;
     1088    }
     1089
     1090  /* Lookup or create an entry in the database. */
     1091  f = enter_file (filename);
     1092  if (f->double_colon)
     1093    {
     1094      error (flocp, _("dependency file '%s' has a double colon entry already, ignoring"), filename);
     1095      return;
     1096    }
     1097  f->is_target = 1;
     1098
     1099  /* Append dependencies. */
     1100  deps = enter_prereqs (deps, NULL);
     1101  if (deps)
     1102    {
     1103      struct dep *last = f->deps;
     1104      if (!last)
     1105        f->deps = deps;
     1106      else
     1107        {
     1108          while (last->next)
     1109            last = last->next;
     1110          last->next = deps;
     1111        }
     1112    }
     1113}
     1114
     1115/* Record a file.*/
     1116static void
     1117incdep_record_file (struct incdep *cur,
     1118                    const char *filename,
     1119                    struct dep *deps,
     1120                    const struct floc *flocp)
    10841121{
    10851122  if (cur->worker_tid == -1)
    1086     {
    1087       struct nameseq *filenames = (struct nameseq *) alloccache_alloc (&nameseq_cache);
    1088       filenames->next = 0;
    1089       filenames->name = filename;
    1090       record_files (filenames, pattern, pattern_percent, deps, cmds_started,
    1091                     commands, commands_idx, two_colon, flocp);
    1092     }
     1123    incdep_commit_recorded_file (filename, deps, flocp);
    10931124#ifdef PARSE_IN_WORKER
    10941125  else
    10951126    {
    1096       struct incdep_recorded_files *rec =
    1097         (struct incdep_recorded_files *) incdep_alloc_rec (cur);
     1127      struct incdep_recorded_file *rec =
     1128        (struct incdep_recorded_file *) incdep_alloc_rec (cur);
    10981129
    10991130      rec->filename_entry = (struct strcache2_entry *)filename;
    1100       rec->pattern = pattern;
    1101       rec->pattern_percent = pattern_percent;
    11021131      rec->deps = deps;
    1103       rec->cmds_started = cmds_started;
    1104       rec->commands = commands;
    1105       rec->commands_idx = commands_idx;
    1106       rec->two_colon = two_colon;
    11071132      rec->flocp = flocp;
    11081133
    11091134      rec->next = NULL;
    1110       if (cur->recorded_files_tail)
    1111         cur->recorded_files_tail->next = rec;
     1135      if (cur->recorded_file_tail)
     1136        cur->recorded_file_tail->next = rec;
    11121137      else
    1113         cur->recorded_files_head = rec;
    1114       cur->recorded_files_tail = rec;
     1138        cur->recorded_file_head = rec;
     1139      cur->recorded_file_tail = rec;
    11151140    }
    11161141#endif
     
    15311556
    15321557              /* enter the file with its dependencies. */
    1533               incdep_record_files (curdep,
    1534                                    filename, NULL, NULL, deps, 0, NULL, 0, 0, f);
     1558              incdep_record_file (curdep, filename, deps, f);
    15351559            }
    15361560        }
     
    16301654       cur->recorded_variable_defs_head = NULL;
    16311655       cur->recorded_variable_defs_tail = NULL;
    1632        cur->recorded_files_head = NULL;
    1633        cur->recorded_files_tail = NULL;
     1656       cur->recorded_file_head = NULL;
     1657       cur->recorded_file_tail = NULL;
    16341658#endif
    16351659
Note: See TracChangeset for help on using the changeset viewer.