On 10/14/11 09:31, Dave Goodell wrote:

Having pondered this issue a lot for my playtime toy:
   http://www.gnu.org/software/autogen

my solution was to implement -M options, a la gcc.
That's fine for that thing, but it leads me to what is likely
a proper ultimate solution for multi-output tools:  wrapper scripts

When the wrapper script runs successfully, it emits the sentinel
file.  Syntax for support integrated directly into "make" would
be nice, but meanwhile wrapper scripts can be hacked together.
I think it makes make file writing easier.


For amusement, "-MFstamp-opts" creates an empty file with the
correct time stamp and the rule to create it lives in the Makefile.


$ cat .deps/opts-dep
# Makefile dependency file created by autogen
# with the following command:
#   /old-home/bkorb/ag/ag/agen5/.libs/autogen
#   -L../autoopts/tpl
#   -L../autoopts/tpl
#   -MF.deps/opts-dep
#   -MTstamp-opts
#   ./opts.def
AUTOGEN_stamp_opts_TList = \
        opts.h \
        opts.c

AUTOGEN_stamp_opts_SList = \
        ./opts.def \
        ../autoopts/tpl/options.tpl \
        ../autoopts/tpl/optlib.tlib \
        ../autoopts/tpl/tpl-config.tlib \
        ../autoopts/tpl/opthead.tlib \
        ../autoopts/tpl/optcode.tlib \
        ../autoopts/tpl/optmain.tlib

stamp-opts : $(AUTOGEN_stamp_opts_SList)

$(AUTOGEN_stamp_opts_TList) : stamp-opts
        @:

Reply via email to