Samba 4 buildsystem; patch in progress

Jelmer Vernooij jelmer at
Sun Jan 6 13:10:39 GMT 2008

Hi James,

Am Samstag, den 05.01.2008, 23:11 -0800 schrieb James Peach:
> On 05/01/2008, at 5:32 PM, Jelmer Vernooij wrote:
> > After discussing this with various people over the last week, I  
> > decided
> > to try and see how hard it would be to get Samba 4 to use a simple
> > Makefile again.
> >
> > I've now got something partially working, heavily based on the  
> > "include"
> Is "include" portable? According to < 
>  >, BSD make uses ".include".
I tested in in smb-build on the buildfarm a while ago. If it really
 turns out include is problematic, we could always just write a perl
 script that just folds the Makefile for us.

> > and double-colon features in make (portable across all makes we build
> > on, afaik).
> This is a weird one. < 
>  > describes :: in a way that conflicts with your use of it to  
> accumulate target dependencies and rules. However, < 
>  > claims that the accumulation behaviour is a BSD make-ism.
The definition in the FreeBSD manpage doesn't seem to conflict with our
use of it, though it is incomplete (it doesn't mention the fact that
double-colon targets can occur more than once). However, we already
use :: in Samba 4 to accumulate target dependencies, so I'm sure it has
that behaviour. Samba 4 uses if for clean at the moment.

> > So far I've managed to avoid most beartraps; it should work portably
> > across all platforms, doesn't use recursive make, doesn't use libtool
> > and variables and rules don't use a lot of magic.
> I have to say that I don't think a truly portable Makefile is a good  
> idea.
> First, I'm not convinced that the portable subset of make has the  
> features we would want to use in the build.
> Second, even if we narrow the scope to 3 or 4 make implementations, I  
> think there will be a continual support cost from folks building on  
> platforms without these implementation, as well as the likelihood of  
> GNU make-isms constantly leaking in from the 99% of Samba developers  
> who use GNU make exclusively.

> Finally, I think that using the full vocabulary of a single make  
> implementation (particularly GNU make), is too useful to ignore, eg.  
> "$^".

I really wish we could switch to GNU make, too. $^, % rules, += and
per-target variables are really nice features that would allow us to
remove what redundancy we have left in the Makefile.

The problem is that while 99% of the developers may be running GNU
 make, far less than 99% of the build farm hosts run it. Moving to GNU
 make would mean losing some of the more exotic build farm hosts.

> You could include a GNU make download/bootstrap script with installs
> a  
> temporary copy of GNU make automatically if configure doesn't find
> it.  
> Then you could use GNU make features like per-target variables.
> Would  
> this make a GNU make dependency more acceptable?
It's an interesting suggestion, but I'm not sure I want to go there.
It's non-trivial to get right, especially if it has to work out of the
box. I'm also not sure how much I personally would appreciate some app
downloading and building another as part of its build process...

Thanks for your comments.


Jelmer Vernooij <jelmer at> -
Jabber: jelmer at
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 307 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url :

More information about the samba-technical mailing list