Thread overview
[phobos] linux.mak + osx.mak = GNUMakefile
Jul 27, 2010
Sean Kelly
Jul 27, 2010
Walter Bright
Jul 27, 2010
Brad Roberts
Jul 27, 2010
Don Clugston
Jul 27, 2010
Sean Kelly
Jul 27, 2010
Sean Kelly
July 27, 2010
Hey folks,


I was building Phobos on OSX when I ran into a makefile bug that I'd fixed in linux.mak. It was still present in osx.mak. I noticed the files are virtually identical, so why not merge them?

Since the one thing that linux.mak and osx.mak have in common is the fact that they're understood by gnu make (as opposed to win32.mak which is used by Walter's own make utility), I'm thinking the new makefile should be called GNUMakefile. That name is actually understood by gmake which means no more -f.

I'm operating this change and will check in soon, please let me know if you foresee any issues.



Andrei
July 27, 2010
On Jul 27, 2010, at 7:48 AM, Andrei Alexandrescu wrote:

> Hey folks,
> 
> 
> I was building Phobos on OSX when I ran into a makefile bug that I'd fixed in linux.mak. It was still present in osx.mak. I noticed the files are virtually identical, so why not merge them?
> 
> Since the one thing that linux.mak and osx.mak have in common is the fact that they're understood by gnu make (as opposed to win32.mak which is used by Walter's own make utility), I'm thinking the new makefile should be called GNUMakefile. That name is actually understood by gmake which means no more -f.

I've been using the linux makefile to build on OSX for months now :-)  Sounds good to me.
July 27, 2010

Andrei Alexandrescu wrote:
> Hey folks,
>
>
> I was building Phobos on OSX when I ran into a makefile bug that I'd fixed in linux.mak. It was still present in osx.mak. I noticed the files are virtually identical, so why not merge them?
>
> Since the one thing that linux.mak and osx.mak have in common is the fact that they're understood by gnu make (as opposed to win32.mak which is used by Walter's own make utility), I'm thinking the new makefile should be called GNUMakefile. That name is actually understood by gmake which means no more -f.
>
> I'm operating this change and will check in soon, please let me know if you foresee any issues.
>

I prefer to keep them separate because:

1. It's very simple for the user to tell which makefile is for what
system. With win32.mak and GNUmakefile it's wtf?
2. While they may be the same now, in the future they may be fairly
different.
3. I like to drive make with my own makefile which then sets some macros
and calls -flinux.mak, which would make it difficult to have a makefile
that is the default name
4. It's *not* a burden to have two makefiles for different platforms. I
think it's convenient and self-documenting to have a 1:1 correspondence
between platforms and makefiles.
5. I like being able to futz with one without risk of breaking all the
other platforms that I didn't test it on.
6. I find differences in gnu make from system to system, for example,
FreeBSD has a much more primitive implementation on it.

July 27, 2010
I prefer one.  There shouldn't be many differences and showing that in one file with specific conditional logic makes it a lot more obvious that it's intentional than a diff that happens to show that that are differences.  Changes need to be done once instead of N times.  Etc.

On Jul 27, 2010, at 11:14 AM, Walter Bright <walter at digitalmars.com> wrote:

