libpayload/lpgcc: Turn references to build dir into a variable

Introduce a `$_OBJ` variable, that points to the build directory for
in-tree usage of `lpgcc`. If unset, the default `../build` relative
to the location of `lpgcc` is used.

Change-Id: I35112d7533d69aa51252dd2bceec010a62522403
Signed-off-by: Nico Huber <nico.h@gmx.de>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/47629
Reviewed-by: Raul Rangel <rrangel@chromium.org>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Nico Huber
2020-11-14 23:13:58 +01:00
parent 1dba2ed806
commit dc5c83812b
2 changed files with 9 additions and 5 deletions

View File

@ -137,7 +137,7 @@ while [ $# -gt 0 ]; do
shift
done
_CFLAGS="$_ARCHEXTRA -nostdinc -nostdlib -I$BASE/../build -I$_INCDIR -I$_ARCHINCDIR -D__LIBPAYLOAD__=1"
_CFLAGS="$_ARCHEXTRA -nostdinc -nostdlib -I$_OBJ -I$_INCDIR -I$_ARCHINCDIR -D__LIBPAYLOAD__=1"
if [ "$CONFIG_LP_PDCURSES" = y ]; then
_CFLAGS="$_CFLAGS -I$BASE/../curses/PDCurses"
@ -167,8 +167,8 @@ else
_LIBGCC=`$DEFAULT_CC $_ARCHEXTRA -print-libgcc-file-name`
if [ -f $_ARCHLIBDIR/head.o ]; then
HEAD_O=$_ARCHLIBDIR/head.o
elif [ -f $BASE/../build/head.o ]; then
HEAD_O=$BASE/../build/head.o
elif [ -f $_OBJ/head.o ]; then
HEAD_O=$_OBJ/head.o
else
echo "Could not find head.o"
exit 1