D based build system to replace current makefile

Nick Sabalausky SeeWebsiteToContactMe at semitwist.com
Thu May 30 13:47:49 PDT 2013


On Thu, 30 May 2013 00:49:57 -0700
Timothee Cour <thelastmammoth at gmail.com> wrote:

> We should move to a D-based build system to build
> dmd/druntime/phobos/d-programming-language/tools.
> 
> Reasons, in case it's not obvious:
> 
> 1) DRY: makefile is full of repetitions
> 2) cross platform: different makefiles for different architectures are
> needed (even win32 vs win64!)
> 3) safety: makefile happily ignores that $VAR variables are not set,
> and can create havoc; likewise tools/update.sh is a bash script and
> may not stop on 1st error.
> 4) tools/update.sh doesn't work out of the box on OSX last i checked
> (I made a pull request for that some time back:
> https://github.com/timotheecour/d-programming-language.org/commit/557a2befa74ddfe99ee5c0e12e7c3d028f27d276)
> 
> Even a bad D-based build system will be better than a makefile, but
> it's not hard to write a reasonable one at least for the particular
> task of building dmd/druntime/phobos/d-programming-language/tools.
> It'll lower the entry point for people to contribute to dmd/phobos by
> making rebuilding trivial.
> 
> Here's how it'd work:
> 
> 1) a mixed D-based/makefile build that'll work 'from scratch' via
> bootstrapping:
> 1a) dmd: first uses a makefile to build dmd+druntime
> 1b) rdmd built from a D file using dmd
> 1c) phobos, d-programming-language, tools built from a D file using
> rdmd
> 
> 2) a pure D-based build that'll work using an existing dmd binary (eg
> distributed binary)
> that's the one most will use.
> 

FWIW, phobos needs to be built before rdmd because rdmd relies on
phobos.

Also, while I like the idea of replacing makefiles with a D solution,
I'm unsure whether it's really a good idea because that may make it
more difficult to bootstrap DMD to run on new platforms.

However, I do think that wrapping the invocations of all the makefiles
is a good idea and would still have the benefit of making it harder to
make mistakes such as (like you said) setting up the %VARs wrong.

In fact I've started working on such stuff already (And DVM can
already compile DMD, too, although it's possible it may still have
some room for improvement).



More information about the Digitalmars-d mailing list