lib/Makefile.inc: Add cbfs header pointer on !BOOTBLOCK_IN_CBFS

On some x86 targets it the bootblock is loaded via a different
mechanism, like via the AMD PSP or Intel IFWI. Some payloads need that
pointer so add it to cbfs.

Note that on Intel APL this file is not used, which is why the
bootblock still needs to contain the pointer in the ARCH_X86 part.
It is not worth it to add logic to specifically deal with APL as this is
a legacy feature anyway.

For AMD non-car platform this fixes cbfs access in SeaBIOS.

Change-Id: If46e80e3eed5cc3f59964ac58e507f927fc563c4
Signed-off-by: Arthur Heymans <arthur@aheymans.xyz>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/64483
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Felix Held <felix-coreboot@felixheld.de>
diff --git a/src/lib/Makefile.inc b/src/lib/Makefile.inc
index 57b0c7a..505dc46 100644
--- a/src/lib/Makefile.inc
+++ b/src/lib/Makefile.inc
@@ -402,9 +402,18 @@
 ifeq ($(CONFIG_ARCH_X86),y)
 $(call src-to-obj,bootblock,$(dir)/master_header_pointer.c): $(obj)/fmap_config.h
 bootblock-y += master_header_pointer.c
-else
-cbfs-files-y += header_pointer
+endif
+
+NEED_CBFS_POINTER=
+
+ifneq ($(CONFIG_ARCH_X86),y)
+NEED_CBFS_POINTER=y
+endif
+ifneq ($(CONFIG_BOOTBLOCK_IN_CBFS),y)
+NEED_CBFS_POINTER=y
+endif
+
+cbfs-files-$(NEED_CBFS_POINTER) += header_pointer
 header_pointer-file := master_header_pointer.c:struct
 header_pointer-position := -4
 header_pointer-type := "cbfs header"
-endif