/arch/ppc/Makefile

https://bitbucket.org/evzijst/gittest · Makefile · 138 lines · 90 code · 29 blank · 19 comment · 2 complexity · 390b7b191244206f72c4188bc8bb0f01 MD5 · raw file

  1. # This file is included by the global makefile so that you can add your own
  2. # architecture-specific flags and dependencies.
  3. #
  4. # This file is subject to the terms and conditions of the GNU General Public
  5. # License. See the file "COPYING" in the main directory of this archive
  6. # for more details.
  7. #
  8. # Copyright (C) 1994 by Linus Torvalds
  9. # Changes for PPC by Gary Thomas
  10. # Rewritten by Cort Dougan and Paul Mackerras
  11. #
  12. # This must match PAGE_OFFSET in include/asm-ppc/page.h.
  13. KERNELLOAD := $(CONFIG_KERNEL_START)
  14. HAS_BIARCH := $(call cc-option-yn, -m32)
  15. ifeq ($(HAS_BIARCH),y)
  16. AS := $(AS) -a32
  17. LD := $(LD) -m elf32ppc
  18. CC := $(CC) -m32
  19. endif
  20. LDFLAGS_vmlinux := -Ttext $(KERNELLOAD) -Bstatic
  21. CPPFLAGS += -Iarch/$(ARCH)
  22. AFLAGS += -Iarch/$(ARCH)
  23. CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
  24. -ffixed-r2 -mmultiple
  25. CPP = $(CC) -E $(CFLAGS)
  26. CHECKFLAGS += -D__powerpc__
  27. ifndef CONFIG_E500
  28. CFLAGS += -mstring
  29. endif
  30. cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
  31. cpu-as-$(CONFIG_4xx) += -Wa,-m405
  32. cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
  33. cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
  34. cpu-as-$(CONFIG_E500) += -Wa,-me500
  35. AFLAGS += $(cpu-as-y)
  36. CFLAGS += $(cpu-as-y)
  37. # Default to the common case.
  38. KBUILD_DEFCONFIG := common_defconfig
  39. head-y := arch/ppc/kernel/head.o
  40. head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o
  41. head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o
  42. head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o
  43. head-$(CONFIG_FSL_BOOKE) := arch/ppc/kernel/head_fsl_booke.o
  44. head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o
  45. head-$(CONFIG_POWER4) += arch/ppc/kernel/idle_power4.o
  46. core-y += arch/ppc/kernel/ arch/ppc/platforms/ \
  47. arch/ppc/mm/ arch/ppc/lib/ arch/ppc/syslib/
  48. core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
  49. core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
  50. core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
  51. core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/
  52. core-$(CONFIG_XMON) += arch/ppc/xmon/
  53. core-$(CONFIG_APUS) += arch/ppc/amiga/
  54. drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
  55. drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
  56. drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
  57. drivers-$(CONFIG_OPROFILE) += arch/ppc/oprofile/
  58. BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
  59. .PHONY: $(BOOT_TARGETS)
  60. all: uImage zImage
  61. CPPFLAGS_vmlinux.lds := -Upowerpc
  62. # All the instructions talk about "make bzImage".
  63. bzImage: zImage
  64. boot := arch/$(ARCH)/boot
  65. $(BOOT_TARGETS): vmlinux
  66. $(Q)$(MAKE) $(build)=$(boot) $@
  67. uImage: vmlinux
  68. $(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@
  69. define archhelp
  70. @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
  71. @echo ' uImage - Create a bootable image for U-Boot / PPCBoot'
  72. @echo ' install - Install kernel using'
  73. @echo ' (your) ~/bin/installkernel or'
  74. @echo ' (distribution) /sbin/installkernel or'
  75. @echo ' install to $$(INSTALL_PATH) and run lilo'
  76. @echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs'
  77. endef
  78. archclean:
  79. $(Q)$(MAKE) $(clean)=arch/ppc/boot
  80. prepare: include/asm-$(ARCH)/offsets.h checkbin
  81. arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
  82. include/config/MARKER
  83. include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
  84. $(call filechk,gen-asm-offsets)
  85. # Use the file '.tmp_gas_check' for binutils tests, as gas won't output
  86. # to stdout and these checks are run even on install targets.
  87. TOUT := .tmp_gas_check
  88. # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
  89. # instructions.
  90. # gcc-3.4 and binutils-2.14 are a fatal combination.
  91. GCC_VERSION := $(call cc-version)
  92. checkbin:
  93. @if test "$(GCC_VERSION)" = "0304" ; then \
  94. if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
  95. echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
  96. echo 'correctly with gcc-3.4 and your version of binutils.'; \
  97. echo '*** Please upgrade your binutils or downgrade your gcc'; \
  98. false; \
  99. fi ; \
  100. fi
  101. @if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
  102. echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
  103. echo 'correctly with old versions of binutils.' ; \
  104. echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
  105. false ; \
  106. fi
  107. CLEAN_FILES += include/asm-$(ARCH)/offsets.h \
  108. arch/$(ARCH)/kernel/asm-offsets.s \
  109. $(TOUT)