diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-10-15 14:41:24 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-10-15 14:41:24 +0000 |
commit | 53ba304c3270768cf004e4afbcbc965e964ecc71 (patch) | |
tree | f7dc600b5c2f13988e98ee277b682dee17bfbafa | |
parent | de1ebb7712ed810233dc30d20e0e893740e763fc (diff) |
INTEGRATION: CWS dmake411 (1.11.4); FILE MERGED
2007/09/14 03:40:58 vq 1.11.4.5: #i81296# Clear flags indicating that targets that infered makefiles (and
their prerequisites) were previously build.
2007/09/14 00:09:00 vq 1.11.4.4: #i81296# Remove bit recycling for F_VISITED/F_USED. Use only F_VISITED.
2007/09/08 18:20:35 vq 1.11.4.3: #i10000# Add some output for .INCLUDE operations when the -vf verbose
flag is given.
2007/08/09 01:43:17 vq 1.11.4.2: #i67709# Improve parsing of group recipes.
2007/08/07 01:54:12 vq 1.11.4.1: #i66448# Clarify prerequisites for %-targets.
-rw-r--r-- | dmake/rulparse.c | 60 |
1 files changed, 34 insertions, 26 deletions
diff --git a/dmake/rulparse.c b/dmake/rulparse.c index e82474341dfd..338e77e8ad09 100644 --- a/dmake/rulparse.c +++ b/dmake/rulparse.c @@ -1,6 +1,6 @@ /* $RCSfile: rulparse.c,v $ --- $Revision: 1.11 $ --- last change: $Author: obo $ $Date: 2007-06-12 06:06:50 $ +-- $Revision: 1.12 $ +-- last change: $Author: ihi $ $Date: 2007-10-15 15:41:24 $ -- -- SYNOPSIS -- Perform semantic analysis on input @@ -230,13 +230,13 @@ int *state; } } else { - /* found an operator so empty out break list - * and clear mark bits on target list, setting them all to F_USED*/ + /* found an operator so empty out break list and clear mark + * bits on target list, setting them all to F_VISITED*/ brk = ""; for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) { cp->ce_flag ^= F_MARK; - cp->ce_flag |= F_USED; + cp->ce_flag |= F_VISITED; } Def_targets = FALSE; @@ -258,7 +258,7 @@ int *state; Fatal( "Syntax error in %% rule, missing %% target"); } - if( cp->ce_flag & F_USED ) { + if( cp->ce_flag & F_VISITED ) { if( cp->ce_attr & A_COMPOSITE ) continue; else @@ -321,7 +321,7 @@ int *state; * so I bit the bullit and added these two loops. */ for( cp=prereq; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_MARK; - for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_USED; + for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) cp->ce_flag &= ~F_VISITED; /* Check to see if the previous recipe was bound, if not the call * Bind_rules_to_targets() to bind the recipe (_sv_rules) to the @@ -335,15 +335,6 @@ int *state; if( _sv_rules != NIL(STRING) ) Fatal( "Internal Error: _sv_rules not empty." ); - /* The target can be already build, e.g. as infered makefile for - * the .INCLUDE directive. Clean F_MADE and F_STAT when recipes - * or prerequisites are changed. */ - if( (prereq != NIL(CELL)) || (_sv_rules != NIL(STRING)) ) - for( cp=targets; cp != NIL(CELL); cp=cp->ce_link ) { - DB_PRINT( "par", ("Cleaning %s flags %04x", cp->CE_NAME, cp->ce_flag) ); - cp->ce_flag &= ~(F_STAT|F_MADE); - } - /* Add the first recipe line to the list */ if( firstrcp != NIL( char ) ) Add_recipe_to_list( firstrcp, TRUE, FALSE ); @@ -505,10 +496,10 @@ int flag; /* Bind the current set of prerequisites as belonging to the * original recipe given for the target */ for( lp=tg->ce_prq; lp != NIL(LINK); lp = lp->cl_next ) - if( !(lp->cl_flag & F_USED) ) lp->cl_flag |= F_TARGET; + if( !(lp->cl_flag & F_VISITED) ) lp->cl_flag |= F_TARGET; } else for( lp=tg->ce_prq; lp != NIL(LINK); lp = lp->cl_next ) - lp->cl_flag |= F_USED; + lp->cl_flag |= F_VISITED; } tflag |= _add_root(tg); @@ -540,10 +531,20 @@ Set_group_attributes( list )/* char *list; { int res = FALSE; + char *s; if ( !((_sv_attr|Glob_attr)&A_IGNOREGROUP) ) { - res = (*DmStrSpn(list,"@-%+ \t") == '['); - if( res ) _sv_attr |= Rcp_attribute(list); + s = DmStrSpn(list,"@-%+ \t"); + res = (*s == '['); + if( res ) { + /* Check for non-white space characters after the [. */ + for( s++; *s && iswhite(*s) ; s++ ) + ; + if( *s ) + Warning("Found non-white space character after '[' in [%s].", list); + + _sv_attr |= Rcp_attribute(list); + } } return(res); @@ -724,6 +725,9 @@ int *state; Glob_attr |= (attr&A_IGNORE); prqlst->cl_prq->ce_attr &= ~A_FRINGE; + if( Verbose & V_FILE_IO ) + printf( "%s: Inferring include file [%s].\n", + Pname, name ); fil = TryFiles(prqlst); Glob_attr = glob; @@ -731,11 +735,17 @@ int *state; } if( fil != NIL(FILE) ) { + if( Verbose & V_FILE_IO ) + printf( "%s: Parsing include file [%s].\n", + Pname, name ); Parse( fil ); found = TRUE; } else if( !(ignore || first) ) Fatal( "Include file %s, not found", name ); + else if( Verbose & V_FILE_IO ) + printf( "%s: Include file [%s] was not found.\n", + Pname, name ); } if ( !ignore && first && !found ) @@ -943,14 +953,12 @@ CELLPTR prereq; /* list of prerequisites */ } } else { - /* Multiple prerequisits require all of them match for this - * %-target to be chosen. */ - /* FIXME: There seem to be problems in the target inference - * if multiple prerequisites are provided. */ + /* The inference mechanism for %-targets limits the number of + * (non-indirect) prerequisite to one, but an unlimited number + * of indirect prerequisites is possible. */ if ( nprq && nprq->ce_link && !(op & R_OP_OR)) Warning("More than one prerequisite\n" - "for %%-target without :| as ruleop. Only the first is currently used.\n" - "Check your makefiles!.\n"); + "for %%-target. Use :| ruleop or indirect prerequisites."); _build_graph(op,tg1,nprq); } |