U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Masahiro Yamada <yamada.m@jp.panasonic.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] kbuild: fix CROSS_COMPILE settings in config.mk
Date: Fri, 28 Feb 2014 14:33:30 +0900	[thread overview]
Message-ID: <1393565610-11716-1-git-send-email-yamada.m@jp.panasonic.com> (raw)

The syntax
  CROSS_COMIPLE ?= <cross_compiler_prefix>
does not work because config.mk is parsed after
exporting CROSS_COMPILE.

Like Linux Kernel's arch/$(ARCH)/Makefile,
we must write as follows:

  ifeq ($(CROSS_COMPILE),)
  CROSS_COMPILE := <cross_compiler_prefix>
  endif

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
---
 arch/arc/config.mk        | 8 ++++++--
 arch/arm/config.mk        | 4 +++-
 arch/avr32/config.mk      | 5 ++++-
 arch/blackfin/config.mk   | 4 +++-
 arch/m68k/config.mk       | 4 +++-
 arch/microblaze/config.mk | 4 +++-
 arch/mips/config.mk       | 4 +++-
 arch/nds32/config.mk      | 4 +++-
 arch/nios2/config.mk      | 4 +++-
 arch/openrisc/config.mk   | 4 +++-
 arch/powerpc/config.mk    | 4 +++-
 arch/sh/config.mk         | 4 +++-
 arch/sparc/config.mk      | 4 +++-
 13 files changed, 43 insertions(+), 14 deletions(-)

diff --git a/arch/arc/config.mk b/arch/arc/config.mk
index 76f4f7c..d9f5d9d 100644
--- a/arch/arc/config.mk
+++ b/arch/arc/config.mk
@@ -9,14 +9,18 @@ CONFIG_SYS_LITTLE_ENDIAN = 1
 endif
 
 ifdef CONFIG_SYS_LITTLE_ENDIAN
-CROSS_COMPILE ?= arc-buildroot-linux-uclibc-
+ARC_CROSS_COMPILE := arc-buildroot-linux-uclibc-
 endif
 
 ifdef CONFIG_SYS_BIG_ENDIAN
-CROSS_COMPILE ?= arceb-buildroot-linux-uclibc-
+ARC_CROSS_COMPILE := arceb-buildroot-linux-uclibc-
 PLATFORM_LDFLAGS += -EB
 endif
 
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := $(ARC_CROSS_COMPILE)
+endif
+
 PLATFORM_CPPFLAGS += -ffixed-r25 -D__ARC__ -DCONFIG_ARC -gdwarf-2
 
 LDSCRIPT := $(SRCTREE)/$(CPUDIR)/u-boot.lds
diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 1db80be..792cb43 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= arm-linux-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := arm-linux-
+endif
 
 ifndef CONFIG_STANDALONE_LOAD_ADDR
 ifneq ($(CONFIG_OMAP_COMMON),)
diff --git a/arch/avr32/config.mk b/arch/avr32/config.mk
index b9b9631..28a371c 100644
--- a/arch/avr32/config.mk
+++ b/arch/avr32/config.mk
@@ -5,7 +5,10 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= avr32-linux-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := avr32-linux-
+endif
+
 PLATFORM_CPPFLAGS += -DCONFIG_AVR32
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x00000000
 
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index 8510e1c..fcaa44f 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= bfin-uclinux-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := bfin-uclinux-
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x1000 -m elf32bfin
 
diff --git a/arch/m68k/config.mk b/arch/m68k/config.mk
index 79ae298..33b3d51 100644
--- a/arch/m68k/config.mk
+++ b/arch/m68k/config.mk
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= m68k-elf-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := m68k-elf-
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x20000
 
diff --git a/arch/microblaze/config.mk b/arch/microblaze/config.mk
index fc545a9..cdb321a 100644
--- a/arch/microblaze/config.mk
+++ b/arch/microblaze/config.mk
@@ -8,7 +8,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= mb-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := mb-
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x80F00000
 
diff --git a/arch/mips/config.mk b/arch/mips/config.mk
index 2abdebb..1899f51 100644
--- a/arch/mips/config.mk
+++ b/arch/mips/config.mk
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= mips_4KC-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := mips_4KC-
+endif
 
 # Handle special prefix in ELDK 4.0 toolchain
 ifneq (,$(findstring 4KCle,$(CROSS_COMPILE)))
diff --git a/arch/nds32/config.mk b/arch/nds32/config.mk
index d0434a9..1024852 100644
--- a/arch/nds32/config.mk
+++ b/arch/nds32/config.mk
@@ -8,7 +8,9 @@
 #
 # SPDX-License-Identifier:	GPL-2.0+
 
-CROSS_COMPILE ?= nds32le-linux-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := nds32le-linux-
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR = 0x300000 \
 			      -T $(srctree)/examples/standalone/nds32.lds
diff --git a/arch/nios2/config.mk b/arch/nios2/config.mk
index 7d546ef..65a5a40 100644
--- a/arch/nios2/config.mk
+++ b/arch/nios2/config.mk
@@ -6,7 +6,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= nios2-elf-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := nios2-elf-
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x02000000
 
diff --git a/arch/openrisc/config.mk b/arch/openrisc/config.mk
index 13015eb..981edff 100644
--- a/arch/openrisc/config.mk
+++ b/arch/openrisc/config.mk
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= or32-elf-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := or32-elf-
+endif
 
 # r10 used for global object pointer, already set in OR32 GCC but just to be
 # clear
diff --git a/arch/powerpc/config.mk b/arch/powerpc/config.mk
index f75c3bf..e398f97 100644
--- a/arch/powerpc/config.mk
+++ b/arch/powerpc/config.mk
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= ppc_8xx-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := ppc_8xx-
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x40000
 LDFLAGS_FINAL += --gc-sections
diff --git a/arch/sh/config.mk b/arch/sh/config.mk
index eefcbcd..0578fa3 100644
--- a/arch/sh/config.mk
+++ b/arch/sh/config.mk
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= sh4-linux-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := sh4-linux-
+endif
 
 CONFIG_STANDALONE_LOAD_ADDR ?= 0x8C000000
 ifeq ($(CPU),sh2)
diff --git a/arch/sparc/config.mk b/arch/sparc/config.mk
index 7daf4ef..be59f58 100644
--- a/arch/sparc/config.mk
+++ b/arch/sparc/config.mk
@@ -5,7 +5,9 @@
 # SPDX-License-Identifier:	GPL-2.0+
 #
 
-CROSS_COMPILE ?= sparc-elf-
+ifeq ($(CROSS_COMPILE),)
+CROSS_COMPILE := sparc-elf-
+endif
 
 gcclibdir := $(shell dirname `$(CC) -print-libgcc-file-name`)
 
-- 
1.8.3.2

             reply	other threads:[~2014-02-28  5:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-28  5:33 Masahiro Yamada [this message]
2014-03-04 19:18 ` [U-Boot] kbuild: fix CROSS_COMPILE settings in config.mk Tom Rini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1393565610-11716-1-git-send-email-yamada.m@jp.panasonic.com \
    --to=yamada.m@jp.panasonic.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox