Jump to page: 1 2
Thread overview
GNU Make fork with D support
Apr 23, 2021
Brian
Apr 23, 2021
Paul Backus
Apr 23, 2021
Brian
Apr 23, 2021
Paul Backus
Apr 23, 2021
Dennis
Apr 23, 2021
bachmeier
Apr 23, 2021
Brian
Apr 23, 2021
bachmeier
Apr 24, 2021
Brian
Apr 23, 2021
Max Haughton
Apr 23, 2021
Brian
Apr 23, 2021
Paul Backus
Apr 23, 2021
Brian
Apr 23, 2021
Vladimir Panteleev
Apr 24, 2021
Brian
Apr 24, 2021
Paul Backus
April 23, 2021

Hello --

Some of the long tail of the dis/assembler thread got me thinking about D tooling, or, more precisely, external tools that could help aid D usage in other projects.

I stumbled upon this page in the wiki:
https://wiki.dlang.org/Build_systems

And noticed that the only thing that provides plain ol' Makefiles is Reggae. But that is listed as alpha software.

So I went ahead and added D support to GNU Make: https://github.com/ibara/gmake-d
I am unsure how welcoming such a change would be to upstream, but this is an entirely vanilla GNU Make just a few additions (the file dlang.diff in the repo will tell you all the changes needed). Clone, build, install, and away you go.

~Brian

April 23, 2021

On Friday, 23 April 2021 at 12:34:09 UTC, Brian wrote:

>

So I went ahead and added D support to GNU Make: https://github.com/ibara/gmake-d
I am unsure how welcoming such a change would be to upstream, but this is an entirely vanilla GNU Make just a few additions (the file dlang.diff in the repo will tell you all the changes needed). Clone, build, install, and away you go.

~Brian

Rather than add these rules and variable definitions to GNU make's hard-coded internal lists, it seems like it would be much easier to distribute them in a file like dlang.mk, which users could then include into their own makefiles.

April 23, 2021

On Friday, 23 April 2021 at 15:01:01 UTC, Paul Backus wrote:

>

On Friday, 23 April 2021 at 12:34:09 UTC, Brian wrote:

>

So I went ahead and added D support to GNU Make: https://github.com/ibara/gmake-d
I am unsure how welcoming such a change would be to upstream, but this is an entirely vanilla GNU Make just a few additions (the file dlang.diff in the repo will tell you all the changes needed). Clone, build, install, and away you go.

~Brian

Rather than add these rules and variable definitions to GNU make's hard-coded internal lists, it seems like it would be much easier to distribute them in a file like dlang.mk, which users could then include into their own makefiles.

Maybe? In general I don't like those kinds of approaches, but I'd be willing to add such things to the repo.

IME, if you give people even the slightest reason not to do something, they won't do it. Asking them to include something that gmake could have built-in is just going to get people to say "I don't wanna use D then, it's not even a part of gmake."

Yes, that could be a criticism of this approach too. But I'd at least be willing to try to upstream it if it's something the community wants as a means towards amelioration of that criticism.

~Brian

April 23, 2021

On Friday, 23 April 2021 at 16:15:30 UTC, Brian wrote:

>

Maybe? In general I don't like those kinds of approaches, but I'd be willing to add such things to the repo.

IME, if you give people even the slightest reason not to do something, they won't do it. Asking them to include something that gmake could have built-in is just going to get people to say "I don't wanna use D then, it's not even a part of gmake."

My impression is that make users are used to having to write their own makefiles, even for languages like C and C++ that have some built-in support, so I would not expect this to be a big deal. And conversely, anyone looking for a build system that "just works" out-of-the-box is unlikely to choose make to begin with.

Regardless, I am not saying that you should not attempt to get this merged upstream--but in the interim, I think most D programmers would find it much easier to download and include a makefile fragment than to install an entire separate version of make from source.

April 23, 2021

On Friday, 23 April 2021 at 16:37:15 UTC, Paul Backus wrote:

>

Regardless, I am not saying that you should not attempt to get this merged upstream--but in the interim, I think most D programmers would find it much easier to download and include a makefile fragment than to install an entire separate version of make from source.

+1

My impression of make was that it's generating generic target files using generic shell commands with generic files as input. I didn't know there was special support for languages. That being the case, my preference would be:

  1. upstream native support
  2. additional file with rules for D
  3. special D version of make

The problem with a separate executable is that it's not only extra work for me as the author of a project, but I have to ask everyone else who wants to build my code to also install it, while a dlang.mk can be checked in so the extra work is only done once.

In any case, thanks for this work Brian! I hope you can get this upstream.

April 23, 2021

On Friday, 23 April 2021 at 16:37:15 UTC, Paul Backus wrote:

>

Regardless, I am not saying that you should not attempt to get this merged upstream--but in the interim, I think most D programmers would find it much easier to download and include a makefile fragment than to install an entire separate version of make from source.

As I said, willing to accept such files.

April 23, 2021

On Friday, 23 April 2021 at 18:40:24 UTC, Brian wrote:

>

On Friday, 23 April 2021 at 16:37:15 UTC, Paul Backus wrote:

>

Regardless, I am not saying that you should not attempt to get this merged upstream--but in the interim, I think most D programmers would find it much easier to download and include a makefile fragment than to install an entire separate version of make from source.

As I said, willing to accept such files.

https://gist.github.com/pbackus/8f9fe3a26eac463af553e22a50476cf0

April 23, 2021

Added, thanks:
https://github.com/ibara/gmake-d/commit/847345aee0121031f4fe56e31f32293ba3c1ebd6

~Brian

April 23, 2021

On Friday, 23 April 2021 at 17:29:06 UTC, Dennis wrote:

>

On Friday, 23 April 2021 at 16:37:15 UTC, Paul Backus wrote:

>

Regardless, I am not saying that you should not attempt to get this merged upstream--but in the interim, I think most D programmers would find it much easier to download and include a makefile fragment than to install an entire separate version of make from source.

+1

My impression of make was that it's generating generic target files using generic shell commands with generic files as input. I didn't know there was special support for languages. That being the case, my preference would be:

  1. upstream native support
  2. additional file with rules for D
  3. special D version of make

I guess my first preference would be the D compilers handling it. Just as dub init creates a new Dub project, dmd dlang.mk dumps dlang.mk in the directory and a Makefile that includes it.

April 23, 2021

On Friday, 23 April 2021 at 19:58:53 UTC, bachmeier wrote:

>

I guess my first preference would be the D compilers handling it. Just as dub init creates a new Dub project, dmd dlang.mk dumps dlang.mk in the directory and a Makefile that includes it.

I suspect that makes this a larger conversation which requires the enrollment of the compiler writers, possibly on the order of a DIP (which I can author if desired).

~Brian

« First   ‹ Prev
1 2