Bug#740397: busybox: please add support for parallel building
On Sat, 2014-03-01 at 04:01 +0100, Cyril Brulebois wrote:
> Ian Campbell <ijc@hellion.org.uk> (2014-03-01):
> > On Sat, 2014-03-01 at 03:17 +0100, Cyril Brulebois wrote:
> > > - $(MAKE) -C ${DIR} install docs/busybox.1 \
> > > + $(MAKE) -j$(NUMJOBS) -C ${DIR} install docs/busybox.1 \
> >
> > If parallel build is not set then won't this end up passing a bare "-j"
> > which will run an unlimited number of jobs...
> >
> > https://www.debian.org/doc/debian-policy/ch-source.html suggests:
> >
> > ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
> > NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
> > MAKEFLAGS += -j$(NUMJOBS)
> > endif
> >
> > to avoid this.
>
> Well I didn't want to set MAKEFLAGS unconditionally (not sure how other
> $(MAKE) calls deal with parallelism), so I've written crap instead; oops
> thanks for catching. If following policy's suggestion isn't possible, we
> could add "else\nNUMJOBS = 1" to avoid what you spotted.
If you are worried about changing MAKEFLAGS then I would suggest setting
you own var including the -j too, e.g. J_FLAG=-j$(NUMOBJS), and using it
where it is needed.
Ian.
Reply to: