Thread overview | |||||||
---|---|---|---|---|---|---|---|
|
December 17, 2016 [OT] D in makefiles | ||||
---|---|---|---|---|
| ||||
Makefiles allow custom shells. So with a small wrapper script we can use D in makefile. Here's my proof of concept: https://gist.github.com/Superstar64/8b896312ebe1a6e6240b1cba8aed2488. |
December 17, 2016 Re: [OT] D in makefiles | ||||
---|---|---|---|---|
| ||||
Posted in reply to Superstar64 | On Saturday, 17 December 2016 at 02:00:34 UTC, Superstar64 wrote:
> Makefiles allow custom shells. So with a small wrapper script we can use D in makefile. Here's my proof of concept: https://gist.github.com/Superstar64/8b896312ebe1a6e6240b1cba8aed2488.
If you define
SHELL = rdmd
you might not need any wrapper script.
|
December 18, 2016 Re: [OT] D in makefiles | ||||
---|---|---|---|---|
| ||||
Posted in reply to John Colvin | On 17/12/16 10:06, John Colvin wrote:
> On Saturday, 17 December 2016 at 02:00:34 UTC, Superstar64 wrote:
>> Makefiles allow custom shells. So with a small wrapper script we can
>> use D in makefile. Here's my proof of concept:
>> https://gist.github.com/Superstar64/8b896312ebe1a6e6240b1cba8aed2488.
>
> If you define
> SHELL = rdmd
> you might not need any wrapper script.
Since newlines in make mean new execution, you will find it pretty hard to write a recipe that will be both usable and readable. This is, of course, assuming you overcome the fact that rdmd does not accept the program as a "-c" argument.
Shachar
|
December 18, 2016 Re: [OT] D in makefiles | ||||
---|---|---|---|---|
| ||||
Posted in reply to Shachar Shemesh | On 12/18/16 2:47 PM, Shachar Shemesh wrote: > On 17/12/16 10:06, John Colvin wrote: >> On Saturday, 17 December 2016 at 02:00:34 UTC, Superstar64 wrote: >>> Makefiles allow custom shells. So with a small wrapper script we can >>> use D in makefile. Here's my proof of concept: >>> https://gist.github.com/Superstar64/8b896312ebe1a6e6240b1cba8aed2488. >> >> If you define >> SHELL = rdmd >> you might not need any wrapper script. > > Since newlines in make mean new execution, you will find it pretty hard > to write a recipe that will be both usable and readable. IIRC there is an option in gmake that allows one to run all commands within the same shell. https://www.gnu.org/software/make/manual/html_node/One-Shell.html. Anyway, it seems such usage of rdmd would be quite extreme. -- Andrei |
December 19, 2016 Re: [OT] D in makefiles | ||||
---|---|---|---|---|
| ||||
Posted in reply to Andrei Alexandrescu | On 18/12/16 22:24, Andrei Alexandrescu wrote:
> IIRC there is an option in gmake that allows one to run all commands
> within the same shell.
> https://www.gnu.org/software/make/manual/html_node/One-Shell.html.
Was not aware of this. Thanks!
Too bad it's an all or nothing thing. It would, otherwise, have been very useful to me in various make files I've written in the past.
Shachar
|
Copyright © 1999-2021 by the D Language Foundation