Makefile 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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. # If building with TILERA_ROOT set (i.e. using the Tilera Multicore
  11. # Development Environment) we can set CROSS_COMPILE based on that.
  12. # If we're not cross-compiling, make sure we're on the right architecture.
  13. # Only bother to test for a few common targets, to avoid useless errors.
  14. ifeq ($(CROSS_COMPILE),)
  15. ifdef TILERA_ROOT
  16. CROSS_COMPILE := $(TILERA_ROOT)/bin/tile-
  17. else
  18. goals := $(if $(MAKECMDGOALS), $(MAKECMDGOALS), all)
  19. ifneq ($(strip $(filter vmlinux modules all,$(goals))),)
  20. HOST_ARCH := $(shell uname -m)
  21. ifneq ($(HOST_ARCH),$(ARCH))
  22. $(error Set TILERA_ROOT or CROSS_COMPILE when building $(ARCH) on $(HOST_ARCH))
  23. endif
  24. endif
  25. endif
  26. endif
  27. # The tile compiler may emit .eh_frame information for backtracing.
  28. # In kernel modules, this causes load failures due to unsupported relocations.
  29. KBUILD_CFLAGS += -fno-asynchronous-unwind-tables
  30. LIBGCC_PATH := \
  31. $(shell $(CC) $(KBUILD_CFLAGS) $(KCFLAGS) -print-libgcc-file-name)
  32. # Provide the path to use for "make defconfig".
  33. # We default to the newer TILE-Gx architecture if only "tile" is given.
  34. ifeq ($(ARCH),tile)
  35. KBUILD_DEFCONFIG := tilegx_defconfig
  36. else
  37. KBUILD_DEFCONFIG := $(ARCH)_defconfig
  38. endif
  39. # Used as a file extension when useful, e.g. head_$(BITS).o
  40. # Not needed for (e.g.) "$(CC) -m32" since the compiler automatically
  41. # uses the right default anyway.
  42. export BITS
  43. ifeq ($(CONFIG_TILEGX),y)
  44. BITS := 64
  45. else
  46. BITS := 32
  47. endif
  48. head-y := arch/tile/kernel/head_$(BITS).o
  49. libs-y += arch/tile/lib/
  50. libs-y += $(LIBGCC_PATH)
  51. # See arch/tile/Kbuild for content of core part of the kernel
  52. core-y += arch/tile/
  53. core-$(CONFIG_TILE_GXIO) += arch/tile/gxio/
  54. ifdef TILERA_ROOT
  55. INSTALL_PATH ?= $(TILERA_ROOT)/tile/boot
  56. endif
  57. install:
  58. install -D -m 755 vmlinux $(INSTALL_PATH)/vmlinux-$(KERNELRELEASE)
  59. install -D -m 644 .config $(INSTALL_PATH)/config-$(KERNELRELEASE)
  60. install -D -m 644 System.map $(INSTALL_PATH)/System.map-$(KERNELRELEASE)
  61. define archhelp
  62. echo ' install - install kernel into $(INSTALL_PATH)'
  63. endef