3 # fixpaths - substitute makefile variables into text files
6 $usage = "Usage: $0 [-x<file dot-suffix>] [-Dstring=replacement] [[infile] ...]\n";
10 if (!defined(@ARGV)) { die ("$usage"); }
12 # read in the command line and get some definitions
13 while ($_=$ARGV[0], /^-/) {
17 if ( /-D(.*)=(.*)/ ) {
19 } elsif ( /-x\s*(\w+)/ ) {
22 die ("$usage$0: error in command line arguments.\n");
25 @cmd = split(//, $ARGV[0]); $opt = $cmd[1];
26 die ("$usage$0: unknown option '-$opt'\n");
28 } # while parsing arguments
31 die ("$0: nothing to do - no substitutions listed!\n");
39 open(IN, "<$f") || die ("$0: input file $f missing!\n");
40 if (open(OUT, ">$of")) {