diff options
author | Mike Buland <eichlan@xagasoft.com> | 2006-07-31 17:23:04 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2006-07-31 17:23:04 +0000 |
commit | b672fa69c4c98509f8ee251b87300e3fcbe6bdc8 (patch) | |
tree | 064212cec710fc5bfd5f2b75dd2a502ba9f66eba /src/build.y | |
parent | 9139f1df4cda80b91ab68e5de27e85eaa4c54682 (diff) | |
download | build-b672fa69c4c98509f8ee251b87300e3fcbe6bdc8.tar.gz build-b672fa69c4c98509f8ee251b87300e3fcbe6bdc8.tar.bz2 build-b672fa69c4c98509f8ee251b87300e3fcbe6bdc8.tar.xz build-b672fa69c4c98509f8ee251b87300e3fcbe6bdc8.zip |
We're almost to rule/command generation, then only a couple of steps before it
will do it all!
Diffstat (limited to '')
-rw-r--r-- | src/build.y | 46 |
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 | ||
102 | reqcompletion: reqlst | ||
103 | | TOK_FROM TOK_COMMAND STRING | ||
104 | { | ||
105 | bld.requiresFromCommand( bld.getTmp(), $3 ); | ||
106 | } | ||
107 | ; | ||
108 | |||
95 | reqlst: STRING | 109 | reqlst: 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 | ||
121 | createfromdir: STRING { printf(" srcdir: %s\n", $1 ); } | 135 | createfromdir: 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 | ||
124 | createusing: TOK_RULE STRING | 151 | createusing: TOK_RULE STRING |
@@ -159,12 +186,19 @@ rulesublst: rulesub | |||
159 | ; | 186 | ; |
160 | 187 | ||
161 | rulesub: TOK_MATCHES rulematches | 188 | rulesub: TOK_MATCHES rulematches |
162 | | TOK_PRODUCES STRING | 189 | | TOK_PRODUCES produceslst |
163 | { | ||
164 | bld.lastRule()->setProduces( $2 ); | ||
165 | } | ||
166 | ; | 190 | ; |
167 | 191 | ||
192 | produceslst: STRING | ||
193 | { | ||
194 | bld.lastRule()->addProduces( $1 ); | ||
195 | } | ||
196 | | produceslst ',' STRING | ||
197 | { | ||
198 | bld.lastRule()->addProduces( $3 ); | ||
199 | } | ||
200 | ; | ||
201 | |||
168 | rulematches: TOK_ALL REGEXP | 202 | rulematches: TOK_ALL REGEXP |
169 | { | 203 | { |
170 | try | 204 | try |