>
>
> Andrei Alexandrescu wrote:
>> Hey folks,
>>
>>
>> I was building Phobos on OSX when I ran into a makefile bug that I'd fixed in linux.mak. It was still present in osx.mak. I noticed the files are virtually identical, so why not merge them?
>>
>> Since the one thing that linux.mak and osx.mak have in common is the fact that they're understood by gnu make (as opposed to win32.mak which is used by Walter's own make utility), I'm thinking the new makefile should be called GNUMakefile. That name is actually understood by gmake which means no more -f.
>>
>> I'm operating this change and will check in soon, please let me know if you foresee any issues.
>>
>
> I prefer to keep them separate because:
>
> 1. It's very simple for the user to tell which makefile is for what
> system. With win32.mak and GNUmakefile it's wtf?
> 2. While they may be the same now, in the future they may be fairly
> different.
> 3. I like to drive make with my own makefile which then sets some
> macros and calls -flinux.mak, which would make it difficult to have
> a makefile that is the default name
> 4. It's *not* a burden to have two makefiles for different
> platforms. I think it's convenient and self-documenting to have a
> 1:1 correspondence between platforms and makefiles.
> 5. I like being able to futz with one without risk of breaking all
> the other platforms that I didn't test it on.
> 6. I find differences in gnu make from system to system, for
> example, FreeBSD has a much more primitive implementation on it.
>
> _______________________________________________
> phobos mailing list
> phobos at puremagic.com
> http://lists.puremagic.com/mailman/listinfo/phobos
July 27, 2010
Walter Bright wrote:
> 
> 
> Andrei Alexandrescu wrote:
>> Hey folks,
>>
>>
>> I was building Phobos on OSX when I ran into a makefile bug that I'd fixed in linux.mak. It was still present in osx.mak. I noticed the files are virtually identical, so why not merge them?
>>
>> Since the one thing that linux.mak and osx.mak have in common is the fact that they're understood by gnu make (as opposed to win32.mak which is used by Walter's own make utility), I'm thinking the new makefile should be called GNUMakefile. That name is actually understood by gmake which means no more -f.
>>
>> I'm operating this change and will check in soon, please let me know if you foresee any issues.
>>
> 
> I prefer to keep them separate because:
> 
> 1. It's very simple for the user to tell which makefile is for what system. With win32.mak and GNUmakefile it's wtf?

It's "Oh, for gnu make I use GNUMakefile".

> 2. While they may be the same now, in the future they may be fairly different.

I prefer to keep things factored together. Again, I am motivated by the heavy current duplication and the fact that I fix bugs in one makefile and then encounter them in the second.

By the way, I compel you to start using cygwin and gmake on Windows so we can unify the three. We should revisit the "I tried cygwin and I don't remember why it didn't work well" status.

> 3. I like to drive make with my own makefile which then sets some macros and calls -flinux.mak, which would make it difficult to have a makefile that is the default name

Why? you can alsways specify the default name explicity, i.e. -fGNUMakefile.

> 4. It's *not* a burden to have two makefiles for different platforms. I think it's convenient and self-documenting to have a 1:1 correspondence between platforms and makefiles.

I stand here to say that there is a significant burden. I've been the maintainer of non-Windows makefiles and every single improvement I brought to them has been very beneficial for me.

> 5. I like being able to futz with one without risk of breaking all the other platforms that I didn't test it on.

That's what cp or svn are for.

> 6. I find differences in gnu make from system to system, for example, FreeBSD has a much more primitive implementation on it.

We specialize for FreeBSD if so needed. Anyway, one key improvement in the recent linux.mak is that it puts much less pressure on the gmake version.


Andrei
July 27, 2010
On Jul 27, 2010, at 11:14 AM, Walter Bright wrote:

> Andrei Alexandrescu wrote:
>> Hey folks,
>> 
>> 
>> I was building Phobos on OSX when I ran into a makefile bug that I'd fixed in linux.mak. It was still present in osx.mak. I noticed the files are virtually identical, so why not merge them?
>> 
>> Since the one thing that linux.mak and osx.mak have in common is the fact that they're understood by gnu make (as opposed to win32.mak which is used by Walter's own make utility), I'm thinking the new makefile should be called GNUMakefile. That name is actually understood by gmake which means no more -f.
>> 
>> I'm operating this change and will check in soon, please let me know if you foresee any issues.
>> 
> 
> I prefer to keep them separate because:
> 
> 1. It's very simple for the user to tell which makefile is for what system. With win32.mak and GNUmakefile it's wtf?
> 2. While they may be the same now, in the future they may be fairly different.
> 3. I like to drive make with my own makefile which then sets some macros and calls -flinux.mak, which would make it difficult to have a makefile that is the default name
> 4. It's *not* a burden to have two makefiles for different platforms. I think it's convenient and self-documenting to have a 1:1 correspondence between platforms and makefiles.
> 5. I like being able to futz with one without risk of breaking all the other platforms that I didn't test it on.
> 6. I find differences in gnu make from system to system, for example, FreeBSD has a much more primitive implementation on it.

