diff options
author | Ben Laurie <ben@links.org> | 2013-03-04 14:08:23 +0000 |
---|---|---|
committer | Ben Laurie <ben@links.org> | 2013-03-04 14:31:18 +0000 |
commit | 7b0d591dc319d0fb64ca353e280f224a94a2e773 (patch) | |
tree | 7b31fd1a1c2acd1090135a36bbdbbc217a788b54 | |
parent | 7bbb8c5620c7a932988473533e2aca385e4b89c5 (diff) |
Allow variables to be overridden on the command line.
-rwxr-xr-x | util/files.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/util/files.pl b/util/files.pl index 41f033e3b9..b15407f0c9 100755 --- a/util/files.pl +++ b/util/files.pl @@ -4,6 +4,12 @@ # It is basically a list of all variables from the passed makefile # +while ($ARGV[0] =~ /^(\S+)\s*=(.*)$/) + { + $sym{$1} = $2; + shift; + } + $s=""; while (<>) { @@ -33,7 +39,7 @@ while (<>) $o =~ s/\s+/ /g; $o =~ s/\$[({]([^)}]+)[)}]/$sym{$1}/g; - $sym{$s}=$o; + $sym{$s}=$o if !exists $sym{$s}; } } |