Commit 83724941 authored by Julius Werner's avatar Julius Werner Committed by chrome-bot
Browse files

Makefile: Fix default for LIBPAYLOAD_DIR

We're usually passing LIBPAYLOAD_DIR to depthcharge's Makefile, but it's
also possible to omit that parameter and have it default to the location
that libpayload would be in if depthcharge's source is located under

Unfortunately, it looks like that hasn't been working right for a while.
We're trying to source xcompile from libpayload before we're setting
that default, and we're later passing the derived location of lpgcc to
vboot without handling the possibility that LIBPAYLOAD_DIR was a
relative path. This patch resolves both issues. Since LIBPAYLOAD_DIR is
usually not set for the Kconfig pass of the Makefile, move the code down
into the respective ifeq section.

TEST=Build and booted depthcharge for Kevin without emerge.

Change-Id: Icec7262c7a0748944b0862fe7833a617a7ab567c
Signed-off-by: default avatarJulius Werner <>
parent cef1242c
......@@ -54,22 +54,17 @@ HOSTCXX = g++
HOSTCFLAGS := -I$(srck) -I$(objk)
HOSTCXXFLAGS := -I$(srck) -I$(objk)
# libpayload's xcompile script checks for this config flag to decide which
# compiler to use
include $(LIBPAYLOAD_DIR)/libpayload.xcompile
LIBPAYLOAD_DIR ?= ../libpayload/install/libpayload
LZMA := lzma
ifeq ($(strip $(HAVE_DOTCONFIG)),)
all: help
LIBPAYLOAD_DIR ?= ../libpayload/install/libpayload
include $(DOTCONFIG)
include $(LIBPAYLOAD_DIR)/libpayload.config
include $(LIBPAYLOAD_DIR)/libpayload.xcompile
ifeq ($(CONFIG_ARCH_X86),y)
ARCH = x86
......@@ -114,7 +109,7 @@ toolchain := $(new_toolchain_name_$(toolchain))
CC:=$(firstword $(CC_$(toolchain)))
XCC := CC=$(CC) $(LIBPAYLOAD_DIR)/bin/lpgcc
XCC := CC=$(CC) $(abspath $(LIBPAYLOAD_DIR))/bin/lpgcc
AS = $(LIBPAYLOAD_DIR)/bin/lpas
OBJCOPY ?= $(OBJCOPY_$(toolchain))
STRIP ?= $(STRIP_$(toolchain))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment