[project @ 1996-01-08 20:28:12 by partain]
[ghc-hetmet.git] / ghc / lib / make_extra_deps
1 #! /usr/local/bin/perl
2 # see comments in ghc/lib/Jmakefile
3
4 open(MKF, "< Makefile") || die "Can't open Makefile\n";
5
6 # read down to start of dependencies
7 while (<MKF>) {
8     last if /# DO NOT DELETE: Beginning of Haskell dependencies/;
9 }
10
11 # slurp through dependencies, duplicating them
12 while (<MKF>) {
13     last if /# DO NOT DELETE: End of Haskell dependencies/;
14     chop;
15
16     foreach $k ( '_p', '_t',
17                  '_mc', '_mr', '_mt', '_mp', '_mg',
18                  '_2s', '_1s', '_du',
19                  '_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h',
20                  '_i', '_j', '_k', '_o', '_m', '_n', '_o' ) {
21         $copy = $_;
22
23         # change all .hc and .hi
24         $copy =~ s/\.hc\b/$k.hc/;
25         $copy =~ s/\.hi\b/$k.hi/;
26
27         print STDOUT "IfGhcBuild$k(", $copy, ")\n";
28     }
29 }
30
31 close(MKF) || die "Failed in closing Makefile\n";