Dear Gnu-guys,

I'd like to ask a question about make, and hope you could help me with
it. :-) Maye it's trivial, but I cannot seem to find out how to solve it...

I have some directories with fortran files, say
src/fil1.f
src/fil2.f
src2/fil2.f

where you can see fil2.f is in both directories.

I would like to list all files I want to compile in a variable:
SRCFILES = src/fil1.f src2/fil2.f

and compile them to a separate object directory:
OBJFILES = tmp/fil1.o tmp/fil2.o

Whether fil2.f is compiled from src/ or src2/ should therefore be
defined by SRCFILES.

Hopefully, something like this would be possible:
$(OBJFILES): $(SRCFILES)
        @echo "Compiling $< ... $@"

But I cannot make it work, and wonder if it is possible?



Cheers and thanks,
Amund Søvde
Department of Geosciences
University of Oslo
Norway



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to