diff options
| -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 | ||
