X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Futils%2FmkdependHS%2FmkdependHS.prl;h=b68cb08322d0530680e9f82471462913551a8eaf;hb=438596897ebbe25a07e1c82085cfbc5bdb00f09e;hp=e821971d005e81abb5d3b2219037e1f22c29c13d;hpb=d72765457cd88b247b63b640bff7e29e0cd764b4;p=ghc-hetmet.git diff --git a/ghc/utils/mkdependHS/mkdependHS.prl b/ghc/utils/mkdependHS/mkdependHS.prl index e821971..b68cb08 100644 --- a/ghc/utils/mkdependHS/mkdependHS.prl +++ b/ghc/utils/mkdependHS/mkdependHS.prl @@ -3,7 +3,7 @@ # # RAWCPP TMPDIR TOP_PWD # libdir libexecdir datadir INSTALLING -# ProjectVersionInt SED +# SED # # tries to work like mkdependC - capable of dealing with: # @@ -100,6 +100,7 @@ $Include_dirs = '-I.'; $Makefile = ''; @Src_files = (); $Include_prelude = 0; +@Defines = (); # Delete temp. file if script is halted. sub quit_upon_signal { print STDERR "Deleting $Tmp_prefix.hs .. \n"; unlink "$Tmp_prefix.hs"; } @@ -113,10 +114,6 @@ if ( $Status ) { exit(1); } -push(@Defines, - ( #OLD: "-D__HASKELL1__=$Haskell_1", - "-D__GLASGOW_HASKELL__=$ProjectVersionInt")); - @Import_dirs = split(/:/,$Import_dirs); @Include_dirs = split(/\s+/,$Include_dirs); # still has -I's in it @@ -192,6 +189,7 @@ foreach $sf (@Src_files) { } &slurp_file_for_imports($file_to_read, $sf); + # Delete the temporary. if ( $sf =~ /\.l(hs|y)$/ ) { unlink "$Tmp_prefix.hs"; } @@ -273,7 +271,7 @@ sub mangle_command_line_args { } elsif ( /^-(x|-exclude-module=)(.*)/ ) { local($thing) = &grab_arg_arg($1,$2); - $IgnoreMe{$thing} = 'y'; + $IgnoreMe{$thing} = 'Y'; } elsif ( /^-(X|-exclude-directory=)(.*)/ ) { foreach $d ( split(/:/,&grab_arg_arg($1, $2)) ) { push(@Ignore_dirs,"$d"); @@ -356,7 +354,7 @@ sub preprocess_import_dirs { next unless /(.*)\.(hi|l?hs|l?y)$/; #don't tag it twice or overwrite it with a diff. value next if $IgnoreMe{$1}; - print STDERR "Module $d/$1.$2 will be ignored\n" if $Verbose; + print STDERR "Module $d will be ignored\n" if $Verbose; $IgnoreMe{$1} = 'y'; } @@ -373,6 +371,14 @@ sub slurp_file_for_imports { $last_seen_dir =~ s/\/[^\/]+$//; # strip to dir name $last_seen_dir = '.' if ($last_seen_dir eq $orig_src_file); + local($mod_name) = $orig_src_file; + + $mod_name =~ s/.*\/([^\/]+)$/$1/g; + $mod_name =~ s/^([^.]+)\.(.*)$/$1/; + + print STDERR "Warning: processing module $mod_name, which I was supposed to ignore.\n" + if ( $IgnoreMe{$mod_name} eq 'Y' && $Warnings ); + &process_dependency('import',0,'Prelude') if ($Include_prelude); # we mangle #include's so they will also leave something @@ -422,7 +428,11 @@ sub process_dependency { local($todo,$source,$modname) = @_; if ($todo eq 'import') { - if ( $ModuleIn{$modname} ) { + if ( $IgnoreMe{$modname} eq 'Y' ) { + # user specifically asked for this module + # to be ignored. + $follow_file = '__ignore__'; + } elsif ( $ModuleIn{$modname} ) { $follow_file = "$ModuleIn{$modname}/$modname.hi"; } else { # hard way $follow_file =