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.
  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. cpu-as-$(CONFIG_4xx) += -Wa,-m405
  33. cpu-as-$(CONFIG_6xx) += -Wa,-maltivec
  34. KBUILD_AFLAGS += $(cpu-as-y)
  35. KBUILD_CFLAGS += $(cpu-as-y)
  36. # Default to the common case.
  37. KBUILD_DEFCONFIG := common_defconfig
  38. head-y := arch/ppc/kernel/head.o
  39. head-$(CONFIG_8xx) := arch/ppc/kernel/head_8xx.o
  40. head-$(CONFIG_4xx) := arch/ppc/kernel/head_4xx.o
  41. head-$(CONFIG_44x) := arch/ppc/kernel/head_44x.o
  42. head-$(CONFIG_PPC_FPU) += arch/powerpc/kernel/fpu.o
  43. core-y += arch/ppc/kernel/ arch/powerpc/kernel/ \
  44. arch/ppc/platforms/ \
  45. arch/ppc/mm/ arch/ppc/lib/ \
  46. arch/ppc/syslib/ arch/powerpc/sysdev/ \
  47. arch/powerpc/lib/
  48. core-$(CONFIG_4xx) += arch/ppc/platforms/4xx/
  49. core-$(CONFIG_MATH_EMULATION) += arch/powerpc/math-emu/
  50. core-$(CONFIG_XMON) += arch/ppc/xmon/
  51. drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
  52. drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
  53. drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
  54. drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
  55. BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
  56. PHONY += $(BOOT_TARGETS)
  57. all: uImage zImage
  58. CPPFLAGS_vmlinux.lds := -Upowerpc
  59. # All the instructions talk about "make bzImage".
  60. bzImage: zImage
  61. boot := arch/$(ARCH)/boot
  62. $(BOOT_TARGETS): vmlinux
  63. $(Q)$(MAKE) $(build)=$(boot) $@
  64. uImage: vmlinux
  65. $(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@
  66. define archhelp
  67. @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
  68. @echo ' uImage - Create a bootable image for U-Boot / PPCBoot'
  69. @echo ' install - Install kernel using'
  70. @echo ' (your) ~/bin/installkernel or'
  71. @echo ' (distribution) /sbin/installkernel or'
  72. @echo ' install to $$(INSTALL_PATH) and run lilo'
  73. @echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs'
  74. endef
  75. archclean:
  76. $(Q)$(MAKE) $(clean)=arch/ppc/boot
  77. # Temporary hack until we have migrated to asm-powerpc
  78. $(Q)rm -rf arch/$(ARCH)/include
  79. archprepare: checkbin
  80. # Temporary hack until we have migrated to asm-powerpc
  81. include/asm: arch/$(ARCH)/include/asm
  82. arch/$(ARCH)/include/asm:
  83. $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
  84. $(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
  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. checkbin:
  92. @if test "$(call cc-version)" = "0304" ; then \
  93. if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
  94. echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
  95. echo 'correctly with gcc-3.4 and your version of binutils.'; \
  96. echo '*** Please upgrade your binutils or downgrade your gcc'; \
  97. false; \
  98. fi ; \
  99. fi
  100. @if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
  101. echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
  102. echo 'correctly with old versions of binutils.' ; \
  103. echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
  104. false ; \
  105. fi
  106. CLEAN_FILES += $(TOUT)