[Cook] Repeating pattern.

David Brown aegis at davidb.org
Tue Sep 30 16:07:46 EST 2003


I have a series of rules that look something like this:

        build/%: lib/% {
          cat > [target];
        data
        # 1 \"[need]\"
        dataend
          cat [need] >> build/%;
        }

I need this due to a broken compiler I'm using that needs sources in the
build directory.  Mainly my example just has a non-trivial rule, and an
easier way to do this is a different problem (that would also be nice to
know).

I would like to replicate this rule for several different directories
without having to write out the action each time.  There have been
several different times I've wanted to do this.

Basically, I want something like a functional recipe.

Is there a way to do this with cook?

Thanks,
Dave Brown



More information about the Cook-users mailing list