Re: make -j in Debian packages
Scripsit Lars Wirzenius <firstname.lastname@example.org>
> If package maintainer wants to build it faster on their own machine, I
> would imagine that checking for an environment variable (DEB_MAKE_OPTS
> or something, perhaps?) and using that would be the way to go. By
> default, build with a single processor.
If I understand the problem correctly, it is not even necessary to
modify debian/rules to get this behavior. If the interdependencies
are properly declared,
$ debian/rules -j42 binary
should do the trick, as GNU make is smart enough to pass the option
down to sub-makes that it starts.
Then all one has to do is to create and submit a patch for
dpkg-buildpackage that lets it specify this flag on invocation.
Well, in fact also design a mechanism to share knowledge about which
source packages may break if given a -j due to insufficiently
specified dependencies. So perhaps using $(DEB_MAKE_J_OPTION) on the
"$(MAKE) all" line in debian/rules is a better choice after all.
(In any case there is no need to check specifically whether it exists
before using it - if it doesn't, make will silently expand it to
Henning Makholm "And why should I talk slaves' and fools' talk? I
don't want him to live for ever, and I know that he's
not going to live for ever whether I want him to or not."