Bug 3413 – DMD makefiles needs improvements

Status
RESOLVED
Resolution
WONTFIX
Severity
enhancement
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
All
OS
Linux
Creation time
2009-10-17T11:47:00Z
Last change time
2014-04-18T09:12:07Z
Keywords
patch
Assigned to
nobody
Creator
leandro.lucarella

Attachments

IDFilenameSummaryContent-TypeSize
4770001-WIP-Improve-build-system.patchPatch against DMD 1.x branch r215 for adding dependency handling to linux.maktext/plain2457

Comments

Comment #0 by leandro.lucarella — 2009-10-17T11:47:54Z
Created attachment 477 Patch against DMD 1.x branch r215 for adding dependency handling to linux.mak The DMD make-based build system has a few problems. The main problems I see are: 1) Lack of dependency handling 2) Excessive duplication 1) Is bad because you have to do a 'make clean all' each time you change something to be sure that the compiled binary wont have problems. This is really easy to fix, see the attached file which implement this for the Linux makefile (but can be applied to any makefile using GCC). 2) Is bad because is really hard to write, read and maintain, and very error prone (for instance, r215 is missing the new json.{h,c,o} files in the solaris.mak file). The ideal would be to have a makefile with the common stuff and other specific makefiles with the specifics for each OS. I can redesign the DMD makefiles to support automatic dependency handling and to be highly readable and simple to maintain, if there are any interest in this. I will only need some assistance for testing it in other OSs than Linux because I don't have them installed. I'm attaching just a "teaser" patch that fixes 1) for Linux as a prove of concept, I didn't wanted to spend time redesigning the DMD build system because I have the feeling that maybe is not something that Walter wants. You can apply the patch with patch -p2 < 0001-WIP-Improve-build-system.patch in the src directory.
Comment #1 by alex — 2012-10-20T17:58:21Z
Is this patch still relevant today?
Comment #2 by leandro.lucarella — 2012-10-24T07:38:58Z
(In reply to comment #1) > Is this patch still relevant today? The patch, I don't think it will apply, is too old. I still think the makefile could use some improvements though, and automatic dependencies handling, but I don't a patch on this regard will be ever accepted because it depends on GCC and as long as there is no similar solution in the other compilers being used, the manual dependencies have to be done anyway.
Comment #3 by alex — 2012-10-24T07:40:52Z
OK, I guess we can close this then. Thanks!
Comment #4 by leandro.lucarella — 2012-10-24T07:50:49Z
(In reply to comment #3) > OK, I guess we can close this then. Thanks! Well, I'm not sure there are no alternatives in for the non-gcc platforms. Do you?
Comment #5 by alex — 2012-10-24T14:23:26Z
I'm fairly certain there is no other way. I've been involved with some C projects where the build systems were maintained in very rigorous ways, and even they couldn't find an alternative to relying on the compiler for this. It would of course be nice if someone came up with a portable alternative I haven't thought of, but I doubt it's going to happen...