Makefile 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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. ifdef CONFIG_ARCH_S390_31
  16. LDFLAGS := -m elf_s390
  17. CFLAGS += -m31
  18. AFLAGS += -m31
  19. UTS_MACHINE := s390
  20. STACK_SIZE := 8192
  21. endif
  22. ifdef CONFIG_ARCH_S390X
  23. LDFLAGS := -m elf64_s390
  24. MODFLAGS += -fpic -D__PIC__
  25. CFLAGS += -m64
  26. AFLAGS += -m64
  27. UTS_MACHINE := s390x
  28. STACK_SIZE := 16384
  29. endif
  30. cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5)
  31. cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
  32. cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
  33. # old style option for packed stacks
  34. ifeq ($(call cc-option-yn,-mkernel-backchain),y)
  35. cflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK
  36. aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
  37. cflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
  38. aflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
  39. ifdef CONFIG_SMALL_STACK
  40. STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
  41. endif
  42. endif
  43. # new style option for packed stacks
  44. ifeq ($(call cc-option-yn,-mpacked-stack),y)
  45. cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK
  46. aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
  47. cflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
  48. aflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
  49. ifdef CONFIG_SMALL_STACK
  50. STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
  51. endif
  52. endif
  53. ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
  54. cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
  55. cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
  56. endif
  57. ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
  58. cflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack
  59. cflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE)
  60. endif
  61. CFLAGS += -mbackchain -msoft-float $(cflags-y)
  62. CFLAGS += $(call cc-option,-finline-limit=10000)
  63. CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare
  64. AFLAGS += $(aflags-y)
  65. OBJCOPYFLAGS := -O binary
  66. LDFLAGS_vmlinux := -e start
  67. head-$(CONFIG_ARCH_S390_31) += arch/$(ARCH)/kernel/head.o
  68. head-$(CONFIG_ARCH_S390X) += arch/$(ARCH)/kernel/head64.o
  69. head-y += arch/$(ARCH)/kernel/init_task.o
  70. core-y += arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/ arch/$(ARCH)/crypto/ \
  71. arch/$(ARCH)/appldata/
  72. libs-y += arch/$(ARCH)/lib/
  73. drivers-y += drivers/s390/
  74. drivers-$(CONFIG_MATHEMU) += arch/$(ARCH)/math-emu/
  75. # must be linked after kernel
  76. drivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/
  77. boot := arch/$(ARCH)/boot
  78. all: image
  79. install: vmlinux
  80. $(Q)$(MAKE) $(build)=$(boot) $@
  81. image: vmlinux
  82. $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
  83. archclean:
  84. $(Q)$(MAKE) $(clean)=$(boot)
  85. prepare: include/asm-$(ARCH)/offsets.h
  86. arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \
  87. include/config/MARKER
  88. include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s
  89. $(call filechk,gen-asm-offsets)
  90. CLEAN_FILES += include/asm-$(ARCH)/offsets.h
  91. # Don't use tabs in echo arguments
  92. define archhelp
  93. echo '* image - Kernel image for IPL ($(boot)/image)'
  94. endef