https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81615
--- Comment #11 from Steve Kargl <sgk at troutmask dot apl.washington.edu> --- On Fri, Dec 09, 2022 at 01:50:56AM +0000, barrowes at alum dot mit.edu wrote: > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81615 > > --- Comment #10 from Ben Barrowes <barrowes at alum dot mit.edu> --- > The reason the stdout redirection doesn't work for me is because > I want to save these preprocessed files during a "make" session. > When I make, thousands of fotran files are preprocessed and compiled. > How do I save the stdout from each one into its own directory? > % cat > a1.f90 subroutine foo end subroutine foo % cp a1.f90 b1.f90 % cp a1.f90 c1.f90 % cp a1.f90 d1.f90 % cat Makefile FC = gfortran11 FF = -cpp -E IN = f90 OUT = txt NAMES = a1 b1 c1 d1 all: .for i in ${NAMES} ${FC} ${FF} $i.${IN} > $i.${OUT} .endfor % make gfortran11 -cpp -E a1.f90 > a1.txt gfortran11 -cpp -E b1.f90 > b1.txt gfortran11 -cpp -E c1.f90 > c1.txt gfortran11 -cpp -E d1.f90 > d1.txt % ls Makefile a1.txt b1.txt c1.txt d1.txt a1.f90 b1.f90 c1.f90 d1.f90 The preprocessed files appear in the same directory with its source source file. It's trivial matter to have preprocess stuffed into its own directory. PS: Having to preprocess thousands of Fortran files into individual directories seems to be poor software design.