Re: Command producing several targets at once

2017-07-29 Thread Stefan Monnier
> 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 $< IIUC a degenerate form of this is to decide that "parse.ml" plays the role of the stamp file, so you do parser.ml: par

Re: Command producing several targets at once

2017-07-27 Thread Sébastien Hinderer
Dear Paul and Britton, I'd really like to thank both of you for your time and for sharing your experience and expertise, I found it really interesting to follow your exchange. I'll probably follow Paul's advice because on the project I work on it will probably work just fine. However, just for sa

Re: Command producing several targets at once

2017-07-26 Thread Britton Kerin
On Wed, Jul 26, 2017 at 12:44 PM, Paul Smith wrote: > On Wed, 2017-07-26 at 12:31 -0800, Britton Kerin wrote: >> It's still worth it to avoid non-static pattern rules though IMO. > > I use normal pattern rules all the time in all my makefiles. Love 'em, > and I see no point in trying to avoid the

Re: Command producing several targets at once

2017-07-26 Thread Paul Smith
On Wed, 2017-07-26 at 12:31 -0800, Britton Kerin wrote: > It's still worth it to avoid non-static pattern rules though IMO. I use normal pattern rules all the time in all my makefiles. Love 'em, and I see no point in trying to avoid them. YMMV of course, just providing a different viewpoint. __

Re: Command producing several targets at once

2017-07-26 Thread Britton Kerin
On Wed, Jul 26, 2017 at 9:31 AM, Paul Smith wrote: > On Wed, 2017-07-26 at 09:17 -0800, Britton Kerin wrote: >> 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 $< > > I ex

Re: Command producing several targets at once

2017-07-26 Thread Paul Smith
On Wed, 2017-07-26 at 09:17 -0800, Britton Kerin wrote: > 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 $< I expect you want to add a "touch $@" to this recipe. And, this

Re: Command producing several targets at once

2017-07-26 Thread Britton Kerin
On Wed, Jul 26, 2017 at 5:31 AM, Paul Smith 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

Re: Command producing several targets at once

2017-07-26 Thread Sébastien Hinderer
OK thanks a lot Paul. Things are much clearer now. Sébastien. ___ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make

Re: Command producing several targets at once

2017-07-26 Thread Paul Smith
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

Re: Command producing several targets at once

2017-07-26 Thread Sébastien Hinderer
Thanks a lot to you too, Thomas! Sébastien. ___ Help-make mailing list Help-make@gnu.org https://lists.gnu.org/mailman/listinfo/help-make

Re: Command producing several targets at once

2017-07-26 Thread Sébastien Hinderer
Sébastien Hinderer (2017/07/26 15:18 +0200): > Oh great! I was not aware of this. > > So am I correctin assuming that something like > > parsers := foo.mly bar.mly baz.mly > > $(parsers): %.ml %.mli > ocamlyacc $< > > would work the expected way? Sorry, I meant: parsers := foo.mly

Re: Command producing several targets at once

2017-07-26 Thread Sébastien Hinderer
Dear Paul, Many thanks for your prompt and helpful response! Paul Smith (2017/07/26 08:57 -0400): > On Wed, 2017-07-26 at 09:24 +0200, Sébastien Hinderer wrote: > > parser.mli parser.ml: parser.mly > >    ocaplyacc $< > > > > does nos say exactly this but is rather an abbreviation for >

Re: Command producing several targets at once

2017-07-26 Thread Thomas Martitz
Am 26.07.2017 um 09:24 schrieb Sébastien Hinderer: Dear all, OCaml's parser generator, ocamlyacc, produces two files simultaneously. For example, the command ocamlyacc parsermly will produce both parser.ml (the code of the parser) and parser.mli (the interface of the parsing module, descrbing

Re: Command producing several targets at once

2017-07-26 Thread Paul Smith
On Wed, 2017-07-26 at 09:24 +0200, Sébastien Hinderer wrote: > parser.mli parser.ml: parser.mly >    ocaplyacc $< > > does nos say exactly this but is rather an abbreviation for > > parser.mli: parser.mly >     ocamlyacc $< > > parser.ml: parser.mly >     ocamlyacc $< Co

Command producing several targets at once

2017-07-26 Thread Sébastien Hinderer
Dear all, OCaml's parser generator, ocamlyacc, produces two files simultaneously. For example, the command ocamlyacc parsermly will produce both parser.ml (the code of the parser) and parser.mli (the interface of the parsing module, descrbing which symbols it exports). I am wondering what's the