BACKPORT: arm64: makefile fix build of .i file in external module case

commit 98356eb0ae499c63e78073ccedd9a5fc5c563288 upstream.

After 'a66649dab350 arm64: fix vdso-offsets.h dependency' if
one will try to build .i file in case of external kernel module,
build fails complaining that prepare0 target is missing. This
issue came up with SystemTap when it tries to build variety
of .i files for its own generated kernel modules trying to
figure given kernel features/capabilities.

The issue is that prepare0 is defined in top level Makefile
only if KBUILD_EXTMOD is not defined. .i file rule depends
on prepare and in case KBUILD_EXTMOD defined top level Makefile
contains empty rule for prepare. But after mentioned commit
arch/arm64/Makefile would introduce dependency on prepare0
through its own prepare target.

Fix it to put proper ifdef KBUILD_EXTMOD around code introduced
by mentioned commit. It matches what top level Makefile does.

Acked-by: Kevin Brodsky <[email protected]>
Signed-off-by: Victor Kamensky <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>

[nd: a66649dab350 landed in v4.8-rc1 but was backported to wahoo in
     go/pag/784068. This fixup landed in v4.20-rc1 and was backported to
     4.9 LTS.]

Bug: 158033188
Signed-off-by: Nathan Chancellor <[email protected]>
Signed-off-by: Nick Desaulniers <[email protected]>
Change-Id: I7091f9cff4d00287ec1ff042ab44ee8e07d5bca9
1 file changed