[Templates] Replacing ttree with make

Harald Joerg harald.joerg@fujitsu-siemens.com
15 Nov 2002 18:02:28 +0100


Harald Joerg <harald.joerg@fujitsu-siemens.com> writes:

[nothing]

Sorry - fingers too quick.  Twice.
My first mistake was to reply to Simon what I wanted to go to the
list, the second was to send an empty buffer.  Sorry again.

I don't want to object against Simon's patch for ttree,
but exactly the scenario he describes is what I am solving with make.

Basically, I have Makefile entries like
----------------------------------------------------------------------
outdir/foo.html: indir/foo.html lib/header.tt2 lib/footer.tt2
        touch indir/foo.html

lib/header.tt2: lib/init.tt2 lib/global.tt2
        touch lib/header.tt2
----------------------------------------------------------------------
...and then I'm running ttree "as is".

I almost *never* need to "tree -a" when I change a template - provided
that I manage to keep the Makefile up to date.  Different
subdirectories have different include files; make takes care that
ttree processes this and only this subdirectory if I change one of
these particular include files.

I did not yet get up my mind to try to automate Makefile creation with
TT.  This would need some cross reference list from a ttree run.  The
problem is: To find out which file has actually been processed, you'd
have to hack it into the modules - only TT itself knows whether a
file, a BLOCK or something completely different has been PROCESSed.
And even then, if a file has been PROCESSed by a TT directive from a
BLOCK invocation, you're lost because you lack the left hand side for
writing a Makefile dependency.  Darn.
-- 
Cheers,
haj