QEF home page
15. Touchfiles

In this section we introduce the touchfiles program.

Table of Contents
Previous Page
Next Page

The _Touch_() macro

Sometimes it is necessary to force a class of objects to be rebuilt due to a change in the tool or its data. To meet this requirement, the QEF provides the touchfiles facility. When a script generator outputs the dependency list for a target it adds a dependency _Touch_(tool) as in:

f:P: f.o _Libs_(_S_(f.c)) _Touch_(cc)
        _T_cc ...

The _Touch_(file) macro is replaced by the pathnames of existing X/file where X is a directory named by qvrs variable @TouchPath. If no such files exist, the macro is replaced by the empty string.

To illustrate its use, let us return to the ctoe directory.

% qd -46 /ctoe

% qef
#{ @gobo 2003/07/20 11:11:38
# QEFHALTFILE: /g/dt/cook/obj/ctoe/%qef03953b.hlt
#} E0 gobo@/g/dt/cook/obj/ctoe 2003/07/20 11:11:38(0)

Everything's up to date.

touchfiles Let's assume we need to force all yacc processes to be redone:
% touchfiles -c yacc  # create yacc touchfile
Touched /g/dt/cook/obj/touchdir/yacc

% qef
#{ @gobo 2003/07/20 11:13:48
# QEFHALTFILE: /g/dt/cook/obj/ctoe/%qef03994b.hlt
+ qyacc -h -yctoe /p/cook/s3.4/ctoe/ctoey.y
yacc: 6 shift/reduce conflicts.

% qhy ctoey.c
ctoey.c @ 2003/07/20 11:13:48 ->
    ctoey.c (2003/07/20 11:13:28)
    ctoey.h (2003/07/20 11:13:28)
        < /g/dt/cook/obj/touchdir/yacc (2003/07/20 11:13:44)
        + qyacc -h -yctoe /p/cook/s3.4/ctoe/ctoey.y

The yacc output file ctoey.c was reproduced since it was older than the yacc touchfile.

It is rare that a tool such as yacc would change, but this can be used to deal with changes in product tools. When a change in a tool requires that all the files that it produces must be reproduced, creating a touchfile is a very simple and effective mechanism.

cook25.qh - 1.10 - 03/10/16 QEF home page Table of Contents Previous Page Next Page