Changeset 24 in kBuild for branches/FREEBSD/src/kmk/make.h
- Timestamp:
- Nov 26, 2002 9:24:54 PM (22 years ago)
- File:
-
- 1 edited
-
branches/FREEBSD/src/kmk/make.h (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/FREEBSD/src/kmk/make.h
r10 r24 36 36 * SUCH DAMAGE. 37 37 * 38 * @(#)make.h 8.3 (Berkeley) 6/13/9539 * $FreeBSD: src/usr.bin/make/make.h,v 1. 23 2002/10/10 19:27:48 jmallettExp $38 * from: @(#)make.h 8.3 (Berkeley) 6/13/95 39 * $FreeBSD: src/usr.bin/make/make.h,v 1.12.2.2 2001/02/13 03:13:58 will Exp $ 40 40 */ 41 41 … … 46 46 47 47 #ifndef _MAKE_H_ 48 #define _MAKE_H_48 #define _MAKE_H_ 49 49 50 50 #include <sys/types.h> … … 52 52 #include <string.h> 53 53 #include <ctype.h> 54 54 #include <err.h> 55 56 #if !defined(MAKE_BOOTSTRAP) && defined(BSD4_4) 57 # include <sys/cdefs.h> 58 #else 59 # ifndef __P 60 # if defined(__STDC__) || defined(__cplusplus) 61 # define __P(protos) protos /* full-blown ANSI C */ 62 # else 63 # define __P(protos) () /* traditional C preprocessor */ 64 # endif 65 # endif 66 # ifndef __STDC__ 67 # ifndef const 68 # define const 69 # endif 70 # ifndef volatile 71 # define volatile 72 # endif 73 # endif 74 #endif 75 76 #ifdef __STDC__ 55 77 #include <stdlib.h> 56 78 #include <unistd.h> 79 #endif 57 80 #include "sprite.h" 58 81 #include "lst.h" … … 64 87 * pieces of data associated with it. 65 88 * 1) the name of the target it describes 66 * 2) the location of the target file in the file system.89 * 2) the location of the target file in the file system. 67 90 * 3) the type of operator used to define its sources (qv. parse.c) 68 91 * 4) whether it is involved in this invocation of make … … 143 166 144 167 /* 168 * Manifest constants 169 */ 170 #define NILGNODE ((GNode *) NIL) 171 172 /* 145 173 * The OP_ constants are used when parsing a dependency line as a way of 146 174 * communicating to other parts of the program the way in which a target … … 151 179 * righthand side... 152 180 */ 153 #define OP_DEPENDS 0x00000001 /* Execution of commands depends on181 #define OP_DEPENDS 0x00000001 /* Execution of commands depends on 154 182 * kids (:) */ 155 #define OP_FORCE 0x00000002 /* Always execute commands (!) */156 #define OP_DOUBLEDEP 0x00000004 /* Execution of commands depends on kids183 #define OP_FORCE 0x00000002 /* Always execute commands (!) */ 184 #define OP_DOUBLEDEP 0x00000004 /* Execution of commands depends on kids 157 185 * per line (::) */ 158 #define OP_OPMASK (OP_DEPENDS|OP_FORCE|OP_DOUBLEDEP)159 160 #define OP_OPTIONAL 0x00000008 /* Don't care if the target doesn't186 #define OP_OPMASK (OP_DEPENDS|OP_FORCE|OP_DOUBLEDEP) 187 188 #define OP_OPTIONAL 0x00000008 /* Don't care if the target doesn't 161 189 * exist and can't be created */ 162 #define OP_USE 0x00000010 /* Use associated commands for parents */163 #define OP_EXEC 0x00000020 /* Target is never out of date, but always190 #define OP_USE 0x00000010 /* Use associated commands for parents */ 191 #define OP_EXEC 0x00000020 /* Target is never out of date, but always 164 192 * execute commands anyway. Its time 165 193 * doesn't matter, so it has none...sort 166 194 * of */ 167 #define OP_IGNORE 0x00000040 /* Ignore errors when creating the node */168 #define OP_PRECIOUS 0x00000080 /* Don't remove the target when195 #define OP_IGNORE 0x00000040 /* Ignore errors when creating the node */ 196 #define OP_PRECIOUS 0x00000080 /* Don't remove the target when 169 197 * interrupted */ 170 #define OP_SILENT 0x00000100 /* Don't echo commands when executed */171 #define OP_MAKE 0x00000200 /* Target is a recurrsive make so its198 #define OP_SILENT 0x00000100 /* Don't echo commands when executed */ 199 #define OP_MAKE 0x00000200 /* Target is a recurrsive make so its 172 200 * commands should always be executed when 173 201 * it is out of date, regardless of the 174 202 * state of the -n or -t flags */ 175 #define OP_JOIN 0x00000400 /* Target is out-of-date only if any of its203 #define OP_JOIN 0x00000400 /* Target is out-of-date only if any of its 176 204 * children was out-of-date */ 177 #define OP_INVISIBLE 0x00004000 /* The node is invisible to its parents.205 #define OP_INVISIBLE 0x00004000 /* The node is invisible to its parents. 178 206 * I.e. it doesn't show up in the parents's 179 207 * local variables. */ 180 #define OP_NOTMAIN 0x00008000 /* The node is exempt from normal 'main208 #define OP_NOTMAIN 0x00008000 /* The node is exempt from normal 'main 181 209 * target' processing in parse.c */ 182 #define OP_PHONY 0x00010000 /* Not a file target; run always */210 #define OP_PHONY 0x00010000 /* Not a file target; run always */ 183 211 /* Attributes applied by PMake */ 184 #define OP_TRANSFORM 0x80000000 /* The node is a transformation rule */185 #define OP_MEMBER 0x40000000 /* Target is a member of an archive */186 #define OP_LIB 0x20000000 /* Target is a library */187 #define OP_ARCHV 0x10000000 /* Target is an archive construct */188 #define OP_HAS_COMMANDS 0x08000000 /* Target has all the commands it should.212 #define OP_TRANSFORM 0x80000000 /* The node is a transformation rule */ 213 #define OP_MEMBER 0x40000000 /* Target is a member of an archive */ 214 #define OP_LIB 0x20000000 /* Target is a library */ 215 #define OP_ARCHV 0x10000000 /* Target is an archive construct */ 216 #define OP_HAS_COMMANDS 0x08000000 /* Target has all the commands it should. 189 217 * Used when parsing to catch multiple 190 218 * commands for a target */ 191 #define OP_SAVE_CMDS 0x04000000 /* Saving commands on .END (Compat) */192 #define OP_DEPS_FOUND 0x02000000 /* Already processed by Suff_FindDeps */219 #define OP_SAVE_CMDS 0x04000000 /* Saving commands on .END (Compat) */ 220 #define OP_DEPS_FOUND 0x02000000 /* Already processed by Suff_FindDeps */ 193 221 194 222 /* … … 196 224 * object of a dependency operator 197 225 */ 198 #define OP_NOP(t) (((t) & OP_OPMASK) == 0x00000000)226 #define OP_NOP(t) (((t) & OP_OPMASK) == 0x00000000) 199 227 200 228 /* … … 204 232 * is given, a new, empty node will be created for the target, placed in the 205 233 * table of all targets and its address returned. If TARG_NOCREATE is given, 206 * a N ULL pointer will be returned.207 */ 208 #define TARG_CREATE 0x01 /* create node if not found */209 #define TARG_NOCREATE 0x00 /* don't create it */234 * a NIL pointer will be returned. 235 */ 236 #define TARG_CREATE 0x01 /* create node if not found */ 237 #define TARG_NOCREATE 0x00 /* don't create it */ 210 238 211 239 /* … … 218 246 * schemes allocate in powers of two. 219 247 */ 220 #define MAKE_BSIZE 256 /* starting size for expandable buffers */248 #define MAKE_BSIZE 256 /* starting size for expandable buffers */ 221 249 222 250 /* … … 229 257 * Str_Concat returns. 230 258 */ 231 #define STR_ADDSPACE 0x01 /* add a space when Str_Concat'ing */232 #define STR_DOFREE 0x02 /* free source strings after concatenation */233 #define STR_ADDSLASH 0x04 /* add a slash when Str_Concat'ing */259 #define STR_ADDSPACE 0x01 /* add a space when Str_Concat'ing */ 260 #define STR_DOFREE 0x02 /* free source strings after concatenation */ 261 #define STR_ADDSLASH 0x04 /* add a slash when Str_Concat'ing */ 234 262 235 263 /* … … 238 266 * as the first argument to Parse_Error. 239 267 */ 240 #define PARSE_WARNING 2241 #define PARSE_FATAL 1268 #define PARSE_WARNING 2 269 #define PARSE_FATAL 1 242 270 243 271 /* 244 272 * Values returned by Cond_Eval. 245 273 */ 246 #define COND_PARSE 0 /* Parse the next lines */247 #define COND_SKIP 1 /* Skip the next lines */248 #define COND_INVALID 2 /* Not a conditional statement */274 #define COND_PARSE 0 /* Parse the next lines */ 275 #define COND_SKIP 1 /* Skip the next lines */ 276 #define COND_INVALID 2 /* Not a conditional statement */ 249 277 250 278 /* 251 279 * Definitions for the "local" variables. Used only for clarity. 252 280 */ 253 #define TARGET "@" /* Target of dependency */254 #define OODATE "?" /* All out-of-date sources */255 #define ALLSRC ">" /* All sources */256 #define IMPSRC "<" /* Source implied by transformation */257 #define PREFIX "*" /* Common prefix */258 #define ARCHIVE "!" /* Archive in "archive(member)" syntax */259 #define MEMBER "%" /* Member in "archive(member)" syntax */260 261 #define FTARGET "@F" /* file part of TARGET */262 #define DTARGET "@D" /* directory part of TARGET */263 #define FIMPSRC "<F" /* file part of IMPSRC */264 #define DIMPSRC "<D" /* directory part of IMPSRC */265 #define FPREFIX "*F" /* file part of PREFIX */266 #define DPREFIX "*D" /* directory part of PREFIX */281 #define TARGET "@" /* Target of dependency */ 282 #define OODATE "?" /* All out-of-date sources */ 283 #define ALLSRC ">" /* All sources */ 284 #define IMPSRC "<" /* Source implied by transformation */ 285 #define PREFIX "*" /* Common prefix */ 286 #define ARCHIVE "!" /* Archive in "archive(member)" syntax */ 287 #define MEMBER "%" /* Member in "archive(member)" syntax */ 288 289 #define FTARGET "@F" /* file part of TARGET */ 290 #define DTARGET "@D" /* directory part of TARGET */ 291 #define FIMPSRC "<F" /* file part of IMPSRC */ 292 #define DIMPSRC "<D" /* directory part of IMPSRC */ 293 #define FPREFIX "*F" /* file part of PREFIX */ 294 #define DPREFIX "*D" /* directory part of PREFIX */ 267 295 268 296 /* … … 274 302 extern Lst dirSearchPath; /* The list of directories to search when 275 303 * looking for targets */ 276 extern Lst parseIncPath; /* The list of directories to search when 277 * looking for includes */ 278 279 extern Boolean jobsRunning; /* True if jobs are running */ 304 280 305 extern Boolean compatMake; /* True if we are make compatible */ 281 306 extern Boolean ignoreErrors; /* True if should ignore all errors */ … … 336 361 #define DEBUG_TARG 0x0100 337 362 #define DEBUG_VAR 0x0200 338 #define DEBUG_FOR 0x0400 339 #define DEBUG_LOUD 0x0800 340 341 #define CONCAT(a,b) a##b 363 #define DEBUG_FOR 0x0400 364 #define DEBUG_LOUD 0x0800 365 366 #ifdef __STDC__ 367 #define CONCAT(a,b) a##b 368 #else 369 #define I(a) a 370 #define CONCAT(a,b) I(a)b 371 #endif /* __STDC__ */ 342 372 343 373 #define DEBUG(module) (debug & CONCAT(DEBUG_,module)) 344 #define DEBUGF(module,args) \ 345 do { \ 346 if (DEBUG(module)) { \ 347 Debug args ; \ 348 } \ 349 } while (0) 350 #define ISDOT(c) ((c)[0] == '.' && (((c)[1] == '\0') || ((c)[1] == '/'))) 351 #define ISDOTDOT(c) ((c)[0] == '.' && ISDOT(&((c)[1]))) 374 #define ISDOT(c) ((c)[0] == '.' && (((c)[1] == '\0') || ((c)[1] == '/'))) 375 #define ISDOTDOT(c) ((c)[0] == '.' && ISDOT(&((c)[1]))) 352 376 353 377 /* … … 357 381 #include "nonints.h" 358 382 359 int Make_TimeStamp (GNode *, GNode *);360 Boolean Make_OODate (GNode *);361 int Make_HandleUse (GNode *, GNode *);362 void Make_Update (GNode *);363 void Make_DoAllVar (GNode *);364 Boolean Make_Run (Lst);383 int Make_TimeStamp __P((GNode *, GNode *)); 384 Boolean Make_OODate __P((GNode *)); 385 int Make_HandleUse __P((GNode *, GNode *)); 386 void Make_Update __P((GNode *)); 387 void Make_DoAllVar __P((GNode *)); 388 Boolean Make_Run __P((Lst)); 365 389 366 390 #endif /* _MAKE_H_ */
Note:
See TracChangeset
for help on using the changeset viewer.

