Makefile 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # sparc/Makefile
  4. #
  5. # Makefile for the architecture dependent flags and dependencies on the
  6. # Sparc and sparc64.
  7. #
  8. # Copyright (C) 1994,1996,1998 David S. Miller ([email protected])
  9. # Copyright (C) 1998 Jakub Jelinek ([email protected])
  10. # We are not yet configured - so test on arch
  11. ifeq ($(ARCH),sparc64)
  12. KBUILD_DEFCONFIG := sparc64_defconfig
  13. else
  14. KBUILD_DEFCONFIG := sparc32_defconfig
  15. endif
  16. ifeq ($(CONFIG_SPARC32),y)
  17. #####
  18. # sparc32
  19. #
  20. CHECKFLAGS += -D__sparc__
  21. KBUILD_LDFLAGS := -m elf32_sparc
  22. export BITS := 32
  23. UTS_MACHINE := sparc
  24. # We are adding -Wa,-Av8 to KBUILD_CFLAGS to deal with a specs bug in some
  25. # versions of gcc. Some gcc versions won't pass -Av8 to binutils when you
  26. # give -mcpu=v8. This silently worked with older bintutils versions but
  27. # does not any more.
  28. KBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
  29. KBUILD_CFLAGS += -Wa,-Av8
  30. KBUILD_AFLAGS += -m32 -Wa,-Av8
  31. else
  32. #####
  33. # sparc64
  34. #
  35. CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__
  36. KBUILD_LDFLAGS := -m elf64_sparc
  37. export BITS := 64
  38. UTS_MACHINE := sparc64
  39. KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow
  40. KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
  41. KBUILD_CFLAGS += -Wa,--undeclared-regs
  42. KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
  43. KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
  44. ifeq ($(CONFIG_MCOUNT),y)
  45. KBUILD_CFLAGS += -pg
  46. endif
  47. endif
  48. libs-y += arch/sparc/prom/
  49. libs-y += arch/sparc/lib/
  50. drivers-$(CONFIG_PM) += arch/sparc/power/
  51. boot := arch/sparc/boot
  52. # Default target
  53. all: zImage
  54. image zImage uImage tftpboot.img vmlinux.aout: vmlinux
  55. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  56. install:
  57. $(call cmd,install)
  58. archheaders:
  59. $(Q)$(MAKE) $(build)=arch/sparc/kernel/syscalls all
  60. PHONY += vdso_install
  61. vdso_install:
  62. $(Q)$(MAKE) $(build)=arch/sparc/vdso $@
  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