From 0d018732af3146a0068894ec12aa4ec0a6c4d19f Mon Sep 17 00:00:00 2001 From: Elliot Berman Date: Mon, 3 May 2021 11:14:35 -0700 Subject: [PATCH] ANDROID: Don't add image to all target with KBUILD_MIXED_TREE When KBUILD_MIXED_TREE is set, vmlinux and related images come from an out-of-tree location and vmlinux shouldn't be compiled. arch/arm64 and arch/x86 add the default Images to all target, so remove that default behavior when KBUILD_MIXED_TREE is set. This when an out-of-tree module, e.g. virtual-device, runs "make all" instead of "make modules". Bug: 178469391 Change-Id: I8c43d5d66a8bf6ed27f91df7e173399d4f4a23c0 Signed-off-by: Elliot Berman --- arch/arm64/Makefile | 3 +++ arch/x86/Makefile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/arch/arm64/Makefile b/arch/arm64/Makefile index b52481f0605d..6bd79de8a78d 100644 --- a/arch/arm64/Makefile +++ b/arch/arm64/Makefile @@ -157,7 +157,10 @@ libs-$(CONFIG_EFI_STUB) += $(objtree)/drivers/firmware/efi/libstub/lib.a boot := arch/arm64/boot KBUILD_IMAGE := $(boot)/Image.gz +# Don't compile Image in mixed build with "all" target +ifndef KBUILD_MIXED_TREE all: Image.gz +endif Image: vmlinux diff --git a/arch/x86/Makefile b/arch/x86/Makefile index c77c5d8a7b3e..b200cefea177 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -260,8 +260,11 @@ BOOT_TARGETS = bzdisk fdimage fdimage144 fdimage288 isoimage PHONY += bzImage $(BOOT_TARGETS) +# Don't compile Image in mixed build with "all" target +ifndef KBUILD_MIXED_TREE # Default kernel to build all: bzImage +endif # KBUILD_IMAGE specify target image being built KBUILD_IMAGE := $(boot)/bzImage