diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc index 538309a14f..c511e12855 100644 --- a/payloads/libpayload/Makefile.inc +++ b/payloads/libpayload/Makefile.inc @@ -28,6 +28,13 @@ ## SUCH DAMAGE. ## +ifneq ($(NOCOMPILE),1) +GIT:=$(shell git -C "$(top)" rev-parse --git-dir 1>/dev/null 2>&1 \ + && command -v git) +else +GIT:= +endif + export KERNELVERSION := 0.2.0 ARCHDIR-$(CONFIG_LP_ARCH_ARM) := arm @@ -76,6 +83,10 @@ ifeq ($(CONFIG_LP_LTO),y) CFLAGS += -flto endif +# Some of the commonlib cbfs headers include vboot headers, so initialize the +# submodule in case we are building a payload outside the main coreboot build +forgetthis:=$(if $(GIT),$(shell git submodule update --init ../../3rdparty/vboot $(quiet_errors))) + $(obj)/libpayload.config: $(DOTCONFIG) cp $< $@