3 # fixpaths - substitute makefile variables into text files
6 $usage = "Usage: $0 [-D<variable>=<value>] [[infile] ...]\n";
8 if (!defined(@ARGV)) { die ("$usage"); }
10 # read in the command line and get some definitions
11 while ($_=$ARGV[0], /^-/) {
15 if ( /-D(.*)=(.*)/ ) {
18 die ("$usage$0: error in command line arguments.\n");
21 &usage; die ("$usage$0: unknown option '-".$ARGV[0][1]."'\n");
23 } # while parsing arguments
26 die ("$0: nothing to do - no substitutions listed!\n");
32 $of = $2; $of =~ s/.in$//;
34 print("Making substitutions for $of\n");
36 open(IN, "<$f") || die ("$0: input file $f missing!\n");
37 if (open(OUT, ">$of")) {