Makefile 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. KBUILD_CFLAGS += -m32 -mcpu=v8 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
  24. KBUILD_AFLAGS += -m32 -Wa,-Av8
  25. else
  26. #####
  27. # sparc64
  28. #
  29. CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
  30. LDFLAGS := -m elf64_sparc
  31. export BITS := 64
  32. UTS_MACHINE := sparc64
  33. KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow
  34. KBUILD_CFLAGS += -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare
  35. KBUILD_CFLAGS += -Wa,--undeclared-regs
  36. KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
  37. KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
  38. ifeq ($(CONFIG_MCOUNT),y)
  39. KBUILD_CFLAGS += -pg
  40. endif
  41. endif
  42. head-y := arch/sparc/kernel/head_$(BITS).o
  43. # See arch/sparc/Kbuild for the core part of the kernel
  44. core-y += arch/sparc/
  45. libs-y += arch/sparc/prom/
  46. libs-y += arch/sparc/lib/
  47. drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
  48. boot := arch/sparc/boot
  49. # Default target
  50. all: zImage
  51. image zImage uImage tftpboot.img vmlinux.aout: vmlinux
  52. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  53. archclean:
  54. $(Q)$(MAKE) $(clean)=$(boot)
  55. # This is the image used for packaging
  56. KBUILD_IMAGE := $(boot)/zImage
  57. # Don't use tabs in echo arguments.
  58. ifeq ($(ARCH),sparc)
  59. define archhelp
  60. echo '* image - kernel image ($(boot)/image)'
  61. echo '* zImage - stripped kernel image ($(boot)/zImage)'
  62. echo ' uImage - U-Boot SPARC32 Image (only for LEON)'
  63. echo ' tftpboot.img - image prepared for tftp'
  64. endef
  65. else
  66. define archhelp
  67. echo '* vmlinux - standard sparc64 kernel'
  68. echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)'
  69. echo ' vmlinux.aout - a.out kernel for sparc64'
  70. echo ' tftpboot.img - image prepared for tftp'
  71. endef
  72. endif