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 <quic_eberman@quicinc.com>
This commit is contained in:
Elliot Berman 2021-05-03 11:14:35 -07:00 committed by Matthias Maennich
commit 26a8c2ab13
2 changed files with 6 additions and 0 deletions

View file

@ -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

View file

@ -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