home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / dmake40.zip / dmake.h < prev    next >
C/C++ Source or Header  |  1994-10-23  |  9KB  |  200 lines

  1. /* RCS      -- $Header: /u5/dvadura/src/public/dmake/src/RCS/dmake.h,v 1.1 1994/10/06 17:41:16 dvadura Exp $
  2. -- SYNOPSIS -- global defines for dmake.
  3. -- 
  4. -- DESCRIPTION
  5. --     All the interesting bits and flags that dmake uses are defined here.
  6. --
  7. -- AUTHOR
  8. --      Dennis Vadura, dvadura@watdragon.uwaterloo.ca
  9. --      CS DEPT, University of Waterloo, Waterloo, Ont., Canada
  10. --
  11. -- COPYRIGHT
  12. --      Copyright (c) 1992,1994 by Dennis Vadura.  All rights reserved.
  13. -- 
  14. --      This program is free software; you can redistribute it and/or
  15. --      modify it under the terms of the GNU General Public License
  16. --      (version 1), as published by the Free Software Foundation, and
  17. --      found in the file 'LICENSE' included with this distribution.
  18. -- 
  19. --      This program is distributed in the hope that it will be useful,
  20. --      but WITHOUT ANY WARRANTY; without even the implied warrant of
  21. --      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  22. --      GNU General Public License for more details.
  23. -- 
  24. --      You should have received a copy of the GNU General Public License
  25. --      along with this program;  if not, write to the Free Software
  26. --      Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  27. --
  28. -- LOG
  29. --     $Log: dmake.h,v $
  30.  * Revision 1.1  1994/10/06  17:41:16  dvadura
  31.  * dmake Release Version 4.0, Initial revision
  32.  *
  33. */
  34.  
  35. #ifndef _DMAKE_INCLUDED_
  36. #define _DMAKE_INCLUDED_
  37.  
  38. #define MAX_INC_DEPTH     10     /* max of ten nested include files      */
  39. #define MAX_COND_DEPTH      20     /* max nesting level of conditionals    */
  40. #define ERROR_EXIT_VALUE  255     /* return code of aborted make         */
  41. #define CONTINUATION_CHAR '\\'   /* line continuation \<nl>              */
  42. #define DEF_ESCAPE_CHAR   '\\'   /* escape char for used chars           */
  43. #define ESCAPE_CHAR       *Escape_char
  44. #define COMMENT_CHAR      '#'    /* start of comment chars               */
  45. #define TGT_DEP_SEP       ':'    /* separator for targets and dependents */
  46. #define CONDSTART      '.'     /* start of conditional token    eg .IF     */
  47. #define DEF_MAKE_PNAME    "dmake"/* default name to use as name of make  */
  48.  
  49.  
  50. /* ............... Hashing function constants ......................... */
  51. #define HASH_TABLE_SIZE  200            /* See hash.c for description   */
  52.  
  53.  
  54. /* Bit flags for cells and macro definitions. */
  55. #define M_DEFAULT        0x0000         /* default flag value           */
  56. #define M_MARK           0x0001         /* mark for circularity checks  */
  57. #define M_PRECIOUS       0x0002         /* keep macro, same as A_PRE... */
  58. #define M_MULTI          0x0004         /* multiple redefinitions ok!   */
  59. #define M_EXPANDED       0x0008         /* macro has been assigned      */
  60. #define M_USED         0x0010        /* macro has been expanded    */
  61. #define M_LITERAL     0x0020        /* don't strip w/s on macro def */
  62. #define    M_NOEXPORT     0x0040        /* don't export macro for -x    */
  63. #define M_FORCE         0x0080        /* Force a macro redefinition    */
  64. #define M_PUSH           0x0100         /* Push previous macro defintn  */
  65. #define M_VAR_BIT        0x1000         /* macro bit variable           */
  66. #define M_VAR_CHAR       0x2000         /* macro char variable          */
  67. #define M_VAR_STRING     0x4000         /* macro string variable        */
  68. #define M_VAR_INT     0x8000        /* macro integer variable    */
  69.  
  70. #define M_VAR_MASK       0xf000         /* macro variable mask          */
  71.  
  72.  
  73.  
  74. /* Global and target attribute flag definitions.
  75.  * If you change the values of these or re-order them make appropriate changes
  76.  * in dump.c so that the output of dmake -p matches the attribute info for a
  77.  * target. */
  78.  
  79. #define A_DEFAULT        0x00000        /* default flag value           */
  80. #define A_PRECIOUS       0x00001        /* object is precious           */
  81. #define A_SILENT         0x00002        /* don't echo commands          */
  82. #define A_LIBRARY        0x00004        /* target is an archive        */
  83. #define A_EPILOG         0x00008        /* insert shell epilog code     */
  84. #define A_PROLOG         0x00010        /* insert shell prolog code     */
  85. #define A_IGNORE         0x00020        /* ignore errors                */
  86. #define A_SYMBOL     0x00040    /* lib member is a symbol    */
  87. #define A_NOINFER     0x00080    /* no trans closure from cell    */
  88. #define A_UPDATEALL     0x00100    /* all targets of rule modified */
  89. #define A_SEQ         0x00200    /* sequential make attribute    */
  90. #define A_SETDIR         0x00400        /* cd to dir when making target */
  91. #define A_SHELL         0x00800    /* run the recipe using a shell */
  92. #define A_SWAP         0x01000    /* swap on exec.        */
  93. #define A_MKSARGS     0x02000    /* use MKS argument swapping    */
  94. #define A_PHONY         0x04000    /* .PHONY attribute        */
  95. #define A_NOSTATE        0x08000    /* don't track state for me     */
  96. #define A_IGNOREGROUP    0x10000    /* Ignore group recipe        */
  97. #define MAX_ATTR     A_IGNOREGROUP    /* highest valid attribute    */
  98. #define A_LIBRARYM       0x20000        /* target is an archive member  */
  99. #define A_FRINGE     0x40000    /* cell is on the fringe    */
  100. #define A_COMPOSITE     0x80000    /* member of lib(targ) name    */
  101. #define A_FFNAME    0x100000    /* if set, free ce_fname in stat*/
  102. #define A_UPDATED    0x200000    /* Used to mark cell as updated */
  103. #define A_ROOT          0x400000    /* True if it is a root prereq  */
  104. #define A_GROUP        0x800000    /* True if rule is to be a group*/
  105. #define A_WHATIF      0x01000000    /* used for WHATIF tests    */
  106. #define A_POOL          0x02000000    /* used for directory pool    */
  107. #define A_ERROR          0x04000000    /* used to halt construction    */
  108. #define A_FIRST          0x08000000    /* used for .INCLUDE termination*/
  109.  
  110.  
  111. /* Global and target bit flag definitions */
  112.  
  113. #define F_DEFAULT        0x0000         /* default flag value           */
  114. #define F_MARK         0x0001        /* circularity check mark    */
  115. #define F_MULTI         0x0002        /* multiple rules for target    */
  116. #define F_SINGLE     0x0004        /* exec rules one/prerequisite  */
  117. #define F_TARGET     0x0008        /* marks a target        */
  118. #define F_RULES          0x0010         /* indicates target has rules   */
  119. #define F_GROUP          0x0020         /* indicates that rules are to  */
  120.                         /* fed to the shell as a group  */
  121.  
  122. #define F_TRANS         0x0040        /* same as F_STAT not used tgthr*/
  123. #define F_STAT         0x0040        /* target already stated    */
  124. #define F_VISITED     0x0080        /* target scheduled for make    */
  125. #define F_USED         0x0080        /* used in releparse.c        */
  126. #define F_SPECIAL     0x0100        /* marks a special target    */
  127. #define F_DFA          0x0200        /* bit for marking added DFA    */
  128. #define F_EXPLICIT     0x0400        /* explicit target in makefile  */
  129. #define F_PERCENT     0x0800        /* marks a target as a % rule    */
  130. #define F_REMOVE     0x1000        /* marks an intermediate target */
  131. #define F_MAGIC         0x2000        /* marks a magic target        */
  132. #define F_INFER         0x4000        /* target is result of inference*/
  133. #define F_MADE         0x8000        /* target is manufactured    */
  134.  
  135.  
  136. /* Definitions for the Parser states */
  137. #define NORMAL_SCAN    0      /* normal processing state */
  138. #define RULE_SCAN      1      /* scan of rule text       */
  139.  
  140. /* definitions for macro operator types */
  141. #define M_OP_EQ   1           /* macro operation is '='   0000 0001 */
  142. #define M_OP_CL   3           /* macro operation is ':='  0000 0011 */
  143. #define M_OP_PL   5           /* macro operation is '+='  0000 0101 */
  144. #define M_OP_DF   9          /* macro operation is '*='  0000 1001 */
  145. #define M_OP_PLCL 7           /* macro operation is '+:=' 0000 0111 */
  146. #define M_OP_DFCL 11          /* macro operation is '*:=' 0000 1011 */
  147. #define M_OP_CM   17          /* macro operation is '?='  0001 0001 */
  148. #define M_OP_SI   32          /* macro operation is '!'   0010 ---- */
  149.  
  150. /* definitions for rule operator types */
  151. #define R_OP_CL   1           /* rule operation is ':'   */
  152. #define R_OP_DCL  2           /* rule operation is '::'  */
  153. #define R_OP_BG   4           /* rule operation is ':!'  */
  154. #define R_OP_UP   8           /* rule operation is ':^'  */
  155. #define R_OP_MI  16           /* rule operation is ':-'  */
  156. #define R_OP_OR  32           /* rule operation is ':|'  */
  157.  
  158. /* definitions for modifier application in Apply_modifiers in expand.c */
  159. #define SUFFIX_FLAG    1     /* defines for macro modifier code */
  160. #define DIRECTORY_FLAG    2
  161. #define FILE_FLAG    4
  162. #define WHOLENAME_FLAGS 7
  163. #define TOLOWER_FLAG    8
  164. #define TOUPPER_FLAG    16
  165. #define INFNAME_FLAG    32
  166.  
  167. /* special target definitions for use inside dmake */
  168. #define ST_IF        1
  169. #define ST_ELSE        2
  170. #define ST_END        3
  171. #define ST_REST        4    /* remaining special targets */
  172. #define ST_INCLUDE    5
  173. #define ST_SOURCE    7
  174. #define ST_EXPORT    8
  175. #define ST_IMPORT    9
  176. #define ST_ELIF        10
  177. #define ST_KEEP           11
  178. #define ST_EXIT        12
  179.  
  180. /* Flags for controling use of -v switch */
  181. #define V_NONE        0x00
  182. #define V_LEAVE_TMP    0x01
  183. #define V_DIR_SET    0x02
  184. #define V_DIR_CACHE     0x04
  185. #define V_INFER            0x08
  186. #define V_MAKE        0x10
  187. #define V_FILE_IO       0x20
  188. #define V_ALL        (V_LEAVE_TMP | V_DIR_SET | V_INFER | V_MAKE |\
  189.              V_FILE_IO | V_DIR_CACHE)
  190.  
  191. /* Macro definitions for use inside dmake */
  192. #define SET_TOKEN(A, B)  (A)->tk_str = (B); (A)->tk_cchar = *(B);\
  193.              (A)->tk_quote = 1;
  194. #define CLEAR_TOKEN(A)   *(A)->tk_str = (A)->tk_cchar
  195. #define GET_MACRO(A)     Get_name(A, Macs, FALSE)
  196. #define iswhite(C)          ((C == ' ') || (C == '\t'))
  197.  
  198. #endif
  199.  
  200.