diff mbox

Makefile: Support CROSS_COMPILE as well as CROSS

Message ID 1418604800-12587-1-git-send-email-mpe@ellerman.id.au
State Accepted
Headers show

Commit Message

Michael Ellerman Dec. 15, 2014, 12:53 a.m. UTC
A lot of projects use CROSS_COMPILE for specifying the cross compile
prefix, so support that as well as CROSS.

For example this allows a user to set CROSS_COMPILE once in their
environment and build both Linux & Skiboot with the same setting.

Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
---
 Makefile | 1 +
 1 file changed, 1 insertion(+)

Comments

Stewart Smith Dec. 15, 2014, 1:38 a.m. UTC | #1
Michael Ellerman <mpe@ellerman.id.au> writes:
> A lot of projects use CROSS_COMPILE for specifying the cross compile
> prefix, so support that as well as CROSS.
>
> For example this allows a user to set CROSS_COMPILE once in their
> environment and build both Linux & Skiboot with the same setting.

Merged slightly modified version that only set CROSS if CROSS_COMPILE
was defined (otherwise we'd set CROSS to empty and the logic below
wouldn't end up setting CROSS thus leading to failed builds if you're
lazy like me and let the auto foo there set CROSS for you)

> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
> ---
>  Makefile | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/Makefile b/Makefile
> index 96c387f0bd4f..ec82317ec005 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -6,6 +6,7 @@
>  # Example: CROSS= powerpc64-unknown-linux-gnu-
>  #
>  ARCH = $(shell uname -m)
> +CROSS ?= $(CROSS_COMPILE)
>  ifeq ("$(ARCH)", "ppc64")
>  	CROSS ?=
>  else
> -- 
> 2.1.0
>
> _______________________________________________
> Skiboot mailing list
> Skiboot@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/skiboot
diff mbox

Patch

diff --git a/Makefile b/Makefile
index 96c387f0bd4f..ec82317ec005 100644
--- a/Makefile
+++ b/Makefile
@@ -6,6 +6,7 @@ 
 # Example: CROSS= powerpc64-unknown-linux-gnu-
 #
 ARCH = $(shell uname -m)
+CROSS ?= $(CROSS_COMPILE)
 ifeq ("$(ARCH)", "ppc64")
 	CROSS ?=
 else