[project @ 1997-09-03 23:29:55 by sof]
authorsof <unknown>
Wed, 3 Sep 1997 23:29:55 +0000 (23:29 +0000)
committersof <unknown>
Wed, 3 Sep 1997 23:29:55 +0000 (23:29 +0000)
Added clean up signal handlers

ghc/utils/mkdependHS/mkdependHS.prl

index fe1a7ac..4e5d316 100644 (file)
@@ -156,15 +156,20 @@ print STDERR "Include_dirs=@Include_dirs\n" if $Verbose;
 
 @Depend_lines = ();
 
+# Delete temp. file if script is halted.
+sub quit_upon_signal { print STDERR "Deleting $Tmp_prefix.hs .. \n"; unlink "$Tmp_prefix.hs"; }
+$SIG{'INT'}  = 'quit_upon_signal';
+$SIG{'QUIT'} = 'quit_upon_signal';
+
 foreach $sf (@Src_files) {
+
     # just like lit-inputter
     # except it puts each file through CPP and
     # a de-commenter (not implemented);
     # builds up @Depend_lines
     print STDERR "Here we go for source file: $sf\n" if $Verbose;
     ($bf = $sf) =~ s/\.l?(hs|y)$//;
-    #push(@Depend_lines, "$bf.$Obj_suffix $bf.hi : $sf\n");
-    #push(@Depend_lines, "$bf.$Obj_suffix : $sf\n");
+
     local($str)="";
     foreach $obj  (@Obj_suffix) {
        $str .= "$bf.$obj ";
@@ -188,6 +193,7 @@ foreach $sf (@Src_files) {
     }
 }
 
+
 # OK, mangle the Makefile
 unlink("$Makefile.bak");