diff --git a/lib/rscons/environment.rb b/lib/rscons/environment.rb index d90ca8f..d8dc7ae 100644 --- a/lib/rscons/environment.rb +++ b/lib/rscons/environment.rb @@ -55,7 +55,16 @@ module Rscons expand_varref.call(ent) end else - if varref[0] == '$' + if varref =~ /^(.*)\$\[(\w+)\](.*)$/ + # expand array with given prefix, suffix + prefix, varname, suffix = $1, $2, $3 + varval = merged_variables[varname] + unless varval.is_a?(Array) + raise "Array expected for $#{varname}" + end + varval.map {|e| "#{prefix}#{e}#{suffix}"} + elsif varref[0] == '$' + # expand a single variable reference varname = varref[1, varref.size] varval = merged_variables[varname] if varval