Ubuntu – How to run parallel make with debuild

compilingdebdebuildmakepackaging

I am trying to make a package of a piece of software that I've (co-) written. I'm using

debuild -i -us -uc -b 

And in principle that works fine. In order to shorten compilation time I'd like to debuild to run make in parallel (like I normally do by running make -j4, for example).
I've found a few locations on the web that suggest the following:

debuild -eDEB_BUILD_OPTIONS="parallel=4" -us -uc -b
debuild -j4 -us -uc -b

Another site suggested to add some code to the debian/rules file that basically sets

MAKEFLAGS += -j4

However, none of these seems to work. Have I missed something? or should I change something in the autoconf/automake settings of the source?

Best Answer

It has to be enabled in debian/rules. If the package uses dh, there is a line like this in debian/rules:

dh $@

Change that to

dh $@ --parallel

Then your commands will work, at least DEB_BUILD_OPTIONS="parallel=4"

Related Question