arch/tile: don't validate CROSS_COMPILE needlessly

With this change, the arch/tile Makefile will only check for a valid
combination of CROSS_COMPILE vs "uname -m" for a few common targets
that are typically the ones we get wrong (vmlinux, all, and modules).
The change handles the case of an empty "make" goal like "make all".

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>

+11 -9
+11 -9
arch/tile/Makefile
··· 8 # for "archclean" and "archdep" for cleaning up and making dependencies for 9 # this architecture 10 11 - ifeq ($(CROSS_COMPILE),) 12 # If building with TILERA_ROOT set (i.e. using the Tilera Multicore 13 # Development Environment) we can set CROSS_COMPILE based on that. 14 - ifdef TILERA_ROOT 15 - CROSS_COMPILE = $(TILERA_ROOT)/bin/tile- 16 - endif 17 - endif 18 - 19 # If we're not cross-compiling, make sure we're on the right architecture. 20 ifeq ($(CROSS_COMPILE),) 21 - HOST_ARCH = $(shell uname -m) 22 - ifneq ($(HOST_ARCH),$(ARCH)) 23 $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH)) 24 - endif 25 endif 26 27
··· 8 # for "archclean" and "archdep" for cleaning up and making dependencies for 9 # this architecture 10 11 # If building with TILERA_ROOT set (i.e. using the Tilera Multicore 12 # Development Environment) we can set CROSS_COMPILE based on that. 13 # If we're not cross-compiling, make sure we're on the right architecture. 14 + # Only bother to test for a few common targets, to avoid useless errors. 15 ifeq ($(CROSS_COMPILE),) 16 + ifdef TILERA_ROOT 17 + CROSS_COMPILE := $(TILERA_ROOT)/bin/tile- 18 + else 19 + goals := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all) 20 + ifneq ($(strip $(filter vmlinux modules all,$(goals))),) 21 + HOST_ARCH := $(shell uname -m) 22 + ifneq ($(HOST_ARCH),$(ARCH)) 23 $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH)) 24 + endif 25 + endif 26 + endif 27 endif 28 29