From 54ed5f675621debcd72e7d70e1ecfc348f5cfe6f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Andr=C3=A9e?= Date: Mon, 4 Jul 2016 13:38:47 +0200 Subject: [PATCH] Work around a bug in cargo MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index f7c3f8d..d7b560b 100644 --- a/Makefile +++ b/Makefile @@ -4,13 +4,21 @@ BUILD = target/release/exa $(BUILD): @which rustc > /dev/null || { echo "exa requires Rust to compile. For installation instructions, please visit http://rust-lang.org/"; exit 1; } - cargo build --release + if test -n "$$(echo "$$CC" | cut -d \ -f 1)"; then \ + env CC="$$(echo "$$CC" | cut -d \ -f 1)" cargo build --release; \ + else\ + env -u CC cargo build --release; \ + fi build: $(BUILD) build-no-git: @which rustc > /dev/null || { echo "exa requires Rust to compile. For installation instructions, please visit http://rust-lang.org/"; exit 1; } - cargo build --release --no-default-features + if test -n "$$(echo "$$CC" | cut -d \ -f 1)"; then \ + env CC="$$(echo "$$CC" | cut -d \ -f 1)" cargo build --release --no-default-features; \ + else\ + env -u CC cargo build --release --no-default-features; \ + fi INSTALL = $(PREFIX)/bin/exa