summaryrefslogtreecommitdiff
path: root/extra
diff options
context:
space:
mode:
authorVadim Bendebury <vbendeb@chromium.org>2016-06-16 13:40:31 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-06-16 18:52:35 -0700
commit0433548ac8300100ac1f2aa69d90e1bb374d1a25 (patch)
tree89aa5a06f5ef53448505d47c2749afb6e008fd5c /extra
parent3b19c46c314fe003fc476701a6909921bcdd0871 (diff)
downloadchrome-ec-0433548ac8300100ac1f2aa69d90e1bb374d1a25.tar.gz
usb_updater: allow to define target environment
It is necessary to be able to build usb_updater for both host and board environments. When building for board environments the appropriate compiler and binutils are defined in the environment. Allow the environment definitions to take precedence over local definitions. BUG=none TEST=inside and outside chroot: . ran 'make clean; make; verified that command can be run on the host. inside chroot: . ran 'emerge-kevin ec-utils' and verified using the 'file' utility that the executable in /build/kevin/usr/sbin/usb_updater is built for arm Change-Id: If2ac4a4e7f7ece188eba5ff917a510363c6d1990 Signed-off-by: Vadim Bendebury <vbendeb@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/353165 Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'extra')
-rw-r--r--extra/usb_updater/Makefile8
1 files changed, 5 insertions, 3 deletions
diff --git a/extra/usb_updater/Makefile b/extra/usb_updater/Makefile
index b4c208f4af..2173e464d9 100644
--- a/extra/usb_updater/Makefile
+++ b/extra/usb_updater/Makefile
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+CC ?= gcc
+PKG_CONFIG ?= pkg-config
PROGRAM := usb_updater
SOURCE := $(PROGRAM).c
LIBS :=
@@ -22,15 +24,15 @@ CFLAGS := -std=gnu99 \
#
# Add libusb-1.0 required flags
#
-LIBS += $(shell pkg-config --libs libusb-1.0) -lcrypto
-CFLAGS += $(shell pkg-config --cflags libusb-1.0)
+LIBS += $(shell $(PKG_CONFIG) --libs libusb-1.0 libcrypto)
+CFLAGS += $(shell $(PKG_CONFIG) --cflags libusb-1.0 libcrypto)
# NOTE: This may be board-specific
BOARD ?= cr50
CFLAGS += -I../../include -I../../board/$(BOARD) -I ../../chip/g -I../../util
$(PROGRAM): $(SOURCE) Makefile
- gcc $(CFLAGS) $(SOURCE) $(LFLAGS) $(LIBS) -o $@
+ $(CC) $(CFLAGS) $(SOURCE) $(LFLAGS) $(LIBS) -o $@
.PHONY: clean