From 26a8c2ab133470ce1297e9752d1c9ba7a4be5f40 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 90309208bb28..07c5e0fc006f 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 db77a8e47470..8427cf6d2404 100644 --- a/arch/x86/Makefile +++ b/arch/x86/Makefile @@ -262,8 +262,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