Makefile 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  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_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. AFLAGS += $(cpu-as-y)
  40. 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. core-$(CONFIG_APUS) += arch/ppc/amiga/
  60. drivers-$(CONFIG_8xx) += arch/ppc/8xx_io/
  61. drivers-$(CONFIG_4xx) += arch/ppc/4xx_io/
  62. drivers-$(CONFIG_CPM2) += arch/ppc/8260_io/
  63. drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
  64. BOOT_TARGETS = zImage zImage.initrd znetboot znetboot.initrd vmlinux.sm
  65. PHONY += $(BOOT_TARGETS)
  66. all: uImage zImage
  67. CPPFLAGS_vmlinux.lds := -Upowerpc
  68. # All the instructions talk about "make bzImage".
  69. bzImage: zImage
  70. boot := arch/$(ARCH)/boot
  71. $(BOOT_TARGETS): vmlinux
  72. $(Q)$(MAKE) $(build)=$(boot) $@
  73. uImage: vmlinux
  74. $(Q)$(MAKE) $(build)=$(boot)/images $(boot)/images/$@
  75. define archhelp
  76. @echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/images/zImage.*)'
  77. @echo ' uImage - Create a bootable image for U-Boot / PPCBoot'
  78. @echo ' install - Install kernel using'
  79. @echo ' (your) ~/bin/installkernel or'
  80. @echo ' (distribution) /sbin/installkernel or'
  81. @echo ' install to $$(INSTALL_PATH) and run lilo'
  82. @echo ' *_defconfig - Select default config from arch/$(ARCH)/ppc/configs'
  83. endef
  84. archclean:
  85. $(Q)$(MAKE) $(clean)=arch/ppc/boot
  86. # Temporary hack until we have migrated to asm-powerpc
  87. $(Q)rm -rf arch/$(ARCH)/include
  88. archprepare: checkbin
  89. # Temporary hack until we have migrated to asm-powerpc
  90. include/asm: arch/$(ARCH)/include/asm
  91. arch/$(ARCH)/include/asm:
  92. $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
  93. $(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
  94. # Use the file '.tmp_gas_check' for binutils tests, as gas won't output
  95. # to stdout and these checks are run even on install targets.
  96. TOUT := .tmp_gas_check
  97. # Ensure this is binutils 2.12.1 (or 2.12.90.0.7) or later for altivec
  98. # instructions.
  99. # gcc-3.4 and binutils-2.14 are a fatal combination.
  100. checkbin:
  101. @if test "$(call cc-version)" = "0304" ; then \
  102. if ! /bin/echo mftb 5 | $(AS) -v -mppc -many -o $(TOUT) >/dev/null 2>&1 ; then \
  103. echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build '; \
  104. echo 'correctly with gcc-3.4 and your version of binutils.'; \
  105. echo '*** Please upgrade your binutils or downgrade your gcc'; \
  106. false; \
  107. fi ; \
  108. fi
  109. @if ! /bin/echo dssall | $(AS) -many -o $(TOUT) >/dev/null 2>&1 ; then \
  110. echo -n '*** ${VERSION}.${PATCHLEVEL} kernels no longer build ' ; \
  111. echo 'correctly with old versions of binutils.' ; \
  112. echo '*** Please upgrade your binutils to 2.12.1 or newer' ; \
  113. false ; \
  114. fi
  115. CLEAN_FILES += $(TOUT)