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