Have Win DMD use gmake instead of a separate DMMake makefile?

H. S. Teoh hsteoh at quickfur.ath.cx
Sun Aug 11 15:38:09 PDT 2013


On Sun, Aug 11, 2013 at 12:11:14AM -0700, Jonathan M Davis wrote:
> On Saturday, August 10, 2013 22:48:14 Walter Bright wrote:
> > On 8/10/2013 4:21 PM, Jonathan M Davis wrote:
> > > Another suggestion that I kind of liked was to just build them all
> > > with a single script written in D and ditch make entirely, which
> > > would seriously reduce the amount of duplication across platforms.
> > > But that's obviously a much bigger change and would likely be much
> > > more controversial than simply using a more standard make.
> > 
> > I don't see much point in that. The dmd build is straightforward,
> > and I see no particular gain from reinventing that wheel.
> 
> Well, make is horrible, and while posix.mak is way better than
> win32.mak or win64.mak, it's still pretty bad. Personally, I would
> never use make without something like cmake in front of it. If we were
> to write up something in D, it could be properly cross-platform (so
> only one script instead of 3+), and I fully expect that it could be
> far, far cleaner than what we're forced to do in make.
[...]

Maybe my previous post didn't get the idea across clearly, so let me try
again. My underlying thrust was: instead of maintaining 3 different
makefiles (or more) by hand, have a single source for all of them, and
write a small D program to generate posix.mak, win32.mak, win64.mak,
whatever, from that source.

That way, adding/removing files from the build, etc., involves only
editing a single file, and regenerating the makefiles/whatever we use.
If there's a problem with a platform-specific makefile, then it's just a
matter of fixing the platform-specific output handler in the D program.

The way we're currently doing it essentially amounts to the same thing
as copy-n-pasting the same piece of code 3 times and trying to maintain
all 3 copies separately, instead of writing a template that can be
specialized 3 times, thus avoiding boilerplate and maintenance
headaches.


T

-- 
For every argument for something, there is always an equal and opposite argument against it. Debates don't give answers, only wounded or inflated egos.


More information about the Digitalmars-d mailing list