From 1a397369ffd40a3a5ec6fade9e4bea08cff5c88d Mon Sep 17 00:00:00 2001 From: Maciej Pijanowski Date: Wed, 20 Apr 2022 16:36:01 +0200 Subject: [PATCH] util/ifdtool/Makefile: improve cross-compilation support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Change-Id: Ia8dd67d18392e1e11d9160b187ef1a874d69ff5d Reviewed-on: https://review.coreboot.org/c/coreboot/+/70105 Reviewed-by: Michał Żygowski Tested-by: build bot (Jenkins) --- util/ifdtool/Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util/ifdtool/Makefile b/util/ifdtool/Makefile index 83d19b892e..c0210693d8 100644 --- a/util/ifdtool/Makefile +++ b/util/ifdtool/Makefile @@ -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