https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81615
kargl at gcc dot gnu.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |enhancement
Priority|P3 |P5
--- Comment #13 from kargl at gcc dot gnu.org ---
(In reply to Ben Barrowes from comment #12)
> Can gfortran be modified to have the option to do this as well?
Sure, gfortran can be modified. The nontrivial part is that there are very few
active contributors to gfortran. I suspect your patch would be much
appreciated.
Until then, you can modify your Makefile with very minor changes to stuff
intermediate files into subdirectories.
% ls
Makefile a1.f90 b1.f90 c1.f90 d1.f90
% cat Makefile
FC = gfortran11
PP = preprocessed/
FF = -c -cpp -save-temps -dumpdir ${PP}
IN = f90
NAMES = a1 b1 c1 d1
all:
mkdir -p ${PP}
.for i in ${NAMES}
${FC} ${FF} $i.${IN}
.endfor
clean:
@rm -rf ${PP} *.o
% make
mkdir -p preprocessed/
gfortran11 -c -cpp -save-temps -dumpdir preprocessed/ a1.f90
gfortran11 -c -cpp -save-temps -dumpdir preprocessed/ b1.f90
gfortran11 -c -cpp -save-temps -dumpdir preprocessed/ c1.f90
gfortran11 -c -cpp -save-temps -dumpdir preprocessed/ d1.f90
% ls
Makefile a1.o b1.o c1.o d1.o
a1.f90 b1.f90 c1.f90 d1.f90 preprocessed/
% ls preprocessed/
a1.f90 a1.s b1.f90 b1.s c1.f90 c1.s d1.f90 d1.s