druntime has only 2 makefiles though: win32.mak and posix.mak, and I don't think it's ever confused anyone.  Why maintain multiple identical makefiles?  I do like being able to specify the makefile via -f though.  Some initial testing of tool parameter support is required, but once that's sorted out, further maintenance shouldn't be an issue.
July 27, 2010
On 27 July 2010 20:24, Andrei Alexandrescu <andrei at erdani.com> wrote:
> Walter Bright wrote:
>>
>>
>> Andrei Alexandrescu wrote:
>>>
>>> Hey folks,
>>>
>>>
>>> I was building Phobos on OSX when I ran into a makefile bug that I'd
>>> fixed in linux.mak. It was still present in osx.mak. I noticed the files are
>>> virtually identical, so why not merge them?
>>>
>>> Since the one thing that linux.mak and osx.mak have in common is the fact that they're understood by gnu make (as opposed to win32.mak which is used by Walter's own make utility), I'm thinking the new makefile should be called GNUMakefile. That name is actually understood by gmake which means no more -f.
>>>
>>> I'm operating this change and will check in soon, please let me know if you foresee any issues.
>>>
>>
>> I prefer to keep them separate because:
>>
>> 1. It's very simple for the user to tell which makefile is for what system. With win32.mak and GNUmakefile it's wtf?
>
> It's "Oh, for gnu make I use GNUMakefile".
>
>> 2. While they may be the same now, in the future they may be fairly different.
>
> I prefer to keep things factored together. Again, I am motivated by the heavy current duplication and the fact that I fix bugs in one makefile and then encounter them in the second.
>
> By the way, I compel you to start using cygwin and gmake on Windows so we can unify the three. We should revisit the "I tried cygwin and I don't remember why it didn't work well" status.

Requiring cygwin on Windows would reduce the number of potential
contributors on Windows by 90%.
I reckon we should eventually aim for:
> rdmd druntime
> rdmd phobos
In the long term, I can't see any reason for using make at all.
July 27, 2010
On Jul 27, 2010, at 11:56 AM, Don Clugston wrote:
> On 27 July 2010 20:24, Andrei Alexandrescu <andrei at erdani.com> wrote:
> 
> Requiring cygwin on Windows would reduce the number of potential
> contributors on Windows by 90%.
> I reckon we should eventually aim for:
>> rdmd druntime
>> rdmd phobos
> In the long term, I can't see any reason for using make at all.

Eliminate .c code entirely?  Definitely seems a reasonable goal.

July 28, 2010
On Tue, 2010-07-27 at 20:56 +0200, Don Clugston wrote:
> On 27 July 2010 20:24, Andrei Alexandrescu <andrei at erdani.com> wrote:
> > Walter Bright wrote:
> >>
> >>
> >> Andrei Alexandrescu wrote:
> >>>
> >>> Hey folks,
> >>>
> >>>
> >>> I was building Phobos on OSX when I ran into a makefile bug that I'd
> >>> fixed in linux.mak. It was still present in osx.mak. I noticed the files are
> >>> virtually identical, so why not merge them?
> >>>
> >>> Since the one thing that linux.mak and osx.mak have in common is the fact that they're understood by gnu make (as opposed to win32.mak which is used by Walter's own make utility), I'm thinking the new makefile should be called GNUMakefile. That name is actually understood by gmake which means no more -f.
> >>>
> >>> I'm operating this change and will check in soon, please let me know if you foresee any issues.
> >>>
> >>
> >> I prefer to keep them separate because:
> >>
> >> 1. It's very simple for the user to tell which makefile is for what system. With win32.mak and GNUmakefile it's wtf?
> >
> > It's "Oh, for gnu make I use GNUMakefile".
> >
> >> 2. While they may be the same now, in the future they may be fairly different.
> >
> > I prefer to keep things factored together. Again, I am motivated by the heavy current duplication and the fact that I fix bugs in one makefile and then encounter them in the second.
> >
> > By the way, I compel you to start using cygwin and gmake on Windows so we can unify the three. We should revisit the "I tried cygwin and I don't remember why it didn't work well" status.
> 
> Requiring cygwin on Windows would reduce the number of potential
> contributors on Windows by 90%.
> I reckon we should eventually aim for:
> > rdmd druntime
> > rdmd phobos
> In the long term, I can't see any reason for using make at all.


As an experiment, I recently wrote a D build script for SciD, and I have to say I will probably never write a makefile again in my life.  Phobos has some high-level stuff that made it a quite enjoyable experience -- std.file.dirEntries and std.zip.ZipArchive, just to mention a few.

-Lars