Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. #
  2. # sparc/Makefile
  3. #
  4. # Makefile for the architecture dependent flags and dependencies on the
  5. # Sparc and sparc64.
  6. #
  7. # Copyright (C) 1994,1996,1998 David S. Miller (davem@caip.rutgers.edu)
  8. # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
  9. # We are not yet configured - so test on arch
  10. ifeq ($(ARCH),sparc)
  11. KBUILD_DEFCONFIG := sparc32_defconfig
  12. else
  13. KBUILD_DEFCONFIG := sparc64_defconfig
  14. endif
  15. ifeq ($(CONFIG_SPARC32),y)
  16. #####
  17. # sparc32
  18. #
  19. CHECKFLAGS += -D__sparc__
  20. LDFLAGS := -m elf32_sparc
  21. export BITS := 32
  22. UTS_MACHINE := sparc
  23. # We are adding -Wa,-Av8 to KBUILD_CFLAGS to deal with a specs bug in some
  24. # versions of gcc. Some gcc versions won't pass -Av8 to binutils when you
  25. # give -mcpu=v8. This silently worked with older bintutils versions but
  26. # does not any more.
  27. KBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
  28. KBUILD_CFLAGS += -Wa,-Av8
  29. KBUILD_AFLAGS += -m32 -Wa,-Av8
  30. else
  31. #####
  32. # sparc64
  33. #
  34. CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
  35. LDFLAGS := -m elf64_sparc
  36. export BITS := 64
  37. UTS_MACHINE := sparc64
  38. KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow
  39. KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
  40. KBUILD_CFLAGS += -Wa,--undeclared-regs
  41. KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
  42. KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
  43. ifeq ($(CONFIG_MCOUNT),y)
  44. KBUILD_CFLAGS += -pg
  45. endif
  46. endif
  47. head-y := arch/sparc/kernel/head_$(BITS).o
  48. # See arch/sparc/Kbuild for the core part of the kernel
  49. core-y += arch/sparc/
  50. libs-y += arch/sparc/prom/
  51. libs-y += arch/sparc/lib/
  52. drivers-$(CONFIG_PM) += arch/sparc/power/
  53. drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
  54. boot := arch/sparc/boot
  55. # Default target
  56. all: zImage
  57. image zImage uImage tftpboot.img vmlinux.aout: vmlinux
  58. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  59. install:
  60. $(Q)$(MAKE) $(build)=$(boot) $@
  61. archclean:
  62. $(Q)$(MAKE) $(clean)=$(boot)
  63. # This is the image used for packaging
  64. KBUILD_IMAGE := $(boot)/zImage
  65. # Don't use tabs in echo arguments.
  66. ifeq ($(ARCH),sparc)
  67. define archhelp
  68. echo '* image - kernel image ($(boot)/image)'
  69. echo '* zImage - stripped kernel image ($(boot)/zImage)'
  70. echo ' uImage - U-Boot SPARC32 Image (only for LEON)'
  71. echo ' tftpboot.img - image prepared for tftp'
  72. endef
  73. else
  74. define archhelp
  75. echo '* vmlinux - standard sparc64 kernel'
  76. echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)'
  77. echo ' vmlinux.aout - a.out kernel for sparc64'
  78. echo ' tftpboot.img - image prepared for tftp'
  79. endef
  80. endif