make samba3 make -j proof

Björn JACKE bjoern at j3e.de
Wed Oct 11 08:22:07 GMT 2006


On 2006-10-10 at 20:24 +0000 Jelmer Vernooij sent off:
>On Tue, 2006-10-10 at 21:30 +0200, Björn JACKE wrote:
>> sitting in a train today waiting for a samba compile I thought it 
>> might be quite a bit faster if it would be compilable parallelized. I 
>> saw that the changes neccessary in the Makefile to make this work are 
>> not very big. See attached patch. I tested the Makefile with make -j20 
>> without a problem. On a dual core machine the build is in fact twice 
>> as fast now with make -j2.
>> 
>> I needed to replace the suffix rule in the makefile with a implicit 
>> pattern rule to be able to add dependencies to each resulting target. 
>> VERY ancient make versions might not cope with that but all machines 
>> that can cope with samba4's makefiles can cope with this, too. So I 
>> thing there's nothing to worry about.
>Using '%' is going to break on /a lot/ of platforms. We don't use it in
>Samba4 - I think it only works with GNU make.

the following is from Samba4; I strongly guess that make implementations which
cope with

DEP_FILES = $(patsubst %.ho,%.hd,$(patsubst %.o,%.d,$(ALL_OBJS))) \
                   include/includes.d

will also work with my patch. We might want to check this in to see how it
works - we can revert it anyway if it doesn't.

Cheers
Bjoern
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.samba.org/archive/samba-technical/attachments/20061011/ce7469b0/attachment.bin


More information about the samba-technical mailing list