> The rule is :
>
> modnam.def : ttimes.f
This means 'ttimes.f must be up-to-date in order for this rule,
which makes modnam.def up-to-date, to be able to run'. From what
you say, this is not what you mean.
> echo " data modnam/'$(datadir)'" > modnam.def
>
> and i need this file to be written before the ttimes.f compiles.
Then what you need is:
# The double :: forces it to be rebuilt each time
modnam.def::
echo " data modnam/'$(datadir)'" > modnam.def
ttimes.f: modnam.def
I'm not sure if automake will still generate a compile rule for
ttimes.f, so you may need to specify the compile command as well.