Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a5854dd7 authored by Chris Metcalf's avatar Chris Metcalf
Browse files

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: default avatarChris Metcalf <cmetcalf@tilera.com>
Reviewed-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent 3b3c1b9d
Loading
Loading
Loading
Loading
+11 −9
Original line number Original line Diff line number Diff line
@@ -8,21 +8,23 @@
# for "archclean" and "archdep" for cleaning up and making dependencies for
# for "archclean" and "archdep" for cleaning up and making dependencies for
# this architecture
# this architecture


ifeq ($(CROSS_COMPILE),)
# If building with TILERA_ROOT set (i.e. using the Tilera Multicore
# If building with TILERA_ROOT set (i.e. using the Tilera Multicore
# Development Environment) we can set CROSS_COMPILE based on that.
# Development Environment) we can set CROSS_COMPILE based on that.
ifdef TILERA_ROOT
CROSS_COMPILE	= $(TILERA_ROOT)/bin/tile-
endif
endif

# If we're not cross-compiling, make sure we're on the right architecture.
# If we're not cross-compiling, make sure we're on the right architecture.
# Only bother to test for a few common targets, to avoid useless errors.
ifeq ($(CROSS_COMPILE),)
ifeq ($(CROSS_COMPILE),)
HOST_ARCH = $(shell uname -m)
  ifdef TILERA_ROOT
    CROSS_COMPILE := $(TILERA_ROOT)/bin/tile-
  else
    goals := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)
    ifneq ($(strip $(filter vmlinux modules all,$(goals))),)
      HOST_ARCH := $(shell uname -m)
      ifneq ($(HOST_ARCH),$(ARCH))
      ifneq ($(HOST_ARCH),$(ARCH))
$(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH))
$(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH))
      endif
      endif
    endif
    endif
  endif
endif




KBUILD_CFLAGS   += $(CONFIG_DEBUG_EXTRA_FLAGS)
KBUILD_CFLAGS   += $(CONFIG_DEBUG_EXTRA_FLAGS)