Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  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. #
  20. # Uncomment the first KBUILD_CFLAGS if you are doing kgdb source level
  21. # debugging of the kernel to get the proper debugging information.
  22. AS := $(AS) -32
  23. LDFLAGS := -m elf32_sparc
  24. CHECKFLAGS += -D__sparc__
  25. export BITS := 32
  26. UTS_MACHINE := sparc
  27. #KBUILD_CFLAGS += -g -pipe -fcall-used-g5 -fcall-used-g7
  28. KBUILD_CFLAGS += -m32 -mcpu=v7 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
  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. -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
  40. -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. head-y += arch/sparc/kernel/init_task.o
  49. core-y += arch/sparc/kernel/
  50. core-y += arch/sparc/mm/ arch/sparc/math-emu/
  51. libs-y += arch/sparc/prom/
  52. libs-y += arch/sparc/lib/
  53. drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
  54. ifdef CONFIG_KALLSYMS
  55. export kallsyms.o := .tmp_kallsyms2.o
  56. endif
  57. boot := arch/sparc/boot
  58. # Default target
  59. all: zImage
  60. image zImage uImage tftpboot.img vmlinux.aout: vmlinux
  61. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  62. archclean:
  63. $(Q)$(MAKE) $(clean)=$(boot)
  64. # This is the image used for packaging
  65. KBUILD_IMAGE := $(boot)/zImage
  66. # Don't use tabs in echo arguments.
  67. ifeq ($(ARCH),sparc)
  68. define archhelp
  69. echo '* image - kernel image ($(boot)/image)'
  70. echo '* zImage - stripped kernel image ($(boot)/zImage)'
  71. echo ' uImage - U-Boot SPARC32 Image (only for LEON)'
  72. echo ' tftpboot.img - image prepared for tftp'
  73. endef
  74. else
  75. define archhelp
  76. echo '* vmlinux - standard sparc64 kernel'
  77. echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)'
  78. echo ' vmlinux.aout - a.out kernel for sparc64'
  79. echo ' tftpboot.img - image prepared for tftp'
  80. endef
  81. endif