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. #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. CPPFLAGS_vmlinux.lds += -m32
  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. # Default target
  35. all: zImage
  36. else
  37. #####
  38. # sparc64
  39. #
  40. CHECKFLAGS += -D__sparc__ -D__sparc_v9__ -D__arch64__ -m64
  41. # Undefine sparc when processing vmlinux.lds - it is used
  42. # And teach CPP we are doing 64 bit builds (for this case)
  43. CPPFLAGS_vmlinux.lds += -m64 -Usparc
  44. LDFLAGS := -m elf64_sparc
  45. export BITS := 64
  46. KBUILD_CFLAGS += -m64 -pipe -mno-fpu -mcpu=ultrasparc -mcmodel=medlow \
  47. -ffixed-g4 -ffixed-g5 -fcall-used-g7 -Wno-sign-compare \
  48. -Wa,--undeclared-regs
  49. KBUILD_CFLAGS += $(call cc-option,-mtune=ultrasparc3)
  50. KBUILD_AFLAGS += -m64 -mcpu=ultrasparc -Wa,--undeclared-regs
  51. ifeq ($(CONFIG_MCOUNT),y)
  52. KBUILD_CFLAGS += -pg
  53. endif
  54. endif
  55. head-y := arch/sparc/kernel/head_$(BITS).o
  56. head-y += arch/sparc/kernel/init_task.o
  57. core-y += arch/sparc/kernel/
  58. core-y += arch/sparc/mm/ arch/sparc/math-emu/
  59. libs-y += arch/sparc/prom/
  60. libs-y += arch/sparc/lib/
  61. drivers-$(CONFIG_OPROFILE) += arch/sparc/oprofile/
  62. # Export what is needed by arch/sparc/boot/Makefile
  63. export VMLINUX_INIT VMLINUX_MAIN
  64. VMLINUX_INIT := $(head-y) $(init-y)
  65. VMLINUX_MAIN := $(core-y) kernel/ mm/ fs/ ipc/ security/ crypto/ block/
  66. VMLINUX_MAIN += $(patsubst %/, %/lib.a, $(libs-y)) $(libs-y)
  67. VMLINUX_MAIN += $(drivers-y) $(net-y)
  68. ifdef CONFIG_KALLSYMS
  69. export kallsyms.o := .tmp_kallsyms2.o
  70. endif
  71. boot := arch/sparc/boot
  72. image zImage tftpboot.img vmlinux.aout: vmlinux
  73. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  74. archclean:
  75. $(Q)$(MAKE) $(clean)=$(boot)
  76. # This is the image used for packaging
  77. KBUILD_IMAGE := $(boot)/zImage
  78. # Don't use tabs in echo arguments.
  79. ifeq ($(ARCH),sparc)
  80. define archhelp
  81. echo '* image - kernel image ($(boot)/image)'
  82. echo '* zImage - stripped kernel image ($(boot)/zImage)'
  83. echo ' tftpboot.img - image prepared for tftp'
  84. endef
  85. else
  86. define archhelp
  87. echo '* vmlinux - Standard sparc64 kernel'
  88. echo ' vmlinux.aout - a.out kernel for sparc64'
  89. echo ' tftpboot.img - image prepared for tftp'
  90. endef
  91. endif