summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-01-14 12:37:15 -0800
committerChromeBot <chrome-bot@google.com>2013-01-14 13:51:28 -0800
commit826db09fcec194951e1dc71002d6a92620fbb46b (patch)
treeb094f55a53c943a1b12f6dc4d5196ed105ffefd8
parentacb2ee977b8dd139b01b68d0e269ea6bcc425c2b (diff)
downloadvboot-826db09fcec194951e1dc71002d6a92620fbb46b.tar.gz
Use 'install' to do installation, prepare for futility installation.
Previously we've been using manual cp and chmod operations to implement "make install". This switches to using the install utility instead, which can handle permissions and so forth. This also tweaks the DESTDIR slightly to prepare the way for futility. BUG=chromium-os:26317 BRANCH=none TEST=manual Run sudo emerge vboot_reference Shouldn't see any difference. Change-Id: I667ddbb9de3ab7713921ddd734d1fbcbe3b936b1 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/41228 Reviewed-by: Randall Spangler <rspangler@chromium.org>
-rw-r--r--Makefile19
1 files changed, 11 insertions, 8 deletions
diff --git a/Makefile b/Makefile
index 1086f83c..04d11b20 100644
--- a/Makefile
+++ b/Makefile
@@ -15,6 +15,7 @@ BUILD ?= $(shell pwd)/build
# Target for 'make install'
DESTDIR ?= /usr/bin
+INSTALL ?= install
# Provide default CC and CFLAGS for firmware builds; if you have any -D flags,
# please add them after this point (e.g., -DVBOOT_DEBUG).
@@ -377,11 +378,13 @@ $(CGPT): $(CGPT_OBJS) $$(LIBS)
@printf " LDcgpt $(subst $(BUILD)/,,$(@))\n"
$(Q)$(LD) -o $(CGPT) $(CFLAGS) $(LDFLAGS) $^ $(LIBS) $(LDLIBS)
+C_DESTDIR = $(DESTDIR)
+
.PHONY: cgpt_install
cgpt_install: $(CGPT)
- mkdir -p $(DESTDIR)
- cp -f $^ $(DESTDIR)
- chmod a+rx $(patsubst ${BUILD}/cgpt/%,$(DESTDIR)/%,$^)
+ @printf " INSTALL CGPT\n"
+ ${Q}mkdir -p $(C_DESTDIR)
+ ${Q}$(INSTALL) -t $(C_DESTDIR) $^
# -----------------------------------------------------------------------------
# Utilities
@@ -444,13 +447,13 @@ utils: $(UTIL_BINS) $(UTIL_SCRIPTS)
$(Q)cp -f $(UTIL_SCRIPTS) $(BUILD)/utility
$(Q)chmod a+rx $(patsubst %,$(BUILD)/%,$(UTIL_SCRIPTS))
+U_DESTDIR = $(DESTDIR)
+
.PHONY: utils_install
utils_install: $(UTIL_BINS) $(UTIL_SCRIPTS)
- mkdir -p $(DESTDIR)
- cp -f $(UTIL_BINS) $(DESTDIR)
- chmod a+rx $(patsubst %,$(DESTDIR)/%,$(UTIL_NAMES))
- cp -f $(UTIL_SCRIPTS) $(DESTDIR)
- chmod a+rx $(patsubst utility/%,$(DESTDIR)/%,$(UTIL_SCRIPTS))
+ @printf " INSTALL UTILS\n"
+ ${Q}mkdir -p $(U_DESTDIR)
+ ${Q}$(INSTALL) -t $(U_DESTDIR) $^
${BUILD}/utility/dump_kernel_config: LIBS += $(DUMPKERNELCONFIGLIB)