Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #
  2. # alpha/Makefile
  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. #
  10. NM := $(NM) -B
  11. LDFLAGS_vmlinux := -static -N #-relax
  12. CHECKFLAGS += -D__alpha__ -m64
  13. cflags-y := -pipe -mno-fp-regs -ffixed-8
  14. # Determine if we can use the BWX instructions with GAS.
  15. old_gas := $(shell if $(AS) --version 2>&1 | grep 'version 2.7' > /dev/null; then echo y; else echo n; fi)
  16. ifeq ($(old_gas),y)
  17. $(error The assembler '$(AS)' does not support the BWX instruction)
  18. endif
  19. # Determine if GCC understands the -mcpu= option.
  20. have_mcpu := $(call cc-option-yn, -mcpu=ev5)
  21. have_mcpu_pca56 := $(call cc-option-yn, -mcpu=pca56)
  22. have_mcpu_ev6 := $(call cc-option-yn, -mcpu=ev6)
  23. have_mcpu_ev67 := $(call cc-option-yn, -mcpu=ev67)
  24. have_msmall_data := $(call cc-option-yn, -msmall-data)
  25. cflags-$(have_msmall_data) += -msmall-data
  26. # Turn on the proper cpu optimizations.
  27. ifeq ($(have_mcpu),y)
  28. mcpu_done := n
  29. # If GENERIC, make sure to turn off any instruction set extensions that
  30. # the host compiler might have on by default. Given that EV4 and EV5
  31. # have the same instruction set, prefer EV5 because an EV5 schedule is
  32. # more likely to keep an EV4 processor busy than vice-versa.
  33. ifeq ($(CONFIG_ALPHA_GENERIC),y)
  34. mcpu := ev5
  35. mcpu_done := y
  36. endif
  37. ifeq ($(mcpu_done)$(CONFIG_ALPHA_SX164)$(have_mcpu_pca56),nyy)
  38. mcpu := pca56
  39. mcpu_done := y
  40. endif
  41. ifeq ($(mcpu_done)$(CONFIG_ALPHA_POLARIS)$(have_mcpu_pca56),nyy)
  42. mcpu := pca56
  43. mcpu_done := y
  44. endif
  45. ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV4),ny)
  46. mcpu := ev4
  47. mcpu_done := y
  48. endif
  49. ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV56),ny)
  50. mcpu := ev56
  51. mcpu_done := y
  52. endif
  53. ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV5),ny)
  54. mcpu := ev5
  55. mcpu_done := y
  56. endif
  57. ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV67)$(have_mcpu_ev67),nyy)
  58. mcpu := ev67
  59. mcpu_done := y
  60. endif
  61. ifeq ($(mcpu_done)$(CONFIG_ALPHA_EV6),ny)
  62. ifeq ($(have_mcpu_ev6),y)
  63. mcpu := ev6
  64. else
  65. ifeq ($(have_mcpu_pca56),y)
  66. mcpu := pca56
  67. else
  68. mcpu=ev56
  69. endif
  70. endif
  71. mcpu_done := y
  72. endif
  73. cflags-$(mcpu_done) += -mcpu=$(mcpu)
  74. endif
  75. # For TSUNAMI, we must have the assembler not emulate our instructions.
  76. # The same is true for IRONGATE, POLARIS, PYXIS.
  77. # BWX is most important, but we don't really want any emulation ever.
  78. CFLAGS += $(cflags-y) -Wa,-mev6
  79. head-y := arch/alpha/kernel/head.o
  80. core-y += arch/alpha/kernel/ arch/alpha/mm/
  81. core-$(CONFIG_MATHEMU) += arch/alpha/math-emu/
  82. drivers-$(CONFIG_OPROFILE) += arch/alpha/oprofile/
  83. libs-y += arch/alpha/lib/
  84. # export what is needed by arch/alpha/boot/Makefile
  85. LIBS_Y := $(patsubst %/, %/lib.a, $(libs-y))
  86. export LIBS_Y
  87. boot := arch/alpha/boot
  88. #Default target when executing make with no arguments
  89. all boot: $(boot)/vmlinux.gz
  90. $(boot)/vmlinux.gz: vmlinux
  91. $(Q)$(MAKE) $(build)=$(boot) $@
  92. bootimage bootpfile bootpzfile: vmlinux
  93. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  94. archclean:
  95. $(Q)$(MAKE) $(clean)=$(boot)
  96. define archhelp
  97. echo '* boot - Compressed kernel image (arch/alpha/boot/vmlinux.gz)'
  98. echo ' bootimage - SRM bootable image (arch/alpha/boot/bootimage)'
  99. echo ' bootpfile - BOOTP bootable image (arch/alpha/boot/bootpfile)'
  100. echo ' bootpzfile - compressed kernel BOOTP image (arch/alpha/boot/bootpzfile)'
  101. endef