Makefile 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #
  2. # This file is subject to the terms and conditions of the GNU General Public
  3. # License. See the file "COPYING" in the main directory of this archive
  4. # for more details.
  5. #
  6. # This file is included by the global makefile so that you can add your own
  7. # architecture-specific flags and dependencies. Remember to do have actions
  8. # for "archclean" and "archdep" for cleaning up and making dependencies for
  9. # this architecture
  10. ifeq ($(CROSS_COMPILE),)
  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. ifdef TILERA_ROOT
  14. CROSS_COMPILE = $(TILERA_ROOT)/bin/tile-
  15. endif
  16. endif
  17. # If we're not cross-compiling, make sure we're on the right architecture.
  18. ifeq ($(CROSS_COMPILE),)
  19. HOST_ARCH = $(shell uname -m)
  20. ifneq ($(HOST_ARCH),$(ARCH))
  21. $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH))
  22. endif
  23. endif
  24. KBUILD_CFLAGS += $(CONFIG_DEBUG_EXTRA_FLAGS)
  25. LIBGCC_PATH := $(shell $(CC) $(KBUILD_CFLAGS) -print-libgcc-file-name)
  26. # Provide the path to use for "make defconfig".
  27. KBUILD_DEFCONFIG := $(ARCH)_defconfig
  28. # Used as a file extension when useful, e.g. head_$(BITS).o
  29. # Not needed for (e.g.) "$(CC) -m32" since the compiler automatically
  30. # uses the right default anyway.
  31. export BITS
  32. ifeq ($(CONFIG_TILEGX),y)
  33. BITS := 64
  34. else
  35. BITS := 32
  36. endif
  37. head-y := arch/tile/kernel/head_$(BITS).o
  38. libs-y += arch/tile/lib/
  39. libs-y += $(LIBGCC_PATH)
  40. # See arch/tile/Kbuild for content of core part of the kernel
  41. core-y += arch/tile/