From 1ea6bcd8590b3ff9fe2bfbb0eb29a3b0edaa9460 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sun, 14 Jun 2009 23:33:14 -0400 Subject: push CROSS_COMPILE out to $(ARCH)_config.mk Each arch should handle setting a proper default CROSS_COMPILE value in their own config.mk file rather than having to maintain a large ugly list in the Makefile. By using conditional assignment, we don't have to worry about the variable already being set (env/cmdline/etc...). The common config.mk file takes care of exporting CROSS_COMPILE already, and while a few variables (toolchain ones) utilize CROSS_COMPILE before including the arch config.mk, they do so with deferred assignment. Signed-off-by: Mike Frysinger --- Makefile | 44 ++------------------------------------------ 1 file changed, 2 insertions(+), 42 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 1eb3177..4fe3232 100644 --- a/Makefile +++ b/Makefile @@ -151,50 +151,10 @@ ifeq ($(obj)include/config.mk,$(wildcard $(obj)include/config.mk)) include $(obj)include/config.mk export ARCH CPU BOARD VENDOR SOC -ifndef CROSS_COMPILE +# set default to nothing for native builds ifeq ($(HOSTARCH),$(ARCH)) -CROSS_COMPILE = -else -ifeq ($(ARCH),ppc) -CROSS_COMPILE = ppc_8xx- -endif -ifeq ($(ARCH),arm) -CROSS_COMPILE = arm-linux- -endif -ifeq ($(ARCH),i386) -CROSS_COMPILE = i386-linux- -endif -ifeq ($(ARCH),mips) -CROSS_COMPILE = mips_4KC- -endif -ifeq ($(ARCH),nios) -CROSS_COMPILE = nios-elf- -endif -ifeq ($(ARCH),nios2) -CROSS_COMPILE = nios2-elf- +CROSS_COMPILE ?= endif -ifeq ($(ARCH),m68k) -CROSS_COMPILE = m68k-elf- -endif -ifeq ($(ARCH),microblaze) -CROSS_COMPILE = mb- -endif -ifeq ($(ARCH),blackfin) -CROSS_COMPILE = bfin-uclinux- -endif -ifeq ($(ARCH),avr32) -CROSS_COMPILE = avr32-linux- -endif -ifeq ($(ARCH),sh) -CROSS_COMPILE = sh4-linux- -endif -ifeq ($(ARCH),sparc) -CROSS_COMPILE = sparc-elf- -endif # sparc -endif # HOSTARCH,ARCH -endif # CROSS_COMPILE - -export CROSS_COMPILE # load other configuration include $(TOPDIR)/config.mk -- cgit v1.1