Do people have tools to update make files (or another build system) when a new module is to be USEd in a program? That module may depend on other source files, so its dependencies need to be added in the proper order.
For example, I can create an executable with
gfortran kind.f90 first_last_true.f90 print_array.f90 error.f90 get_unit.f90 cholesky.f90 util.f90 correlation.f90 statistics.f90 random_normal.f90 random_mv_normal.f90 acf.f90 var_sim.f90 pythag.f90 svbksb.f90 svdcmp.f90 reg_stats.f90 var_fit.f90 xvar_fit_print.f90
and also with
gfortran kind.f90 statistics.f90 qsort.f90 date_mdy.f90 util.f90 qsort_good.f90 open_file.f90 get_unit.f90 replace_string.f90 error.f90 read_mdy_alloc.f90 data_frame_full.f90 data_frame_full_stats.f90 xvar_data_frame.f90
The file var_fit.f90
contains a module var_fit_mod
that I want to use in xvar_data_frame.f90
, so the question is which files in addition to var_fit.f90
do I need to add to the second compilation command above. A script tells me that the files in the first compilation list but not the second are
first_last_true.f90 print_array.f90 cholesky.f90 correlation.f90 random_normal.f90 random_mv_normal.f90 acf.f90 var_sim.f90 pythag.f90 svbksb.f90 svdcmp.f90 reg_stats.f90 var_fit.f90 xvar_fit_print.f90
I need to add a subset of this list of files to the second compilation list, but which ones and in what order? I created a main program dummy_var_fit.f90
that is just
use var_fit_mod
end
and ascertained that
gfortran kind.f90 error.f90 util.f90 print_array.f90 first_last_true.f90 acf.f90 svbksb.f90 pythag.f90 svdcmp.f90 reg_stats.f90 var_fit.f90 dummy_var_fit.f90
compiles. That narrows the list of files I need to add to
print_array.f90 first_last_true.f90 acf.f90 svbksb.f90 pythag.f90 svdcmp.f90 reg_stats.f90 var_fit.f90 dummy_var_fit.f90
.
After some experimentation I find that
gfortran kind.f90 print_array.f90 first_last_true.f90 acf.f90 svbksb.f90 pythag.f90 svdcmp.f90 statistics.f90 qsort.f90 date_mdy.f90 util.f90 qsort_good.f90 open_file.f90 get_unit.f90 replace_string.f90 error.f90 read_mdy_alloc.f90 reg_stats.f90 data_frame_full.f90 data_frame_full_stats.f90 var_fit.f90 xvar_data_frame.f90
compiles. Creating dummy main programs and associated make files for each module can clarify what dependencies are, but I would like to automate the process of creating compilation comands.