I've been experimenting with using interface blocks in f90 systems to avoid
wave recompilation. Using Michael Olagnon's interface block generator I've
moved some of my subroutines out of modules to be stand alone and produced
interface blocks which are INCLUDEd elsewhere.
When trying to automatically generate makefiles for this setup I'm finding
I need to introduce extra fake targets into the system in addition to the
.f90, .o and .interface dependancies.
The reason for this is I seem to need two parallel trees for compilation.
The first is a very flat one to ensure .o files are created if .f90 and
.interface files change. But I also need a second to ensure that a
particular executable is re-loaded if any of its constituent object files
is changed. This second tree has to encompass the full calling tree in the
code, but is made fast because its actions are just to touch .done files.
For a simple system with calling tree
temp
a
c
e
e
b
d
e
I get the makefile at the end of this message, but I don't like the use of
these fake .done files. Has anyone else managed to do makefiles without
this second compilation sequence?
John
============================
all: temp.exe
temp.exe: temp.done
f90 -ldarg -Wl,+vnocompatwarnings -ccarg +DAportable -o temp.exe *.o
temp.done: a.done b.done temp.o
touch temp.done
temp.o: a.interface b.interface
f90 -c temp.f90
a.done: c.done e.done a.o
touch a.done
a.o: c.interface e.interface a.f90
f90 -c a.f90
b.done: d.done b.o
touch b.done
b.o: d.interface b.f90
f90 -c b.f90
c.done: e.done c.o
touch c.done
c.o: e.interface c.f90
f90 -c c.f90
d.done: e.done d.o
touch d.done
d.o: d.interface d.f90
f90 -c d.f90
e.done: e.o
touch e.done
e.o: e.f90
f90 -c e.f90
--
John Bray, Numerical Weather Prediction Tel: +44 (0) 1344 854035
Room 337 [log in to unmask]
The Met. Office http://www.met-office.gov.uk
London Road, Bracknell, RG12 2SZ, UK http://www.jrbray.org.uk
|