diff options
Diffstat (limited to 'tools/build/v2/engine/rules.h')
-rw-r--r-- | tools/build/v2/engine/rules.h | 67 |
1 files changed, 28 insertions, 39 deletions
diff --git a/tools/build/v2/engine/rules.h b/tools/build/v2/engine/rules.h index 806a1469c0..823fbd1f55 100644 --- a/tools/build/v2/engine/rules.h +++ b/tools/build/v2/engine/rules.h @@ -15,7 +15,7 @@ #include "modules.h" #include "jam.h" -#include "parse.h" +#include "function.h" /* @@ -52,20 +52,13 @@ typedef struct _settings SETTINGS ; /* RULE - a generic jam rule, the product of RULE and ACTIONS. */ -/* A rule's argument list. */ -struct argument_list -{ - int reference_count; - LOL data[1]; -}; - /* Build actions corresponding to a rule. */ struct rule_actions { - int reference_count; - char * command; /* command string from ACTIONS */ - LIST * bindlist; - int flags; /* modifiers on ACTIONS */ + int reference_count; + FUNCTION * command; /* command string from ACTIONS */ + LIST * bindlist; + int flags; /* modifiers on ACTIONS */ #define RULE_NEWSRCS 0x01 /* $(>) is updated sources only */ #define RULE_TOGETHER 0x02 /* combine actions on single target */ @@ -80,19 +73,14 @@ typedef struct argument_list argument_list; struct _rule { - char * name; - PARSE * procedure; /* parse tree from RULE */ - argument_list * arguments; /* argument checking info, or NULL for unchecked - */ + OBJECT * name; + FUNCTION * procedure; rule_actions * actions; /* build actions, or NULL for no actions */ module_t * module; /* module in which this rule is executed */ int exported; /* nonzero if this rule is supposed to appear in * the global module and be automatically * imported into other modules */ -#ifdef HAVE_PYTHON - PyObject * python_function; -#endif }; /* ACTIONS - a chain of ACTIONs. */ @@ -110,16 +98,19 @@ struct _action TARGETS * targets; TARGETS * sources; /* aka $(>) */ char running; /* has been started */ +#define A_INIT 0 +#define A_RUNNING_NOEXEC 1 +#define A_RUNNING 2 char status; /* see TARGET status */ + int refs; }; /* SETTINGS - variables to set when executing a TARGET's ACTIONS. */ struct _settings { SETTINGS * next; - char * symbol; /* symbol name for var_set() */ + OBJECT * symbol; /* symbol name for var_set() */ LIST * value; /* symbol value for var_set() */ - int multiple; }; /* TARGETS - a chain of TARGETs. */ @@ -133,8 +124,8 @@ struct _targets /* TARGET - an entity (e.g. a file) that can be built. */ struct _target { - char * name; - char * boundname; /* if search() relocates target */ + OBJECT * name; + OBJECT * boundname; /* if search() relocates target */ ACTIONS * actions; /* rules to execute, if any */ SETTINGS * settings; /* variables to define */ @@ -220,6 +211,7 @@ struct _target #define T_MAKE_ACTIVE 2 /* make1(target) in make1b() */ #define T_MAKE_RUNNING 3 /* make1(target) running commands */ #define T_MAKE_DONE 4 /* make1(target) done */ +#define T_MAKE_NOEXEC_DONE 5 /* make1(target) done with -n in effect */ #ifdef OPT_SEMAPHORE #define T_MAKE_SEMAPHORE 5 /* Special target type for semaphores */ @@ -235,44 +227,41 @@ struct _target TARGETS * parents; /* used by make1() for completion */ char * cmds; /* type-punned command list */ - char * failed; + const char * failed; }; /* Action related functions. */ +void action_free ( ACTION * ); ACTIONS * actionlist ( ACTIONS *, ACTION * ); void freeactions ( ACTIONS * ); -SETTINGS * addsettings ( SETTINGS *, int flag, char * symbol, LIST * value ); -void pushsettings ( SETTINGS * ); -void popsettings ( SETTINGS * ); +SETTINGS * addsettings ( SETTINGS *, int flag, OBJECT * symbol, LIST * value ); +void pushsettings ( struct module_t * module, SETTINGS * ); +void popsettings ( struct module_t * module, SETTINGS * ); SETTINGS * copysettings ( SETTINGS * ); void freesettings ( SETTINGS * ); void actions_refer( rule_actions * ); void actions_free ( rule_actions * ); -/* Argument list related functions. */ -void args_free ( argument_list * ); -argument_list * args_new (); -void args_refer( argument_list * ); - /* Rule related functions. */ -RULE * bindrule ( char * rulename, module_t * ); -RULE * import_rule ( RULE * source, module_t *, char * name ); -RULE * new_rule_body ( module_t *, char * rulename, argument_list *, PARSE * procedure, int exprt ); -RULE * new_rule_actions( module_t *, char * rulename, char * command, LIST * bindlist, int flags ); +RULE * bindrule ( OBJECT * rulename, module_t * ); +RULE * import_rule ( RULE * source, module_t *, OBJECT * name ); +void rule_localize ( RULE * rule, module_t * module ); +RULE * new_rule_body ( module_t *, OBJECT * rulename, FUNCTION * func, int exprt ); +RULE * new_rule_actions( module_t *, OBJECT * rulename, FUNCTION * command, LIST * bindlist, int flags ); void rule_free ( RULE * ); /* Target related functions. */ void bind_explicitly_located_targets(); -TARGET * bindtarget ( char const * target_name ); +TARGET * bindtarget ( OBJECT * target_name ); TARGET * copytarget ( TARGET const * t ); void freetargets ( TARGETS * ); -TARGET * search_for_target ( char * name, LIST * search_path ); TARGETS * targetchain ( TARGETS * chain, TARGETS * ); TARGETS * targetentry ( TARGETS * chain, TARGET * ); void target_include ( TARGET * including, TARGET * included ); TARGETS * targetlist ( TARGETS * chain, LIST * target_names ); -void touch_target ( char * t ); +void touch_target ( OBJECT * t ); +void clear_includes ( TARGET * ); /* Final module cleanup. */ void rules_done(); |