Commit c46b07b5 authored by Lorenz Huedepohl's avatar Lorenz Huedepohl

Fix for fdep to avoid warnings

Multiple rules for the same dummy-file were created for modules used by
sources of more than one program. Corrected by including the program
name into the dummy-files
parent 984c9d6c
......@@ -40,12 +40,12 @@ endef
# $2 stem
# $3 program
define module_targets
$(eval _$(3)_use_mods += $(dir $1)$(2)$(call strip_fortran_ext,$(notdir $1)).use_mods.$(call object_extension,$3))
$(dir $1)$(2)$(call strip_fortran_ext,$(notdir $1)).use_mods.$(call object_extension,$3): $1 $(dir $1)$(am__dirstamp)
$(eval _$3_use_mods += $(dir $1)$2$(call strip_fortran_ext,$(notdir $1)).use_mods.$3.$(call object_extension,$3))
$(dir $1)$2$(call strip_fortran_ext,$(notdir $1)).use_mods.$3.$(call object_extension,$3): $1 $(dir $1)$(am__dirstamp)
$(call _f90_verbose,F90 USE [$3] $$<)$(FORTRAN_CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $($p_CPPFLAGS) $(CPPFLAGS) -o /dev/stdout $$< | grep -i -o '^ *use [^ ,!:]*' | sort -u > $$@
$(eval _$(3)_def_mods += $(dir $1)$(2)$(call strip_fortran_ext,$(notdir $1)).def_mods.$(call object_extension,$3))
$(dir $1)$(2)$(call strip_fortran_ext,$(notdir $1)).def_mods.$(call object_extension,$3): $1 $(dir $1)$(am__dirstamp)
$(eval _$3_def_mods += $(dir $1)$2$(call strip_fortran_ext,$(notdir $1)).def_mods.$3.$(call object_extension,$3))
$(dir $1)$2$(call strip_fortran_ext,$(notdir $1)).def_mods.$3.$(call object_extension,$3): $1 $(dir $1)$(am__dirstamp)
$(call _f90_verbose,F90 MOD [$3] $$<)$(FORTRAN_CPP) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $($p_CPPFLAGS) $(CPPFLAGS) -o /dev/stdout $$< | grep -i -o '^ *module [^!]*' > $$@ || true
endef
......
......@@ -42,16 +42,16 @@ foreach my $file (@ARGV) {
if (defined($ENV{V}) && $ENV{V} ge "2") {
print STDERR "fdep: Considering file $file\n";
}
if ($file =~ /^(.*)\.def_mods(\..*)$/) {
if ($file =~ /^(.*)\.def_mods.$p(\..*)$/) {
$re = $def_re;
$add = \&add_def;
$object = $1 . $2;
} elsif ($file =~ /^(.*)\.use_mods(\..*)$/) {
} elsif ($file =~ /^(.*)\.use_mods.$p(\..*)$/) {
$re = $use_re;
$add = \&add_use;
$object = $1 . $2;
} else {
die "Unrecognized file extension for '$file'";
die "Unrecognized file extension for '$file'\nExpected (.*)\.def_mods.$p(\..*) or (.*)\.use_mods.$p(\..*)";
}
open(FILE,"<",$file) || die "\nCan't open $file: $!\n\n";
while(<FILE>) {
......
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