From: sof Date: Wed, 3 Sep 1997 23:29:55 +0000 (+0000) Subject: [project @ 1997-09-03 23:29:55 by sof] X-Git-Tag: Approximately_1000_patches_recorded~69 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=52d84821fddca62c1dee2c864ad8381bb625942f;p=ghc-hetmet.git [project @ 1997-09-03 23:29:55 by sof] Added clean up signal handlers --- diff --git a/ghc/utils/mkdependHS/mkdependHS.prl b/ghc/utils/mkdependHS/mkdependHS.prl index fe1a7ac..4e5d316 100644 --- a/ghc/utils/mkdependHS/mkdependHS.prl +++ b/ghc/utils/mkdependHS/mkdependHS.prl @@ -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");