Tim Crawford has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/60540 )
Change subject: util: Allow overriding install options ......................................................................
util: Allow overriding install options
Modify util Makefiles to allow:
- overriding the install prefix - installing to a build root by specifying DESTDIR
Change-Id: I3a31ea0fde9922731e1621dcc8f94b2c1326c93c Signed-off-by: Tim Crawford tcrawford@system76.com --- M util/ectool/Makefile M util/ifdtool/Makefile M util/nvramtool/Makefile M util/pmh7tool/Makefile M util/spkmodem_recv/Makefile 5 files changed, 10 insertions(+), 7 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/40/60540/1
diff --git a/util/ectool/Makefile b/util/ectool/Makefile index 1ef74d2..5ea8240 100644 --- a/util/ectool/Makefile +++ b/util/ectool/Makefile @@ -5,7 +5,7 @@ CFLAGS = -O2 -Wall -Wextra -Wshadow $(WERROR) PROGRAM = ectool INSTALL = /usr/bin/env install -PREFIX = /usr/local +PREFIX ?= /usr/local OS_ARCH = $(shell uname)
ifeq ($(shell uname -o 2>/dev/null), Cygwin) @@ -22,7 +22,8 @@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
install: $(PROGRAM) - $(INSTALL) $(PROGRAM) $(PREFIX)/sbin + $(INSTALL) -d $(DESTDIR)$(PREFIX)/sbin + $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
clean: rm -f *.o $(PROGRAM) junit.xml diff --git a/util/ifdtool/Makefile b/util/ifdtool/Makefile index 83d19b8..cce68dd 100644 --- a/util/ifdtool/Makefile +++ b/util/ifdtool/Makefile @@ -4,7 +4,7 @@
CC ?= gcc INSTALL = /usr/bin/env install -PREFIX = /usr/local +PREFIX ?= /usr/local
HOSTCC ?= $(CC) HOSTCFLAGS ?= $(CFLAGS) diff --git a/util/nvramtool/Makefile b/util/nvramtool/Makefile index 0d7f687..35698ce 100644 --- a/util/nvramtool/Makefile +++ b/util/nvramtool/Makefile @@ -10,7 +10,7 @@
CC ?= gcc INSTALL = /usr/bin/env install -PREFIX = /usr/local +PREFIX ?= /usr/local CFLAGS = -O2 -g -Wall -Wextra -Wmissing-prototypes -I. -DCMOS_HAL=1 #CFLAGS = -Os -Wall
diff --git a/util/pmh7tool/Makefile b/util/pmh7tool/Makefile index 9b3921a..a2763cd 100644 --- a/util/pmh7tool/Makefile +++ b/util/pmh7tool/Makefile @@ -4,7 +4,7 @@ CFLAGS = -O2 -Wall -Wextra -Werror PROGRAM = pmh7tool INSTALL = /usr/bin/env install -PREFIX = /usr/local +PREFIX ?= /usr/local
all: $(PROGRAM)
@@ -12,7 +12,8 @@ $(CC) $(CFLAGS) -o $@ $^ $(LDFLAGS)
install: $(PROGRAM) - $(INSTALL) $(PROGRAM) $(PREFIX)/sbin + $(INSTALL) -d $(DESTDIR)$(PREFIX)/sbin + $(INSTALL) $(PROGRAM) $(DESTDIR)$(PREFIX)/sbin
clean: rm -f *.o $(PROGRAM) diff --git a/util/spkmodem_recv/Makefile b/util/spkmodem_recv/Makefile index c9659b4..92a3bfe 100644 --- a/util/spkmodem_recv/Makefile +++ b/util/spkmodem_recv/Makefile @@ -5,4 +5,5 @@ spkmodem-recv: $(CC) -o $@ $@.c install: spkmodem-recv - $(INSTALL) $< -t $(PREFIX)/bin/ + $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin/ + $(INSTALL) $< -t $(DESTDIR)$(PREFIX)/bin/