Commit 189a54b0 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl
Browse files

Better error output

parent 6132d7e3
......@@ -69,7 +69,7 @@ ifneq ($(call is_clean),1)
include $(_f90_depfile)
endif
$(_f90_depfile): $(top_srcdir)/fdep/fortran_dependencies.pl $(foreach p,$(_f90_targets),$(_$p_use_mods) $(_$p_def_mods)) | $(foreach p,$(_f90_targets),$(_f90_depdir)/$p)
$(call _f90_verbose,F90 DEPS $@)echo > $@; $(foreach p,$(_f90_targets),$(top_srcdir)/fdep/fortran_dependencies.pl $(_$p_use_mods) $(_$p_def_mods) >> $@; )
$(call _f90_verbose,F90 DEPS $@)echo > $@; $(foreach p,$(_f90_targets),$(top_srcdir)/fdep/fortran_dependencies.pl $p $(_$p_use_mods) $(_$p_def_mods) >> $@; )
$(_f90_depdir):
@mkdir $@
......
......@@ -39,10 +39,15 @@ sub add_def {
}
}
my $target = shift;
foreach my $file (@ARGV) {
my $re;
my $add;
my $object;
if (defined($ENV{V}) && $ENV{V} ge "2") {
print STDERR "fdep: Considering file $file for target $target\n";
}
if ($file =~ /^(.*)\.def_mods(\..*)$/) {
$re = $def_re;
$add = \&add_def;
......@@ -61,7 +66,7 @@ foreach my $file (@ARGV) {
if ($_ =~ $re) {
&$add($object, $1);
} else {
die "Cannot parse module statement '$_', was expecting $re";
die "At $file:$.\nCannot parse module statement '$_', was expecting $re";
}
}
close(FILE)
......@@ -71,8 +76,8 @@ foreach my $object (sort keys %uses) {
for my $m (keys %{$uses{$object}}) {
if (defined $defs{$m}) {
print "$object: ", $defs{$m}, "\n";
} elsif (defined($ENV{V}) && $ENV{V} eq "1") {
print STDERR "Warning: Cannot find definition of module $m in files for current program, might be external\n";
} elsif (defined($ENV{V}) && $ENV{V} ge "1") {
print STDERR "Warning: Cannot find definition of module $m in files for current target $target, might be external\n";
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment