aboutsummaryrefslogtreecommitdiff
path: root/install-win32/macro.pl
diff options
context:
space:
mode:
Diffstat (limited to 'install-win32/macro.pl')
-rw-r--r--install-win32/macro.pl28
1 files changed, 28 insertions, 0 deletions
diff --git a/install-win32/macro.pl b/install-win32/macro.pl
new file mode 100644
index 0000000..e3a7f30
--- /dev/null
+++ b/install-win32/macro.pl
@@ -0,0 +1,28 @@
+die "usage: macro.pl <control-file>" if (@ARGV < 1);
+($control_file) = @ARGV;
+
+open(CONTROL, "< $control_file") or die "cannot open $control_file";
+
+%Parms = ();
+
+while (<CONTROL>) {
+ chomp;
+ if (/^!define\s+(\w+)\s+['"]?(.+?)['"]?\s*$/) {
+ $Parms{$1} = $2
+ }
+}
+
+while (<STDIN>) {
+ s{
+ @@
+ \s*
+ (
+ \w+
+ )
+ \s*
+ @@
+ }{
+ $Parms{$1}
+ }xge;
+ print;
+}