diff options
| author | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-15 15:01:45 -0400 |
|---|---|---|
| committer | Chris Metcalf <cmetcalf@tilera.com> | 2010-08-15 16:14:07 -0400 |
| commit | a5854dd7f30c3849edf9b9711362e2dd51d3f855 (patch) | |
| tree | e4e84e168eab39fa7e8bdd943447ea241ce6979a | |
| parent | 3b3c1b9d04db2ac925818c3cff677f5353c0b559 (diff) | |
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>
| -rw-r--r-- | arch/tile/Makefile | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/arch/tile/Makefile b/arch/tile/Makefile index 07c4318c0629..fd8f6bb5face 100644 --- a/arch/tile/Makefile +++ b/arch/tile/Makefile | |||
| @@ -8,20 +8,22 @@ | |||
| 8 | # for "archclean" and "archdep" for cleaning up and making dependencies for | 8 | # for "archclean" and "archdep" for cleaning up and making dependencies for |
| 9 | # this architecture | 9 | # this architecture |
| 10 | 10 | ||
| 11 | ifeq ($(CROSS_COMPILE),) | ||
| 12 | # If building with TILERA_ROOT set (i.e. using the Tilera Multicore | 11 | # If building with TILERA_ROOT set (i.e. using the Tilera Multicore |
| 13 | # Development Environment) we can set CROSS_COMPILE based on that. | 12 | # 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. | 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. | ||
| 20 | ifeq ($(CROSS_COMPILE),) | 15 | ifeq ($(CROSS_COMPILE),) |
| 21 | HOST_ARCH = $(shell uname -m) | 16 | ifdef TILERA_ROOT |
| 22 | ifneq ($(HOST_ARCH),$(ARCH)) | 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)) | 23 | $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH)) |
| 24 | endif | 24 | endif |
| 25 | endif | ||
| 26 | endif | ||
| 25 | endif | 27 | endif |
| 26 | 28 | ||
| 27 | 29 | ||
