Makefile 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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 -pipe -mno-fpu -fcall-used-g5 -fcall-used-g7
  29. KBUILD_AFLAGS += -m32 -Wa,-Av8
  30. #LDFLAGS_vmlinux = -N -Ttext 0xf0004000
  31. # Since 2.5.40, the first stage is left not btfix-ed.
  32. # Actual linking is done with "make image".
  33. LDFLAGS_vmlinux = -r
  34. else
  35. #####
  36. # sparc64
  37. #
  38. CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
  39. LDFLAGS := -m elf64_sparc
  40. export BITS := 64
  41. UTS_MACHINE := sparc64
  42. KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
  43. -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
  44. -Wa,--undeclared-regs
  45. KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
  46. KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
  47. ifeq ($(CONFIG_MCOUNT),y)
  48. KBUILD_CFLAGS += -pg
  49. endif
  50. endif
  51. head-y := arch/sparc/kernel/head_$(BITS).o
  52. head-y += arch/sparc/kernel/init_task.o
  53. core-y += arch/sparc/kernel/
  54. core-y += arch/sparc/mm/ arch/sparc/math-emu/
  55. libs-y += arch/sparc/prom/
  56. libs-y += arch/sparc/lib/
  57. drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
  58. # Export what is needed by arch/sparc/boot/Makefile
  59. export VMLINUX_INIT VMLINUX_MAIN
  60. VMLINUX_INIT := $(head-y) $(init-y)
  61. VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
  62. VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
  63. VMLINUX_MAIN += $(drivers-y) $(net-y)
  64. ifdef CONFIG_KALLSYMS
  65. export kallsyms.o := .tmp_kallsyms2.o
  66. endif
  67. boot := arch/sparc/boot
  68. # Default target
  69. all: zImage
  70. image zImage uImage tftpboot.img vmlinux.aout: vmlinux
  71. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  72. archclean:
  73. $(Q)$(MAKE) $(clean)=$(boot)
  74. # This is the image used for packaging
  75. KBUILD_IMAGE := $(boot)/zImage
  76. # Don't use tabs in echo arguments.
  77. ifeq ($(ARCH),sparc)
  78. define archhelp
  79. echo '* image - kernel image ($(boot)/image)'
  80. echo '* zImage - stripped kernel image ($(boot)/zImage)'
  81. echo ' uImage - U-Boot SPARC32 Image (only for LEON)'
  82. echo ' tftpboot.img - image prepared for tftp'
  83. endef
  84. else
  85. define archhelp
  86. echo '* vmlinux - standard sparc64 kernel'
  87. echo '* zImage - stripped and compressed sparc64 kernel ($(boot)/zImage)'
  88. echo ' vmlinux.aout - a.out kernel for sparc64'
  89. echo ' tftpboot.img - image prepared for tftp'
  90. endef
  91. endif