www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 3413] New: DMD makefiles needs improvements

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3413

           Summary: DMD makefiles needs improvements
           Product: D
           Version: 1.051
          Platform: All
        OS/Version: Linux
            Status: NEW
          Keywords: patch
          Severity: enhancement
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: llucax gmail.com



PDT ---
Created an attachment (id=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.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 17 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3413


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alex lycus.org



CEST ---
Is this patch still relevant today?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 20 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3413




2012-10-24 07:38:58 PDT ---

 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. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 24 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3413


Alex Rønne Petersen <alex lycus.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |WONTFIX



CEST ---
OK, I guess we can close this then. Thanks!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 24 2012
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3413




2012-10-24 07:50:49 PDT ---

 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? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 24 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=3413




CEST ---
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...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Oct 24 2012