• Jonathan Neuschäfer's avatar
    Makefile.inc: Avoid race condition when using 'make -j<N>' · d2c02420
    Jonathan Neuschäfer authored
    When building coreboot from scratch with 'make -j4', I sometimes see
    this error:
    
        CREATE     build/mainboard/emulation/qemu-riscv/cbfs-file.wblRgZ.out (from /.../coreboot/.config)
        HOSTCC     cbfstool/cbfstool (link)
    make[1]: execvp: build/util/kconfig/conf: Permission denied
    make[1]: *** [/.../coreboot/util/kconfig/Makefile:92: savedefconfig] Error 127
    
    It happens, I think, because the rule generated by
    cbfs-files-processor-defconfig runs 'make savedefconfig', which builds
    build/util/kconfig/conf, and something also builds it, at the same time.
    Fix this case, by making this rule depend on $(objutil)/kconfig/conf.
    
    The same fix is also precautiously applied to the rule for
    $(KCONFIG_AUTOHEADER) in Makefile.
    
    Change-Id: Ie93eda567f88ca08c97df7e70cdff5b07442747d
    Signed-off-by: default avatarJonathan Neuschäfer <j.neuschaefer@gmx.net>
    Reviewed-on: https://review.coreboot.org/c/29984Tested-by: default avatarbuild bot (Jenkins) <no-reply@coreboot.org>
    Reviewed-by: default avatarNico Huber <nico.h@gmx.de>
    d2c02420