From c46b07b523c4dfb8f49bbf6d2da8846e88861557 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lorenz=20H=C3=BCdepohl?= Date: Mon, 30 Jun 2014 16:26:34 +0200 Subject: [PATCH] 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 --- fdep/fortran_dependencies.mk | 8 ++++---- fdep/fortran_dependencies.pl | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fdep/fortran_dependencies.mk b/fdep/fortran_dependencies.mk index 6b17dfc0..d9bcfcf5 100644 --- a/fdep/fortran_dependencies.mk +++ b/fdep/fortran_dependencies.mk @@ -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 diff --git a/fdep/fortran_dependencies.pl b/fdep/fortran_dependencies.pl index 8af3fb98..2094e71b 100755 --- a/fdep/fortran_dependencies.pl +++ b/fdep/fortran_dependencies.pl @@ -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() { -- GitLab