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