I have a Fortran program that uses modules, i.e. creates files at compile time .mod. I also wrote a Makefile, which uses all .f90files from src/puts all created .ofiles in obj/and binaries in the current folder, and everything works fine.
Now I will recompile my program in different folders for different calculations (say, calc1/), i.e. copy Makefilein calc1/, type make allin calc1/, and all it does is link, because the object files already exist. However, if the program includes any modules, the compiler needs the appropriate .modfiles that will be present in calc1/. So far I have recompiled everything ( make clean all), but with the growth of the program it takes too much time!
A possible solution that I came across is to have one specific folder for binaries ( bin/). But this is not a viable option, because I have jobs in the queue that obviously need a stable binary, while I also try new features at the same time.
So I'm looking for a solution that somehow handles .modfiles similar to .o-files, for example. puts them in obj/.
source
share