Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. #
  2. # s390/Makefile
  3. #
  4. # This file is included by the global makefile so that you can add your own
  5. # architecture-specific flags and dependencies. Remember to do have actions
  6. # for "archclean" and "archdep" for cleaning up and making dependencies for
  7. # this architecture
  8. #
  9. # This file is subject to the terms and conditions of the GNU General Public
  10. # License. See the file "COPYING" in the main directory of this archive
  11. # for more details.
  12. #
  13. # Copyright (C) 1994 by Linus Torvalds
  14. #
  15. ifndef CONFIG_64BIT
  16. LDFLAGS := -m elf_s390
  17. KBUILD_CFLAGS += -m31
  18. KBUILD_AFLAGS += -m31
  19. UTS_MACHINE := s390
  20. STACK_SIZE := 8192
  21. CHECKFLAGS += -D__s390__ -msize-long
  22. else
  23. LDFLAGS := -m elf64_s390
  24. MODFLAGS += -fpic -D__PIC__
  25. KBUILD_CFLAGS += -m64
  26. KBUILD_AFLAGS += -m64
  27. UTS_MACHINE := s390x
  28. STACK_SIZE := 16384
  29. CHECKFLAGS += -D__s390__ -D__s390x__
  30. endif
  31. cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5)
  32. cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
  33. cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
  34. cflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109)
  35. cflags-$(CONFIG_MARCH_Z10) += $(call cc-option,-march=z10)
  36. #KBUILD_IMAGE is necessary for make rpm
  37. KBUILD_IMAGE :=arch/s390/boot/image
  38. #
  39. # Prevent tail-call optimizations, to get clearer backtraces:
  40. #
  41. cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
  42. # old style option for packed stacks
  43. ifeq ($(call cc-option-yn,-mkernel-backchain),y)
  44. cflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK
  45. aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
  46. cflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
  47. aflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
  48. ifdef CONFIG_SMALL_STACK
  49. STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
  50. endif
  51. endif
  52. # new style option for packed stacks
  53. ifeq ($(call cc-option-yn,-mpacked-stack),y)
  54. cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK
  55. aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
  56. cflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
  57. aflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
  58. ifdef CONFIG_SMALL_STACK
  59. STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
  60. endif
  61. endif
  62. ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
  63. cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
  64. ifneq ($(call cc-option-yn,-mstack-size=8192),y)
  65. cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
  66. endif
  67. endif
  68. ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
  69. cflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack
  70. cflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE)
  71. endif
  72. KBUILD_CFLAGS += -mbackchain -msoft-float $(cflags-y)
  73. KBUILD_CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare
  74. KBUILD_AFLAGS += $(aflags-y)
  75. OBJCOPYFLAGS := -O binary
  76. LDFLAGS_vmlinux := -e start
  77. head-y := arch/s390/kernel/head.o arch/s390/kernel/init_task.o
  78. core-y += arch/s390/mm/ arch/s390/kernel/ arch/s390/crypto/ \
  79. arch/s390/appldata/ arch/s390/hypfs/ arch/s390/kvm/
  80. libs-y += arch/s390/lib/
  81. drivers-y += drivers/s390/
  82. drivers-$(CONFIG_MATHEMU) += arch/s390/math-emu/
  83. # must be linked after kernel
  84. drivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/
  85. boot := arch/s390/boot
  86. all: image
  87. install: vmlinux
  88. $(Q)$(MAKE) $(build)=$(boot) $@
  89. image: vmlinux
  90. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  91. zfcpdump:
  92. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  93. archclean:
  94. $(Q)$(MAKE) $(clean)=$(boot)
  95. # Don't use tabs in echo arguments
  96. define archhelp
  97. echo '* image - Kernel image for IPL ($(boot)/image)'
  98. endef