Commit a5854dd7f30c3849edf9b9711362e2dd51d3f855
1 parent
3b3c1b9d04
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 11 additions and 9 deletions Side-by-side Diff
arch/tile/Makefile
... | ... | @@ -8,20 +8,22 @@ |
8 | 8 | # for "archclean" and "archdep" for cleaning up and making dependencies for |
9 | 9 | # this architecture |
10 | 10 | |
11 | -ifeq ($(CROSS_COMPILE),) | |
12 | 11 | # If building with TILERA_ROOT set (i.e. using the Tilera Multicore |
13 | 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 | 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 | 15 | ifeq ($(CROSS_COMPILE),) |
21 | -HOST_ARCH = $(shell uname -m) | |
22 | -ifneq ($(HOST_ARCH),$(ARCH)) | |
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 | 23 | $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH)) |
24 | -endif | |
24 | + endif | |
25 | + endif | |
26 | + endif | |
25 | 27 | endif |
26 | 28 | |
27 | 29 |