Makefile 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # This file is included by the global makefile so that you can add your own
  2. # architecture-specific flags and dependencies. Remember to do have actions
  3. # for "archclean" and "archdep" for cleaning up and making dependencies for
  4. # this architecture
  5. #
  6. # This file is subject to the terms and conditions of the GNU General Public
  7. # License. See the file "COPYING" in the main directory of this archive
  8. # for more details.
  9. #
  10. # Copyright (C) 1994 by Linus Torvalds
  11. # Changes for PPC by Gary Thomas
  12. # Rewritten by Cort Dougan and Paul Mackerras
  13. # Adjusted for PPC64 by Tom Gall
  14. #
  15. KERNELLOAD := 0xc000000000000000
  16. # Set default 32 bits cross compilers for vdso and boot wrapper
  17. CROSS32_COMPILE ?=
  18. CROSS32CC := $(CROSS32_COMPILE)gcc
  19. CROSS32AS := $(CROSS32_COMPILE)as
  20. CROSS32LD := $(CROSS32_COMPILE)ld
  21. CROSS32OBJCOPY := $(CROSS32_COMPILE)objcopy
  22. # If we have a biarch compiler, use it for 32 bits cross compile if
  23. # CROSS32_COMPILE wasn't explicitely defined, and add proper explicit
  24. # target type to target compilers
  25. HAS_BIARCH := $(call cc-option-yn, -m64)
  26. ifeq ($(HAS_BIARCH),y)
  27. ifeq ($(CROSS32_COMPILE),)
  28. CROSS32CC := $(CC) -m32
  29. CROSS32AS := $(AS) -a32
  30. CROSS32LD := $(LD) -m elf32ppc
  31. CROSS32OBJCOPY := $(OBJCOPY)
  32. endif
  33. override AS += -a64
  34. override LD += -m elf64ppc
  35. override CC += -m64
  36. endif
  37. export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
  38. new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
  39. ifeq ($(new_nm),y)
  40. NM := $(NM) --synthetic
  41. endif
  42. CHECKFLAGS += -m64 -D__powerpc__ -D__powerpc64__
  43. LDFLAGS := -m elf64ppc
  44. LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
  45. CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \
  46. -mcall-aixdesc
  47. # Temporary hack until we have migrated to asm-powerpc
  48. CPPFLAGS += -Iarch/$(ARCH)/include
  49. GCC_VERSION := $(call cc-version)
  50. GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;)
  51. ifeq ($(CONFIG_POWER4_ONLY),y)
  52. ifeq ($(CONFIG_ALTIVEC),y)
  53. ifeq ($(GCC_BROKEN_VEC),y)
  54. CFLAGS += $(call cc-option,-mcpu=970)
  55. else
  56. CFLAGS += $(call cc-option,-mcpu=power4)
  57. endif
  58. else
  59. CFLAGS += $(call cc-option,-mcpu=power4)
  60. endif
  61. else
  62. CFLAGS += $(call cc-option,-mtune=power4)
  63. endif
  64. # Enable unit-at-a-time mode when possible. It shrinks the
  65. # kernel considerably.
  66. CFLAGS += $(call cc-option,-funit-at-a-time)
  67. head-y := arch/ppc64/kernel/head.o
  68. libs-y += arch/ppc64/lib/
  69. core-y += arch/ppc64/kernel/
  70. core-y += arch/ppc64/mm/
  71. core-$(CONFIG_XMON) += arch/ppc64/xmon/
  72. drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
  73. boot := arch/ppc64/boot
  74. boottargets-$(CONFIG_PPC_PSERIES) += zImage zImage.initrd
  75. boottargets-$(CONFIG_PPC_PMAC) += zImage.vmode zImage.initrd.vmode
  76. boottargets-$(CONFIG_PPC_MAPLE) += zImage zImage.initrd
  77. boottargets-$(CONFIG_PPC_ISERIES) += vmlinux.sminitrd vmlinux.initrd vmlinux.sm
  78. boottargets-$(CONFIG_PPC_BPA) += zImage zImage.initrd
  79. $(boottargets-y): vmlinux
  80. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  81. bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage
  82. bootimage-$(CONFIG_PPC_PMAC) := vmlinux
  83. bootimage-$(CONFIG_PPC_MAPLE) := $(boot)/zImage
  84. bootimage-$(CONFIG_PPC_BPA) := zImage
  85. bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
  86. BOOTIMAGE := $(bootimage-y)
  87. install: vmlinux
  88. $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
  89. defaultimage-$(CONFIG_PPC_PSERIES) := zImage
  90. defaultimage-$(CONFIG_PPC_PMAC) := zImage.vmode
  91. defaultimage-$(CONFIG_PPC_MAPLE) := zImage
  92. defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
  93. KBUILD_IMAGE := $(defaultimage-y)
  94. all: $(KBUILD_IMAGE)
  95. archclean:
  96. $(Q)$(MAKE) $(clean)=$(boot)
  97. # Temporary hack until we have migrated to asm-powerpc
  98. $(Q)rm -rf arch/$(ARCH)/include
  99. # Temporary hack until we have migrated to asm-powerpc
  100. include/asm: arch/$(ARCH)/include/asm
  101. arch/$(ARCH)/include/asm:
  102. $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
  103. $(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
  104. define archhelp
  105. echo ' zImage.vmode - Compressed kernel image (arch/$(ARCH)/boot/zImage.vmode)'
  106. echo ' zImage.initrd.vmode - Compressed kernel image with initrd attached,'
  107. echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
  108. echo ' (arch/$(ARCH)/boot/zImage.initrd.vmode)'
  109. echo ' zImage - zImage for pSeries machines'
  110. echo ' zImage.initrd - zImage with initrd for pSeries machines'
  111. endef