home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD2.mdf / c / tools / make / pdmake / make.h < prev    next >
C/C++ Source or Header  |  1990-07-06  |  3KB  |  108 lines

  1. /*
  2.  * make.h
  3.  *
  4.  * 88-10-01 v1.0    created by greg yachuk, placed in the public domain
  5.  * 88-10-06 v1.1    changed prerequisite list handling
  6.  * 88-11-11 v1.2    fixed some bugs and added environment variables
  7.  * 89-07-12 v1.3    stop appending shell commands, and flush output
  8.  * 89-08-01 v1.4 AB    lots of new options and code
  9.  * 89-10-30 v1.5    -f -S -q options, took some changes from v1.4
  10.  * 90-04-18 v1.6    -b -- -W options, emulate <<, non-BSD cleanup
  11.  */
  12.  
  13. #define MAKEINI "default.mk"
  14.  
  15. #ifdef    MSDOS
  16. #define    PATH_SEPARATOR    ";"
  17. #define    FILE_SEPARATOR    ":/\\"
  18. #define    SHELL_METAS    "<|>"
  19. #else
  20. #define    PATH_SEPARATOR    ":"
  21. #define    FILE_SEPARATOR    "/"
  22. #define    SHELL_METAS    "<|>`*?()[];&$"
  23. #endif
  24.  
  25. #define    MAXNEGTIME    0x80000000
  26.  
  27. #define    equal(s,t)        (!strcmp((s),(t)))
  28. #define    get_target(t)        hash_target((t), NULL)
  29. #define    get_file(f)        hash_file((f), NULL)
  30. #define    append_preq(t,p)    (fileptr*)append_node((char**)(t),(char**)(p),sizeof(fileptr*))
  31. #define    append_shell(t,s)    (shellptr*)append_node((char**)(t),(char**)(s),sizeof(shellptr*))
  32.  
  33. typedef unsigned short t_mask;
  34.  
  35. typedef struct targnode
  36. {
  37.     t_mask  tmask;        /* mask to avoid string compares */
  38.     struct targnode *tnext;    /* next target in global target list */
  39.     struct filenode *tfile;    /* file node for this target */
  40.     struct filenode **tpreq;/* pre-req list for this target */
  41.     struct shellnode **tshell;    /* command list for this target */
  42. }       targnode, *targptr;
  43.  
  44. typedef struct filenode
  45. {
  46.     t_mask  fmask;        /* mask to avoid string compares */
  47.     char   *fname;        /* name of this file (targ, preq...) */
  48.     long    ftime;        /* last MODIFY time for this file */
  49.     struct filenode *fnext;    /* next file node in global file list */
  50. }       filenode, *fileptr;
  51.  
  52. typedef struct shellnode
  53. {
  54.     char   *scmd;        /* text of command */
  55.     unsigned s_silent:1;    /* don't echo before executing */
  56.     unsigned s_ignore:1;    /* ignore exit status */
  57.     unsigned s_shell:1;    /* force spawning of command.com */
  58.     struct shellnode *slink;/* next shell node in global list */
  59. }       shellnode, *shellptr;
  60.  
  61. typedef struct symnode
  62. {
  63.     t_mask  smask;        /* mask to avoid string compares */
  64.     char   *sname;        /* name of a symbol */
  65.     char   *svalue;        /* value of a symbol */
  66.     struct symnode *snext;    /* next symbol node in global list */
  67.     int     scmd;        /* command line macro? */
  68.     int     slevel;        /* level of new_make() */
  69. }       symnode, *symptr;
  70.  
  71. typedef struct optnode
  72. {
  73.     unsigned depend;    /* -d */
  74.     unsigned display:1;    /* -D */
  75.     unsigned envirn:1;    /* -e */
  76.     unsigned ignore:1;    /* -i */
  77.     unsigned keepon:1;    /* -k */
  78.     unsigned noexec:1;    /* -n */
  79.     unsigned query:1;    /* -q */
  80.     unsigned silent:1;    /* -s */
  81.     unsigned touch:1;    /* -t */
  82.     char   *make;        /* current value of $(MAKE) */
  83. }       optnode;
  84.  
  85. extern targptr target_list;    /* global list of targets */
  86. extern fileptr file_list;    /* global list of file nodes */
  87. extern symptr symbol_list;    /* global list of symbol nodes */
  88. extern shellptr shell_list;    /* global list of shell nodes */
  89.  
  90. extern char **shell_cmds;    /* commands which force usage of SHELL */
  91.  
  92. extern int make_level;        /* level of new_make() */
  93.  
  94. extern targptr first_targ;    /* first target (if nothing named) */
  95. extern targptr suffix_targ;    /* target node of ".SUFFIXES" */
  96.  
  97. extern optnode opts;        /* various options */
  98. extern char **tlist;        /* list of command line targets */
  99. extern long now;        /* current time */
  100.  
  101. #ifndef    MSDOS
  102. char   *getenv();
  103.  
  104. #define    P_WAIT        1
  105. #define    P_NOWAIT    2
  106. #define    P_OVERLAY    3
  107. #endif                /* MSDOS */
  108.