update dev300-m58
[ooovba.git] / dmake / dmake.h
blobdbff8470604cb6f4326b3dd9781507bb261e7e7a
1 /* RCS $Id: dmake.h,v 1.8 2007-10-15 15:38:34 ihi Exp $
2 --
3 -- SYNOPSIS
4 -- Global defines for dmake.
5 --
6 -- DESCRIPTION
7 -- All the interesting bits and flags that dmake uses are defined here.
8 --
9 -- AUTHOR
10 -- Dennis Vadura, dvadura@dmake.wticorp.com
12 -- WWW
13 -- http://dmake.wticorp.com/
15 -- COPYRIGHT
16 -- Copyright (c) 1996,1997 by WTI Corp. All rights reserved.
17 --
18 -- This program is NOT free software; you can redistribute it and/or
19 -- modify it under the terms of the Software License Agreement Provided
20 -- in the file <distribution-root>/readme/license.txt.
22 -- LOG
23 -- Use cvs log to obtain detailed change logs.
26 #ifndef _DMAKE_INCLUDED_
27 #define _DMAKE_INCLUDED_
29 #define MAX_INC_DEPTH 10 /* max of ten nested include files */
30 #define MAX_COND_DEPTH 20 /* max nesting level of conditionals */
31 #define ERROR_EXIT_VALUE 255 /* return code of aborted make */
32 #define CONTINUATION_CHAR '\\' /* line continuation \<nl> */
33 #define DEF_ESCAPE_CHAR '\\' /* escape char for used chars */
34 #define ESCAPE_CHAR *Escape_char
35 #define COMMENT_CHAR '#' /* start of comment chars */
36 #define TGT_DEP_SEP ':' /* separator for targets and dependents */
37 #define CONDSTART '.' /* start of conditional token eg .IF */
38 #define DEF_MAKE_PNAME "dmake"/* default name to use as name of make */
41 /* ............... Hashing function constants ......................... */
42 #define HASH_TABLE_SIZE 200 /* See hash.c for description */
45 /* Bit flags for cells and macro definitions. */
46 #define M_DEFAULT 0x0000 /* default flag value */
47 #define M_MARK 0x0001 /* mark for circularity checks */
48 #define M_PRECIOUS 0x0002 /* keep macro, same as A_PRE... */
49 #define M_MULTI 0x0004 /* multiple redefinitions ok! */
50 #define M_EXPANDED 0x0008 /* macro has been assigned after
51 * being completely expanded */
52 #define M_USED 0x0010 /* macro has been used in the
53 * makefile. (From another macro
54 * or target definition.) */
55 #define M_LITERAL 0x0020 /* don't strip w/s on macro def */
56 #define M_NOEXPORT 0x0040 /* don't export macro for -x */
57 #define M_FORCE 0x0080 /* Force a macro redefinition */
58 #define M_PUSH 0x0100 /* Push previous macro defintn */
59 #define M_INIT 0x0200 /* Macro is defined initially or
60 * an empty macro implicitly
61 * defined when expanding it. */
62 #define M_VAR_BIT 0x1000 /* macro bit variable */
63 #define M_VAR_CHAR 0x2000 /* macro char variable */
64 #define M_VAR_STRING 0x4000 /* macro string variable */
65 #define M_VAR_INT 0x8000 /* macro integer variable */
67 #define M_VAR_MASK 0xf000 /* macro variable mask */
71 /* Global and target attribute flag definitions.
72 * If you change the values of these or re-order them make appropriate changes
73 * in dmdump.c so that the output of dmake -p matches the attribute info for a
74 * target. */
76 #define A_DEFAULT 0x00000 /* default flag value */
77 #define A_PRECIOUS 0x00001 /* object is precious */
78 #define A_SILENT 0x00002 /* don't echo commands */
79 #define A_LIBRARY 0x00004 /* target is an archive */
80 #define A_EPILOG 0x00008 /* insert shell epilog code */
81 #define A_PROLOG 0x00010 /* insert shell prolog code */
82 #define A_IGNORE 0x00020 /* ignore errors */
83 #define A_SYMBOL 0x00040 /* lib member is a symbol */
84 #define A_NOINFER 0x00080 /* no trans closure from cell */
85 #define A_UPDATEALL 0x00100 /* all targets of rule modified */
86 #define A_SEQ 0x00200 /* sequential make attribute */
87 /* Reuse the sequential flag to signal Wait_for_completion to Do_cmnd()
88 * and related methods of executing a sub process. */
89 #define A_WFC A_SEQ
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 /* Use swap on MSDOS */
93 /* Reuse A_SWAP for the .WINPATH attribute to convert cygwin POSIX paths
94 * into DOS style paths. */
95 #define A_WINPATH 0x01000 /* Enable dos paths on cygwin */
96 #define A_MKSARGS 0x02000 /* use MKS argument swapping */
97 #define A_PHONY 0x04000 /* .PHONY attribute */
98 #define A_NOSTATE 0x08000 /* don't track state for me */
99 #define A_IGNOREGROUP 0x10000 /* Ignore group recipe */
100 #define A_EXECUTE 0x20000 /* execute this recipe under -n */
101 #define A_ERRREMOVE 0x40000 /* remove this target if error */
102 #define MAX_ATTR A_ERRREMOVE /* highest valid attribute */
103 #define A_LIBRARYM 0x80000 /* target is an archive member */
104 #define A_FRINGE 0x100000 /* cell is on the fringe */
105 #define A_COMPOSITE 0x200000 /* member of lib(targ) name */
106 #define A_FFNAME 0x400000 /* if set, free ce_fname in stat*/
107 #define A_UPDATED 0x800000 /* Used to mark cell as updated */
108 #define A_ROOT 0x01000000 /* True if it is a root prereq */
109 #define A_GROUP 0x02000000 /* True if rule is to be a group*/
110 #define A_WHATIF 0x04000000 /* used for WHATIF tests */
111 #define A_POOL 0x08000000 /* used for directory pool */
112 #define A_ERROR 0x10000000 /* used to halt construction */
113 #define A_FIRST 0x20000000 /* used for .INCLUDE termination*/
114 #define A_SHELLESC 0x40000000 /* used for shell escape target */
115 #define A_MUTE 0x80000000 /* silence a recipe line */
118 /* Global and target bit flag definitions */
120 #define F_DEFAULT 0x0000 /* default flag value */
121 #define F_MARK 0x0001 /* circularity check mark */
122 #define F_MULTI 0x0002 /* multiple rules for target */
123 #define F_SINGLE 0x0004 /* exec recipes for each out of
124 * date prerequisite (! ruleop) */
125 #define F_TARGET 0x0008 /* is set if a rule for a target exists.
126 * Prerequisites do not necessarily need
127 * to have a rule, in which case F_TARGET
128 * is not set. */
129 #define F_RULES 0x0010 /* indicates target has rules */
130 #define F_GROUP 0x0020 /* indicates that rules are to */
131 /* fed to the shell as a group */
133 #define F_TRANS 0x0040 /* same as F_STAT not used tgthr*/
134 #define F_STAT 0x0040 /* target already stated */
135 #define F_VISITED 0x0080 /* Used for two different purposes:
136 make.c: Mark that a target is scheduled
137 to be made.
138 rulparse.c: Detect circular
139 dependencies. */
140 #define F_SPECIAL 0x0100 /* marks a special target */
141 #define F_DFA 0x0200 /* bit for marking added DFA */
142 #define F_EXPLICIT 0x0400 /* explicit target in makefile */
143 #define F_PERCENT 0x0800 /* marks a target as a % rule */
144 #define F_REMOVE 0x1000 /* marks an intermediate target */
145 #define F_MAGIC 0x2000 /* marks a magic target */
146 #define F_INFER 0x4000 /* target is result of inference*/
147 #define F_MADE 0x8000 /* target is currently made */
150 /* Definitions for the Parser states */
151 #define NORMAL_SCAN 0 /* normal processing state */
152 #define RULE_SCAN 1 /* scan of rule text */
154 /* definitions for macro operator types */
155 #define M_OP_EQ 1 /* macro operation is '=' 0000 0001 */
156 #define M_OP_CL 3 /* macro operation is ':=' 0000 0011 */
157 #define M_OP_PL 5 /* macro operation is '+=' 0000 0101 */
158 #define M_OP_DF 9 /* macro operation is '*=' 0000 1001 */
159 #define M_OP_PLCL 7 /* macro operation is '+:=' 0000 0111 */
160 #define M_OP_DFCL 11 /* macro operation is '*:=' 0000 1011 */
161 #define M_OP_CM 17 /* macro operation is '?=' 0001 0001 */
162 #define M_OP_SI 32 /* macro operation is '!' 0010 ---- */
164 /* definitions for rule operator types */
165 #define R_OP_CL 1 /* rule operation is ':' */
166 #define R_OP_DCL 2 /* rule operation is '::' */
167 #define R_OP_BG 4 /* rule operation is ':!' */
168 #define R_OP_UP 8 /* rule operation is ':^' */
169 #define R_OP_MI 16 /* rule operation is ':-' */
170 #define R_OP_OR 32 /* rule operation is ':|' */
172 /* definitions for modifier application in Apply_modifiers in expand.c */
173 #define SUFFIX_FLAG 1 /* defines for macro modifier code */
174 #define DIRECTORY_FLAG 2
175 #define FILE_FLAG 4
176 #define WHOLENAME_FLAGS 7
177 #define TOLOWER_FLAG 8
178 #define TOUPPER_FLAG 16
179 #define INFNAME_FLAG 32
180 #define JUST_FIRST_FLAG 64
181 #define NORMPATH_FLAG 128
183 /* special target definitions for use inside dmake */
184 #define ST_IF 1
185 #define ST_ELSE 2
186 #define ST_END 3
187 #define ST_REST 4 /* remaining special targets */
188 #define ST_INCLUDE 5
189 #define ST_SOURCE 7
190 #define ST_EXPORT 8
191 #define ST_IMPORT 9
192 #define ST_ELIF 10
193 #define ST_KEEP 11
194 #define ST_EXIT 12
195 #define ST_IFEQ 13
196 #define ST_IFNEQ 14
198 /* Flags for controling use of -v switch */
199 #define V_NOFLAG 0x00 /* V_NONE is used in MinGW w32api/oleauto.h */
200 #define V_LEAVE_TMP 0x01
201 #define V_DIR_SET 0x02
202 #define V_DIR_CACHE 0x04
203 #define V_INFER 0x08
204 #define V_MAKE 0x10
205 #define V_FILE_IO 0x20
206 #define V_WARNALL 0x40
207 #define V_FORCEECHO 0x80
208 #define V_ALL (V_LEAVE_TMP | V_DIR_SET | V_INFER | V_MAKE |\
209 V_FILE_IO | V_DIR_CACHE | V_WARNALL | V_FORCEECHO)
211 /* Flags for controling use of -m switch */
212 #define M_NOFLAG 0x00
213 #define M_TARGET 0x01
214 #define M_RECIPE 0x02
215 #define M_ABSPATH 0x04
216 #define M_SHELLESC 0x08
217 #define M_ALL (M_TARGET | M_RECIPE | M_ABSPATH | M_SHELLESC)
219 /* Macro definitions for use inside dmake */
220 #define SET_TOKEN(A, B) (A)->tk_str = (B);\
221 (A)->tk_cchar = *(B);\
222 (A)->tk_quote = 1;
224 #define CLEAR_TOKEN(A) *(A)->tk_str = (A)->tk_cchar
225 #define GET_MACRO(A) Get_name(A, Macs, FALSE)
226 #define iswhite(C) ((C == ' ') || (C == '\t'))
227 #define STOBOOL(A) (A && ((*A | 0x20) == 'y'))
229 #endif