- if (! $follow_file) { # it didnae find anything
- die "$orig_src_file: Couldn't handle: $_\n";
-
- } else { # it found something
- if ($follow_file ne '__ignore__') {
- local($int_file);
- $int_file = $follow_file;
-
- if ( $int_file !~ /\.(l?hs|hi|l?y)$/ ) {
- push(@Depend_lines, "$bf.$Obj_suffix : $int_file\n");
- foreach $suff (@File_suffix) {
- push(@Depend_lines, "$bf.${suff}_$Obj_suffix : $int_file\n");
- }
-
- } else {
- $int_file =~ s/\.l?hs$//;
- $int_file =~ s/\.l?y$//;
- $int_file =~ s/\.hi$//;
- local($source_dep);
-
- if ( $source && -f "$int_file.hs" ) {
- $source_dep = "$int_file.hs";
- push(@Depend_lines, "$bf.$Obj_suffix : $source_dep\n");
- } elsif ( $source && -f "$int_file.lhs" ) {
- $source_dep = "$int_file.lhs";
- push(@Depend_lines, "$bf.$Obj_suffix : $source_dep\n");
- } elsif ( $source && ( -f "$int_file.ly" || -f "$int_file.y" ) ) {
- $source_dep = "$int_file.hs";
- push(@Depend_lines, "$bf.$Obj_suffix : $source_dep\n");
- } else {
- if ( $source ) {
- print STDERR "Warning: could not find source file dependency $int_file.(hs|lhs|y|ly)\n";
- }
- push(@Depend_lines, "$bf.$Obj_suffix : $int_file.hi\n");
- }
-
- if ( ! $source ) {
- foreach $suff (@File_suffix) {
- push(@Depend_lines, "$bf.${suff}_$Obj_suffix : $int_file.${suff}_hi\n");
- }
- } else {
- foreach $suff (@File_suffix) {
- push(@Depend_lines, "$bf.${suff}_$Obj_suffix : $source_dep\n");
- }
- }
- }
+#
+# Handle
+sub process_dependency {
+ local($todo,$source,$modname) = @_;
+
+ if ($todo eq 'import') {
+ 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 =
+ &find_in_Import_dirs($orig_src_file, $modname, $last_seen_dir, $source );
+ }
+ } else {
+ $follow_file
+ = &find_in_Include_dirs($orig_src_file, $modname, $last_seen_dir);
+ }
+
+ if (! $follow_file) { # it didnae find anything
+ die "$orig_src_file: Couldn't handle: $_\n";
+
+ } else { # it found something
+ if ($follow_file ne '__ignore__') {
+ local($int_file) = $follow_file;
+
+ if ( $int_file !~ /\.(l?hs|hi|l?y)$/ ) {
+ local($str) = "";
+ foreach $obj (@Obj_suffix) {
+ $str .= "$bf.$obj ";
+ foreach $suff (@File_suffix) {
+ $str .= "$bf.${suff}_$obj ";
+ }