aboutsummaryrefslogtreecommitdiff
path: root/src/build.y
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/build.y46
1 files changed, 40 insertions, 6 deletions
diff --git a/src/build.y b/src/build.y
index 8345b1f..ecc5d59 100644
--- a/src/build.y
+++ b/src/build.y
@@ -78,8 +78,15 @@ line: TOK_DEFAULT TOK_ACTION ':'
78 | STRING TOK_REQUIRES 78 | STRING TOK_REQUIRES
79 { 79 {
80 bld.setTmp( $1 ); 80 bld.setTmp( $1 );
81 bld.requiresRegexp( false );
81 } 82 }
82 reqlst 83 reqcompletion
84 | REGEXP TOK_REQUIRES
85 {
86 bld.setTmp( $1 );
87 bld.requiresRegexp( true );
88 }
89 reqcompletion
83 | listcmds 90 | listcmds
84 | TOK_FOR STRING 91 | TOK_FOR STRING
85 { 92 {
@@ -92,6 +99,13 @@ line: TOK_DEFAULT TOK_ACTION ':'
92 | rule 99 | rule
93 ; 100 ;
94 101
102reqcompletion: reqlst
103 | TOK_FROM TOK_COMMAND STRING
104 {
105 bld.requiresFromCommand( bld.getTmp(), $3 );
106 }
107 ;
108
95reqlst: STRING 109reqlst: STRING
96 { 110 {
97 bld.requires( bld.getTmp(), $1 ); 111 bld.requires( bld.getTmp(), $1 );
@@ -118,7 +132,20 @@ createfromdirlst: createfromdir
118 | createfromdirlst ',' createfromdir 132 | createfromdirlst ',' createfromdir
119 ; 133 ;
120 134
121createfromdir: STRING { printf(" srcdir: %s\n", $1 ); } 135createfromdir: STRING
136 {
137 try
138 {
139 ((FileTarget *)bld.lastTarget())->addInputDir( $1 );
140 }
141 catch( BuildException &e )
142 {
143 std::string s( $1 );
144 s +=": ";
145 s += e.what();
146 yyerror( &yyloc, bld, s.c_str() );
147 }
148 }
122 ; 149 ;
123 150
124createusing: TOK_RULE STRING 151createusing: TOK_RULE STRING
@@ -159,12 +186,19 @@ rulesublst: rulesub
159 ; 186 ;
160 187
161rulesub: TOK_MATCHES rulematches 188rulesub: TOK_MATCHES rulematches
162 | TOK_PRODUCES STRING 189 | TOK_PRODUCES produceslst
163 {
164 bld.lastRule()->setProduces( $2 );
165 }
166 ; 190 ;
167 191
192produceslst: STRING
193 {
194 bld.lastRule()->addProduces( $1 );
195 }
196 | produceslst ',' STRING
197 {
198 bld.lastRule()->addProduces( $3 );
199 }
200 ;
201
168rulematches: TOK_ALL REGEXP 202rulematches: TOK_ALL REGEXP
169 { 203 {
170 try 204 try