util/ifdtool/Makefile: improve cross-compilation support

INSTALL and PREFIX variables will not be overwritten. Also, mkdir was
replaced by a tool from the INSTALL variable to be compatible with other
cross-compilation buildsystems (like Yocto).

Overwriting variables generates problems when we use different
buildsystem like Yocto where tool names are stored in environment
variables. This change may make building the utility easier - the user
of different buildsystem will not have to remember to pass correct tool
names when issuing the make command.

Also, this change does not affect the rest of users - if the variable
was not set before, then it will be configured as before.

Signed-off-by: Maciej Pijanowski <maciej.pijanowski@3mdeb.com>
Change-Id: Ia8dd67d18392e1e11d9160b187ef1a874d69ff5d
Reviewed-on: https://review.coreboot.org/c/coreboot/+/70105
Reviewed-by: Michał Żygowski <michal.zygowski@3mdeb.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Maciej Pijanowski 2022-04-20 16:36:01 +02:00 committed by Michał Żygowski
parent 9d2902f750
commit 1a397369ff
1 changed files with 4 additions and 4 deletions

View File

@ -2,9 +2,9 @@
#
# SPDX-License-Identifier: GPL-2.0-only
CC ?= gcc
INSTALL = /usr/bin/env install
PREFIX = /usr/local
CC ?= gcc
INSTALL ?= /usr/bin/env install
PREFIX ?= /usr/local
HOSTCC ?= $(CC)
HOSTCFLAGS ?= $(CFLAGS)
@ -21,7 +21,7 @@ clean:
distclean: clean
install: $(PROGRAM)
mkdir -p $(DESTDIR)$(PREFIX)/bin
$(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
$(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/bin
.PHONY: all clean distclean install