On Wed, Jul 26, 2017 at 5:31 AM, Paul Smith <psm...@gnu.org> wrote: > On Wed, 2017-07-26 at 15:21 +0200, Sébastien Hinderer wrote: >> Sorry, I meant: >> >> parsers := foo.mly bar.mly baz.mly >> >> $(parsers): %.ml %.mli: %.mly%.ml %.mli: %.mly >> ocamlyacc $< > > No. That's a static pattern rule. You can't get this multiple targets > built with a single recipe feature with a static pattern rule, only with > normal pattern rules. > > Just write it as I put in my email: > > %.ml %.mli: %.mly > ocamlyacc $<
Another option if you don't like non-static pattern rules or the special-case stuff involved, is to use a stamp file: yaccouts.stamp: parser.mly ocamlyacc $< Since .ml and .mli files are always produced together by the same program, they don't need individual nodes in your dependency graph so you arrange yaccouts.stamp to represent them (and depend on the stamp file in turn where needed). This approach works with static pattern rules and is useful in other situations as well, e.g. when you want to represent completeness of a build in a subdir or other place, to represent verification of expensive-to-verify build requirements, etc. Britton _______________________________________________ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make