home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / MISC / GNU / MAK358AS.ZIP / FILE.H < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-22  |  4.6 KB  |  122 lines

  1. /* Copyright (C) 1988, 1989, 1990 Free Software Foundation, Inc.
  2. This file is part of GNU Make.
  3.  
  4. GNU Make is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 1, or (at your option)
  7. any later version.
  8.  
  9. GNU Make is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12. GNU General Public License for more details.
  13.  
  14. You should have received a copy of the GNU General Public License
  15. along with GNU Make; see the file COPYING.  If not, write to
  16. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  17.  
  18. /*
  19.  * MS-DOS port (c) 1990 by Thorsten Ohl <ohl@gnu.ai.mit.edu>
  20.  *
  21.  * To this port, the same copying conditions apply as to the
  22.  * original release.
  23.  *
  24.  * IMPORTANT:
  25.  * This file is not identical to the original GNU release!
  26.  * You should have received this code as patch to the official
  27.  * GNU release.
  28.  *
  29.  * MORE IMPORTANT:
  30.  * This port comes with ABSOLUTELY NO WARRANTY.
  31.  *
  32.  * $Header: e:/gnu/make/RCS/file.h'v 3.58.0.1 90/07/17 01:00:03 tho Exp $
  33.  */
  34.  
  35. /* Structure that represents the info on one file
  36.    that the makefile says how to make.
  37.    All of these are chained together through `next'.  */
  38.  
  39. struct file
  40.   {
  41.     struct file *next;
  42.     char *name;
  43.     struct dep *deps;
  44.     struct commands *cmds;    /* Commands to execute for this target */
  45.     char *stem;            /* Implicit stem, if an implicit
  46.                        rule has been used */
  47.     char **also_make;        /* Targets that are also made by this file's
  48.                    commands, an implicit rule was used.  */
  49.     time_t last_mtime;        /* File's modtime, if already known.  */
  50.     struct file *prev;        /* Previous entry for same file name;
  51.                    used when there are multiple double-colon
  52.                    entries for the same file.  */
  53.  
  54.     /* File that this file was renamed to.  After any time that a
  55.        file could be renamed, call `check_renamed' (below).  */
  56.     struct file *renamed;
  57.  
  58.     /* List of variable sets used for this file.  */
  59.     struct variable_set_list *variables;
  60.  
  61.     /* Immediate dependent that caused this target to be remade,
  62.        or nil if there isn't one.  */
  63.     struct file *parent;
  64.  
  65.     short int update_status;    /* Status of the last attempt to update,
  66.                    or -1 if none has been made.  */
  67.  
  68.     enum            /* State of the commands.  */
  69.       {        /* Note: It is important that cs_not_started be zero.  */
  70.     cs_not_started,        /* Not yet started.  */
  71.     cs_deps_running,    /* Dep commands running.  */
  72.     cs_running,        /* Commands running.  */
  73.     cs_finished,        /* Commands finished.  */
  74.     cs_invalid,
  75.       } command_state ENUM_BITFIELD (2);
  76.  
  77.     unsigned int double_colon:1;/* Nonzero for double-colon entry */
  78.     unsigned int precious:1;    /* Non-0 means don't delete file on quit */
  79.     unsigned int tried_implicit:1;/* Nonzero if have searched
  80.                      for implicit rule for making
  81.                      this file; don't search again.  */
  82.     unsigned int updating:1;    /* Nonzero while updating deps of this file */
  83.     unsigned int updated:1;    /* Nonzero if this file has been remade.  */
  84.     unsigned int is_target:1;    /* Nonzero if file is described as target.  */
  85.     unsigned int cmd_target:1;    /* Nonzero if file was given on cmd line.  */
  86.     unsigned int phony:1;    /* Nonzero if this is a phony file
  87.                    ie, a dependent of .PHONY.  */
  88.     unsigned int intermediate:1;/* Nonzero if this is an intermediate file.  */
  89.     unsigned int dontcare:1;    /* Nonzero if no complaint is to be made if
  90.                    this target cannot be remade.  */
  91.   };
  92.  
  93. /* Number of intermediate files entered.  */
  94.  
  95. extern unsigned int num_intermediates;
  96.  
  97. extern struct file *default_goal_file, *suffix_file, *default_file;
  98.  
  99. /*     file.c */
  100. #ifdef  MSDOS
  101. extern  struct file *enter_file (char *name);
  102. extern  struct file *lookup_file (char *name);
  103. extern  void print_file_data_base (void);
  104. extern  void remove_intermediates (int sig);
  105. extern  void rename_file (struct file *file, char *name);
  106. extern  void snap_deps (void);
  107. #else /* not MSDOS */
  108. extern struct file *lookup_file (), *enter_file ();
  109. extern void remove_intermediates (), snap_deps ();
  110. extern void rename_file ();
  111. #endif /* not MSDOS */
  112.  
  113. extern time_t f_mtime ();
  114. #define file_mtime_1(f, v) \
  115.   ((f)->last_mtime != (time_t) 0 ? (f)->last_mtime : f_mtime ((f), v))
  116. #define file_mtime(f) file_mtime_1 ((f), 1)
  117. #define file_mtime_no_search(f) file_mtime_1 ((f), 0)
  118.  
  119.  
  120. #define check_renamed(file) \
  121.   while ((file)->renamed != 0) (file) = (file)->renamed /* No ; here.  */
  122.