diff options
author | harti <harti@FreeBSD.org> | 2005-05-10 14:27:04 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2005-05-10 14:27:04 +0000 |
commit | 4e99d859a89fb83d3001764fed9e693baeb605e6 (patch) | |
tree | 1823597517d9c07dd62d8327fab8abb3190e11d9 /usr.bin | |
parent | 59c55733793bcd9b59e27a4c51cff131f473b99a (diff) | |
download | FreeBSD-src-4e99d859a89fb83d3001764fed9e693baeb605e6.zip FreeBSD-src-4e99d859a89fb83d3001764fed9e693baeb605e6.tar.gz |
Move the definitions of the OP_* constants from make.h into GNode.h
where they actually belong to. Move the definitions of the strings
for special macros like "$*" from make.h to parse.h - they're used
only in the parser.
Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.211)
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/make/GNode.h | 65 | ||||
-rw-r--r-- | usr.bin/make/arch.c | 1 | ||||
-rw-r--r-- | usr.bin/make/make.c | 1 | ||||
-rw-r--r-- | usr.bin/make/make.h | 80 | ||||
-rw-r--r-- | usr.bin/make/parse.h | 18 |
5 files changed, 86 insertions, 79 deletions
diff --git a/usr.bin/make/GNode.h b/usr.bin/make/GNode.h index bf60b0e..23e68aa 100644 --- a/usr.bin/make/GNode.h +++ b/usr.bin/make/GNode.h @@ -56,9 +56,70 @@ typedef struct GNode { /* * The type of operator used to define the sources (qv. parse.c) - * See OP_ flags in make.h + * + * The OP_ constants are used when parsing a dependency line as a way of + * communicating to other parts of the program the way in which a target + * should be made. These constants are bitwise-OR'ed together and + * placed in the 'type' field of each node. Any node that has + * a 'type' field which satisfies the OP_NOP function was never never on + * the lefthand side of an operator, though it may have been on the + * righthand side... */ int type; +#define OP_DEPENDS 0x00000001 /* Execution of commands depends on + * kids (:) */ +#define OP_FORCE 0x00000002 /* Always execute commands (!) */ +#define OP_DOUBLEDEP 0x00000004 /* Execution of commands depends on + * kids per line (::) */ +#define OP_OPMASK (OP_DEPENDS|OP_FORCE|OP_DOUBLEDEP) + +#define OP_OPTIONAL 0x00000008 /* Don't care if the target doesn't + * exist and can't be created */ +#define OP_USE 0x00000010 /* + * Use associated commands for + * parents + */ +#define OP_EXEC 0x00000020 /* Target is never out of date, but + * always execute commands anyway. + * Its time doesn't matter, so it has + * none...sort of + */ +#define OP_IGNORE 0x00000040 /* + * Ignore errors when creating the node + */ +#define OP_PRECIOUS 0x00000080 /* Don't remove the target when + * interrupted */ +#define OP_SILENT 0x00000100 /* Don't echo commands when executed */ +#define OP_MAKE 0x00000200 /* + * Target is a recurrsive make so its + * commands should always be executed + * when it is out of date, regardless + * of the state of the -n or -t flags + */ +#define OP_JOIN 0x00000400 /* Target is out-of-date only if any of + * its children was out-of-date */ +#define OP_INVISIBLE 0x00004000 /* The node is invisible to its parents. + * I.e. it doesn't show up in the + * parents's local variables. */ +#define OP_NOTMAIN 0x00008000 /* The node is exempt from normal 'main + * target' processing in parse.c */ +#define OP_PHONY 0x00010000 /* Not a file target; run always */ +/* Attributes applied by PMake */ +#define OP_TRANSFORM 0x80000000 /* The node is a transformation rule */ +#define OP_MEMBER 0x40000000 /* Target is a member of an archive */ +#define OP_LIB 0x20000000 /* Target is a library */ +#define OP_ARCHV 0x10000000 /* Target is an archive construct */ +#define OP_HAS_COMMANDS 0x08000000 /* Target has all the commands it + * should. Used when parsing to catch + * multiple commands for a target */ +#define OP_SAVE_CMDS 0x04000000 /* Saving commands on .END (Compat) */ +#define OP_DEPS_FOUND 0x02000000 /* Already processed by Suff_FindDeps */ + +/* + * OP_NOP will return TRUE if the node with the given type was not the + * object of a dependency operator + */ +#define OP_NOP(t) (((t) & OP_OPMASK) == 0x00000000) int order; /* Its wait weight */ @@ -122,7 +183,7 @@ typedef struct GNode { /* Lst of nodes for which this is a source (that depend on this one) */ Lst parents; - /* List of nodes on which this depends */ + /* List of nodes on which this depends */ Lst children; /* diff --git a/usr.bin/make/arch.c b/usr.bin/make/arch.c index 4898a87..f1e53c9 100644 --- a/usr.bin/make/arch.c +++ b/usr.bin/make/arch.c @@ -108,6 +108,7 @@ __FBSDID("$FreeBSD$"); #include "GNode.h" #include "hash.h" #include "make.h" +#include "parse.h" #include "targ.h" #include "util.h" #include "var.h" diff --git a/usr.bin/make/make.c b/usr.bin/make/make.c index e674608..5402db6 100644 --- a/usr.bin/make/make.c +++ b/usr.bin/make/make.c @@ -81,6 +81,7 @@ __FBSDID("$FreeBSD$"); #include "GNode.h" #include "job.h" #include "make.h" +#include "parse.h" #include "suff.h" #include "targ.h" #include "util.h" diff --git a/usr.bin/make/make.h b/usr.bin/make/make.h index 9f020bb..6bf7aa1 100644 --- a/usr.bin/make/make.h +++ b/usr.bin/make/make.h @@ -42,9 +42,9 @@ #ifndef make_h_a91074b9 #define make_h_a91074b9 -/*- - * make.h -- - * The global definitions for pmake +/** + * make.h + * The global definitions for make */ #include "sprite.h" @@ -54,80 +54,6 @@ struct Lst; struct Buffer; /* - * The OP_ constants are used when parsing a dependency line as a way of - * communicating to other parts of the program the way in which a target - * should be made. These constants are bitwise-OR'ed together and - * placed in the 'type' field of each node. Any node that has - * a 'type' field which satisfies the OP_NOP function was never never on - * the lefthand side of an operator, though it may have been on the - * righthand side... - */ -#define OP_DEPENDS 0x00000001 /* Execution of commands depends on - * kids (:) */ -#define OP_FORCE 0x00000002 /* Always execute commands (!) */ -#define OP_DOUBLEDEP 0x00000004 /* Execution of commands depends on kids - * per line (::) */ -#define OP_OPMASK (OP_DEPENDS|OP_FORCE|OP_DOUBLEDEP) - -#define OP_OPTIONAL 0x00000008 /* Don't care if the target doesn't - * exist and can't be created */ -#define OP_USE 0x00000010 /* Use associated commands for parents */ -#define OP_EXEC 0x00000020 /* Target is never out of date, but always - * execute commands anyway. Its time - * doesn't matter, so it has none...sort - * of */ -#define OP_IGNORE 0x00000040 /* Ignore errors when creating the node */ -#define OP_PRECIOUS 0x00000080 /* Don't remove the target when - * interrupted */ -#define OP_SILENT 0x00000100 /* Don't echo commands when executed */ -#define OP_MAKE 0x00000200 /* Target is a recurrsive make so its - * commands should always be executed when - * it is out of date, regardless of the - * state of the -n or -t flags */ -#define OP_JOIN 0x00000400 /* Target is out-of-date only if any of its - * children was out-of-date */ -#define OP_INVISIBLE 0x00004000 /* The node is invisible to its parents. - * I.e. it doesn't show up in the parents's - * local variables. */ -#define OP_NOTMAIN 0x00008000 /* The node is exempt from normal 'main - * target' processing in parse.c */ -#define OP_PHONY 0x00010000 /* Not a file target; run always */ -/* Attributes applied by PMake */ -#define OP_TRANSFORM 0x80000000 /* The node is a transformation rule */ -#define OP_MEMBER 0x40000000 /* Target is a member of an archive */ -#define OP_LIB 0x20000000 /* Target is a library */ -#define OP_ARCHV 0x10000000 /* Target is an archive construct */ -#define OP_HAS_COMMANDS 0x08000000 /* Target has all the commands it should. - * Used when parsing to catch multiple - * commands for a target */ -#define OP_SAVE_CMDS 0x04000000 /* Saving commands on .END (Compat) */ -#define OP_DEPS_FOUND 0x02000000 /* Already processed by Suff_FindDeps */ - -/* - * OP_NOP will return TRUE if the node with the given type was not the - * object of a dependency operator - */ -#define OP_NOP(t) (((t) & OP_OPMASK) == 0x00000000) - -/* - * Definitions for the "local" variables. Used only for clarity. - */ -#define TARGET "@" /* Target of dependency */ -#define OODATE "?" /* All out-of-date sources */ -#define ALLSRC ">" /* All sources */ -#define IMPSRC "<" /* Source implied by transformation */ -#define PREFIX "*" /* Common prefix */ -#define ARCHIVE "!" /* Archive in "archive(member)" syntax */ -#define MEMBER "%" /* Member in "archive(member)" syntax */ - -#define FTARGET "@F" /* file part of TARGET */ -#define DTARGET "@D" /* directory part of TARGET */ -#define FIMPSRC "<F" /* file part of IMPSRC */ -#define DIMPSRC "<D" /* directory part of IMPSRC */ -#define FPREFIX "*F" /* file part of PREFIX */ -#define DPREFIX "*D" /* directory part of PREFIX */ - -/* * Warning flags */ enum { diff --git a/usr.bin/make/parse.h b/usr.bin/make/parse.h index dd5cd81..ec1a478 100644 --- a/usr.bin/make/parse.h +++ b/usr.bin/make/parse.h @@ -56,6 +56,24 @@ struct Lst; #define PARSE_WARNING 2 #define PARSE_FATAL 1 +/* + * Definitions for the "local" variables. Used only for clarity. + */ +#define TARGET "@" /* Target of dependency */ +#define OODATE "?" /* All out-of-date sources */ +#define ALLSRC ">" /* All sources */ +#define IMPSRC "<" /* Source implied by transformation */ +#define PREFIX "*" /* Common prefix */ +#define ARCHIVE "!" /* Archive in "archive(member)" syntax */ +#define MEMBER "%" /* Member in "archive(member)" syntax */ + +#define FTARGET "@F" /* file part of TARGET */ +#define DTARGET "@D" /* directory part of TARGET */ +#define FIMPSRC "<F" /* file part of IMPSRC */ +#define DIMPSRC "<D" /* directory part of IMPSRC */ +#define FPREFIX "*F" /* file part of PREFIX */ +#define DPREFIX "*D" /* directory part of PREFIX */ + void Parse_Error(int, const char *, ...); Boolean Parse_AnyExport(void); Boolean Parse_IsVar(char *); |