Makefile 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. # The -Iarch/$(ARCH)/include is temporary while we are merging
  22. CPPFLAGS += -Iarch/$(ARCH) -Iarch/$(ARCH)/include
  23. AFLAGS += -Iarch/$(ARCH)
  24. CFLAGS += -Iarch/$(ARCH) -msoft-float -pipe \
  25. -ffixed-r2 -mmultiple
  26. # No AltiVec instruction when building kernel
  27. CFLAGS += $(call cc-option, -mno-altivec)
  28. CPP = $(CC) -E $(CFLAGS)
  29. # Temporary hack until we have migrated to asm-powerpc
  30. LINUXINCLUDE += -Iarch/$(ARCH)/include
  31. CHECKFLAGS += -D__powerpc__
  32. ifndef CONFIG_FSL_BOOKE
  33. CFLAGS += -mstring
  34. endif
  35. cpu-as-$(CONFIG_PPC64BRIDGE) += -Wa,-mppc64bridge
  36. cpu-as-$(CONFIG_4xx) += -Wa,-m405
  37. cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
  38. cpu-as-$(CONFIG_POWER4) += -Wa,-maltivec
  39. cpu-as-$(CONFIG_E500) += -Wa,-me500
  40. cpu-as-$(CONFIG_E200) += -Wa,-me200
  41. AFLAGS += $(cpu-as-y)
  42. CFLAGS += $(cpu-as-y)
  43. # Default to the common case.
  44. KBUILD_DEFCONFIG := common_defconfig
  45. head-y := arch/ppc/kernel/head.o
  46. head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o
  47. head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o
  48. head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o
  49. head-$(CONFIG_FSL_BOOKE) := arch/ppc/kernel/head_fsl_booke.o
  50. head-$(CONFIG_6xx) += arch/ppc/kernel/idle_6xx.o
  51. head-$(CONFIG_POWER4) += arch/ppc/kernel/idle_power4.o
  52. head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
  53. core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \
  54. arch/ppc/platforms/ \
  55. arch/ppc/mm/ arch/ppc/lib/ \
  56. arch/ppc/syslib/ arch/powerpc/sysdev/ \
  57. arch/powerpc/lib/
  58. core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
  59. core-$(CONFIG_83xx) += arch/ppc/platforms/83xx/
  60. core-$(CONFIG_85xx) += arch/ppc/platforms/85xx/
  61. core-$(CONFIG_MATH_EMULATION) += arch/ppc/math-emu/
  62. core-$(CONFIG_XMON) += arch/ppc/xmon/
  63. core-$(CONFIG_APUS) += arch/ppc/amiga/
  64. drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
  65. drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
  66. drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
  67. drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
  68. BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
  69. .PHONY: $(BOOT_TARGETS)
  70. all: uImage zImage
  71. CPPFLAGS_vmlinux.lds := -Upowerpc
  72. # All the instructions talk about "make bzImage".
  73. bzImage: zImage
  74. boot := arch/$(ARCH)/boot
  75. $(BOOT_TARGETS): vmlinux
  76. $(Q)$(MAKE) $(build)=$(boot) $@
  77. uImage: vmlinux
  78. $(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@
  79. define archhelp
  80. @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
  81. @echo ' uImage - Create a bootable image for U-Boot / PPCBoot'
  82. @echo ' install - Install kernel using'
  83. @echo ' (your) ~/bin/installkernel or'
  84. @echo ' (distribution) /sbin/installkernel or'
  85. @echo ' install to $$(INSTALL_PATH) and run lilo'
  86. @echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs'
  87. endef
  88. archclean:
  89. $(Q)$(MAKE) $(clean)=arch/ppc/boot
  90. # Temporary hack until we have migrated to asm-powerpc
  91. $(Q)rm -rf arch/$(ARCH)/include
  92. archprepare: checkbin
  93. # Temporary hack until we have migrated to asm-powerpc
  94. include/asm: arch/$(ARCH)/include/asm
  95. arch/$(ARCH)/include/asm:
  96. $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
  97. $(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
  98. # Use the file '.tmp_gas_check' for binutils tests, as gas won't output
  99. # to stdout and these checks are run even on install targets.
  100. TOUT := .tmp_gas_check
  101. # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
  102. # instructions.
  103. # gcc-3.4 and binutils-2.14 are a fatal combination.
  104. checkbin:
  105. @if test "$(call cc-version)" = "0304" ; then \
  106. if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
  107. echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
  108. echo 'correctly with gcc-3.4 and your version of binutils.'; \
  109. echo '*** Please upgrade your binutils or downgrade your gcc'; \
  110. false; \
  111. fi ; \
  112. fi
  113. @if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
  114. echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
  115. echo 'correctly with old versions of binutils.' ; \
  116. echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
  117. false ; \
  118. fi
  119. CLEAN_FILES += $(TOUT)