From f88e5c349ff0107ac4a13ae00180f767741f88d1 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Tue, 24 Apr 2007 15:43:35 +0000 Subject: Build groups are finished, there may be more we could do with them, but they work just fine for what I want. They're cute though, you can put each target in as many groups as you'd like. --- src/buildparser.cpp | 41 +++++++++++++++++++++++++++++++---------- 1 file changed, 31 insertions(+), 10 deletions(-) (limited to 'src/buildparser.cpp') diff --git a/src/buildparser.cpp b/src/buildparser.cpp index 364aaa5..50fc0fc 100644 --- a/src/buildparser.cpp +++ b/src/buildparser.cpp @@ -283,7 +283,7 @@ void BuildParser::addPerformParam( const char *sParam ) // void BuildParser::addAction() { - lActions.push_back( ActionTmp("", ActionTmpCmdList()) ); + lActions.push_back( ActionTmp("", ActionTmpCmdList() ) ); } void BuildParser::addAction( const char *sName ) @@ -296,6 +296,11 @@ void BuildParser::addCommand( int nType ) lActions.back().second.push_back( ActionTmpCmd( nType, lTmp ) ); } +void BuildParser::addGrpCommand( const char *sGroup, int nType ) +{ + lActions.back().second.push_back( ActionTmpCmd( nType, sGroup ) ); +} + // // Global variable functions // @@ -324,8 +329,15 @@ void BuildParser::debugDump() for( ActionTmpCmdList::iterator j = (*i).second.begin(); j != (*i).second.end(); j++ ) { - printf(" %d ", (*j).first ); - printBuildList( (*j).second ); + printf(" %d ", (*j).nAct ); + if( (*j).bGroup ) + { + printf("!%s", (*j).sGroup.c_str() ); + } + else + { + printBuildList( (*j).lCmds ); + } printf("\n"); } } @@ -555,14 +567,23 @@ Build *BuildParser::genBuild() for( ActionTmpCmdList::iterator j = (*i).second.begin(); j != (*i).second.end(); j++ ) { - StringList lWhat = buildToStringList( - (*j).second, StringList(), bld - ); - - for( StringList::iterator k = lWhat.begin(); - k != lWhat.end(); k++ ) + if( (*j).bGroup ) + { + pAct->addCommand( + (Action::eAction)((*j).nAct), (*j).sGroup, true + ); + } + else { - pAct->addCommand( (Action::eAction)((*j).first), *k ); + StringList lWhat = buildToStringList( + (*j).lCmds, StringList(), bld + ); + + for( StringList::iterator k = lWhat.begin(); + k != lWhat.end(); k++ ) + { + pAct->addCommand( (Action::eAction)((*j).nAct), *k, false ); + } } } -- cgit v1.2.3