Dale King <[EMAIL PROTECTED]> writes:

> I'm wondering if there is a better way to handle the case where multiple
> files get built by the same command. One example, might be the link step
> which generates both the executable and a map file, but it could be any
> program that generates more than one file.
>
> Let's take as a hypothetical example a command foo that given a file a
> in some language that produces a C header and source file. One might
> think you would design a rule like this:
>
> a.h a.c : a
>     foo a
>
> This is of course, the multiple targets for one rule and does not say
> that both will be generated by executing the command. The above is the
> equivalent of
>
> a.h : a
>     foo a
>
> a.c : a
>     foo a
>
> Which says nothing about the joint nature of the two targets.
>
> ...
>
> So is there a good way out of this puzzle?

The only way I know is to use implicit pattern rules:

%.h %.c: %
        foo $<

This tells make that something.h and something.c are build together
by single execution of the command.

hth,
-boris



_______________________________________________
Help-make mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-make

Reply via email to