Makefile 3.0 KB

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