On Sat, 10 Aug 2013 17:14:35 -0700 "H. S. Teoh" <[email protected]> wrote: > > I'm all for ditching make. What about this: > > - We write a small D app that automatically scans all dependencies and > generates a shell script / .BAT file / whatever the target platform > uses, that contains compile commands that builds DMD and a make > replacement written in D. This is for bootstrapping. > > - The make replacement written in D can then be used to rebuild DMD, > build druntime, Phobos, etc.. >
That's a very interesting idea. Couple thoughts: - It sounds a lot like RDMD, just with shell-script output added (actually, I think RDMD can already generate makefiles). So I'm wondering how much of RDMD could be leveraged for this. But maybe not much since RDMD is specially-tailored to scanning D-based projects, not C/C++ ones like DMD (but druntime and phobos OTOH...). I guess the tool you're talking about would be specifically-designed to scan DMD's sources. Or is there some existing C/C++ tool we could/should leverage? - What happens when DMD starts using D-language sources? The generated bootstrapper shell scripts would no longer be able to compile DMD because DMD hasn't yet been built. So it wouldn't solve *that* issue, but I suppose we can just shell-bootstrap the last pure-C/C++ DMD as an "origin" DMD and use that to compile the next DMD (or the most recent one it's capable of compiling), and then use that to compile the next-in-line DMD, and so on up to whatever's the latest. (Which is probably what would have to happen *anyway* even without the tool you suggest.) Sounds like that should work, and fairly well, too (as long as DMD's D-based sources are careful to be compilable with *sufficiently* older versions of itself). And it eliminates any point in bothering to make any big improvements on the makefiles.
