Makefile 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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 (davem@caip.rutgers.edu)
  9. # Copyright (C) 1998 Jakub Jelinek (jj@ultra.linux.cz)
  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. head-y := arch/sparc/kernel/head_$(BITS).o
  49. # See arch/sparc/Kbuild for the core part of the kernel
  50. core-y += arch/sparc/
  51. libs-y += arch/sparc/prom/
  52. libs-y += arch/sparc/lib/
  53. drivers-$(CONFIG_PM) += arch/sparc/power/
  54. drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
  55. boot := arch/sparc/boot
  56. # Default target
  57. all: zImage
  58. image zImage uImage tftpboot.img vmlinux.aout: vmlinux
  59. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  60. install:
  61. $(Q)$(MAKE) $(build)=$(boot) $@
  62. archclean:
  63. $(Q)$(MAKE) $(clean)=$(boot)
  64. archheaders:
  65. $(Q)$(MAKE) $(build)=arch/sparc/kernel/syscalls all
  66. PHONY += vdso_install
  67. vdso_install:
  68. $(Q)$(MAKE) $(build)=arch/sparc/vdso $@
  69. # This is the image used for packaging
  70. KBUILD_IMAGE := $(boot)/zImage
  71. # Don't use tabs in echo arguments.
  72. ifeq ($(ARCH),sparc)
  73. define archhelp
  74. echo '* image - kernel image ($(boot)/image)'
  75. echo '* zImage - stripped kernel image ($(boot)/zImage)'
  76. echo ' uImage - U-Boot SPARC32 Image (only for LEON)'
  77. echo ' tftpboot.img - image prepared for tftp'
  78. endef
  79. else
  80. define archhelp
  81. echo '* vmlinux - standard sparc64 kernel'
  82. echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)'
  83. echo ' vmlinux.aout - a.out kernel for sparc64'
  84. echo ' tftpboot.img - image prepared for tftp'
  85. endef
  86. endif