Makefile 4.6 KB

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