Makefile 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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_PM) += arch/sparc/power/
  48. drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
  49. boot := arch/sparc/boot
  50. # Default target
  51. all: zImage
  52. image zImage uImage tftpboot.img vmlinux.aout: vmlinux
  53. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  54. install:
  55. $(Q)$(MAKE) $(build)=$(boot) $@
  56. archclean:
  57. $(Q)$(MAKE) $(clean)=$(boot)
  58. # This is the image used for packaging
  59. KBUILD_IMAGE := $(boot)/zImage
  60. # Don't use tabs in echo arguments.
  61. ifeq ($(ARCH),sparc)
  62. define archhelp
  63. echo '* image - kernel image ($(boot)/image)'
  64. echo '* zImage - stripped kernel image ($(boot)/zImage)'
  65. echo ' uImage - U-Boot SPARC32 Image (only for LEON)'
  66. echo ' tftpboot.img - image prepared for tftp'
  67. endef
  68. else
  69. define archhelp
  70. echo '* vmlinux - standard sparc64 kernel'
  71. echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)'
  72. echo ' vmlinux.aout - a.out kernel for sparc64'
  73. echo ' tftpboot.img - image prepared for tftp'
  74. endef
  75. endif