From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tuomas Tynkkynen Date: Fri, 23 Mar 2018 18:38:46 +0200 Subject: [U-Boot] Depending on an .o file in other directory in Kbuild? Message-ID: <20180323183846.30bb0cf0@duuni> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Hi, I finally managed to track down the parallel make issue in helloworld.efi: (previous posting at https://www.mail-archive.com/u-boot at lists.denx.de/msg268726.html): make[2]: *** No rule to make target 'lib/efi_loader/helloworld.efi', needed by '__build'. Stop. The problematic make rule seems to be this from scripts/Makefile.lib: $(obj)/%_efi.so: $(obj)/%.o arch/$(ARCH)/lib/$(EFI_CRT0) \ arch/$(ARCH)/lib/$(EFI_RELOC) $(call cmd,efi_ld) So if I understood the recursive make in Kbuild correctly, during the build of the lib/efi_loader/ subdirectory, rules from other makefiles aren't visible (in this case the rules in arch/arm/lib/). That is, the build usually works because arch/arm/lib/ has been built by the time make descends into lib/efi_loader/ and the $(EFI_CRT0) and $(EFI_RELOC) have already been built. But when the order is swapped around due to parallel make, the build fails. I have no idea how this should be done correctly in Kbuild, so if anybody else knows how to fix this, help is appreciated! Thanks, -Tuomas