[Buildroot] [PATCH v10 7/8] package: enable jobserver for recursive make

Fabio Porcedda fabio.porcedda at gmail.com
Fri Dec 20 13:24:40 UTC 2013


On Thu, Dec 19, 2013 at 6:27 PM, Arnout Vandecappelle <arnout at mind.be> wrote:
> On 18/12/13 11:36, Fabio Porcedda wrote:
>>
>> Add '+' prefix to the $($(PKG)_BUILD_CMDS) and $($(PKG)_INSTALL*_CMDS)
>> commands to enable jobserver for the sub-make.
>>
>> Without the '+' prefix GNU make does not detect the sub-make so it
>> disable the jobserver for the sub-make.
>
>
>  $(PKG)_BUILD_CMDS is a multiline define, and the recursive make call may
> not be the first command. Can you check if this still works if the build
> commands are something like:
>
> define FOO_BUILD_CMDS
>         echo "Hello world!"
>         $(MAKE) -C $(@D)
> endef

The following test seems to work fine:

define test
    echo test
    $($(PKG)_BUILD_CMDS)
endef

# Build
$(BUILD_DIR)/%/.stamp_built::
    @$(call step_start,build)
    @$(call MESSAGE,"Building")
    +$(test)
    ...

Test output:
-----
$ make BR2_JLEVEL= -j$((`getconf _NPROCESSORS_ONLN`+1)) -s wget-build
>>> wget 1.14 Building
test
Making all in lib
Making all in src
Making all in doc
Making all in po
Making all in tests
Making all in util
----

If i remove the '+' charter:
----
$ make BR2_JLEVEL= -j$((`getconf _NPROCESSORS_ONLN`+1)) -s wget-build
>>> wget 1.14 Building
test
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent
make rule.
Making all in lib
Making all in src
Making all in doc
Making all in po
Making all in tests
Making all in util
----

Best regards
-- 
Fabio Porcedda



More information about the buildroot mailing list