-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
mkhelper.mk.in: apply proxy mechanism to submodules.
- Loading branch information
Showing
2 changed files
with
14 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ | |
--fc-enable | ||
--fc-mod-ext=@[email protected] | ||
--fc-mod-upper=@FC_MOD_FILE_UPPER@ | ||
--fc-smod-ext=@FC_SMOD_FILE_EXT@ | ||
--fc-smod-ext=@FC_SMOD_FILE_EXT@.proxy | ||
--fc-root-smod=@FC_ROOT_SMOD@ | ||
--fc-inc-flag=@FC_INC_FLAG@ | ||
--fc-inc-order=@FC_INC_ORDER@ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,6 +117,7 @@ depend: $(lib_dep_files) $(exe_dep_files) | |
mostlyclean: $(bundled_subdirs) | ||
rm -f $(src_files:.f90=.@OBJEXT@) | ||
rm -f $(moddir)/*.@FC_MOD_FILE_EXT@ $(moddir)/*.@[email protected] | ||
rm -f $(moddir)/*.@FC_SMOD_FILE_EXT@ $(moddir)/*.@[email protected] | ||
rm -f $(lib_files) $(exe_files) $(exe_files:=.dSYM) | ||
|
||
# Delete files generated at the building stage: | ||
|
@@ -161,12 +162,12 @@ $(exe_files): | $(dir_files) | |
$(silent_FCLD)$(FC) -o $@ $(makefile_FCFLAGS) $(FCFLAGS) $(LDFLAGS) $+ $(makefile_LIBS) $(LIBS) | ||
|
||
# Fortran compilation rule: | ||
%.@OBJEXT@: %.f90 | $(dir_files) $(bundled_subdirs) | ||
%.@OBJEXT@: %.f90 | $(dir_files) $(bundled_subdirs) sanitize-mod-proxies | ||
$(silent_FC)$(FC) -o $@ -c $(makefile_FCFLAGS) $(FCFLAGS) @FCFLAGS_f90@ $< | ||
|
||
|
||
# Fortran module file tracking rule: | ||
$(moddir)/%.@[email protected]: | sanitize-mod-proxies | ||
$(moddir)/%.@[email protected]: | ||
@if test -z '$<'; then \ | ||
echo "Cannot find Fortran source file providing module '$(basename $(@F:.proxy=))'." >&2; \ | ||
else \ | ||
|
@@ -175,11 +176,20 @@ $(moddir)/%.@[email protected]: | sanitize-mod-proxies | |
else cp '$(@:.proxy=)' '$@' 2>/dev/null; fi; \ | ||
fi | ||
|
||
$(moddir)/%.@[email protected]: | ||
@if test -z '$<'; then \ | ||
echo "Cannot find Fortran source file providing submodule '$(basename $(@F:.proxy=))'." >&2; \ | ||
else \ | ||
if test ! -f '$(@:.proxy=)'; then rm -f '$<'; $(MAKE) '$<'; fi; \ | ||
if cmp '$@' '$(@:.proxy=)' >/dev/null 2>&1 || $(MODCMP) '$@' '$(@:.proxy=)' @FC_VENDOR@ 2>/dev/null; then :; \ | ||
else cp '$(@:.proxy=)' '$@' 2>/dev/null; fi; \ | ||
fi | ||
|
||
# Deletes all Fortran module proxy files that do not have an existing module to | ||
# be a proxy of, i.e. if <filename>.proxy exists but <filename> does not, | ||
# delete <filename>.proxy: | ||
sanitize-mod-proxies: | ||
@rm -f $(filter-out $(addsuffix .proxy,$(wildcard $(moddir)/*.@FC_MOD_FILE_EXT@)),$(wildcard $(moddir)/*.@[email protected])) | ||
@rm -f $(filter-out $(addsuffix .proxy,$(wildcard $(moddir)/*.@FC_MOD_FILE_EXT@ $(moddir)/*.@FC_SMOD_FILE_EXT@)),$(wildcard $(moddir)/*.@FC_MOD_FILE_EXT@.proxy $(moddir)/*.@FC_SMOD_FILE_EXT@.proxy)) | ||
|
||
# Directory creation rule: | ||
%/.dirstamp: | ||
|