11da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
21da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# s390/Makefile
31da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
41da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# This file is included by the global makefile so that you can add your own
51da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# architecture-specific flags and dependencies. Remember to do have actions
61da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# for "archclean" and "archdep" for cleaning up and making dependencies for
71da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# this architecture
81da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
91da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# This file is subject to the terms and conditions of the GNU General Public
101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# License.  See the file "COPYING" in the main directory of this archive
111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# for more details.
121da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# Copyright (C) 1994 by Linus Torvalds
141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds#
151da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
16347a8dc3b815f0c0fa62a1df075184ffe4cbdcf1Martin Schwidefskyifndef CONFIG_64BIT
171844c9bc0b2fed3023551c1affe033ab38e90b9aMartin SchwidefskyLD_BFD		:= elf32-s390
181da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsLDFLAGS		:= -m elf_s390
19a0f97e06a43cf524e616f09e6af3398e1e9c1c5bSam RavnborgKBUILD_CFLAGS	+= -m31
20222d394d30e74bb7a2a65029fcea68107b0d0eb6Sam RavnborgKBUILD_AFLAGS	+= -m31
211da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsUTS_MACHINE	:= s390
221da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsSTACK_SIZE	:= 8192
2322bb3e9e24e08a59efcb49943609ae88b6f628d0Al ViroCHECKFLAGS	+= -D__s390__ -msize-long
24347a8dc3b815f0c0fa62a1df075184ffe4cbdcf1Martin Schwidefskyelse
251844c9bc0b2fed3023551c1affe033ab38e90b9aMartin SchwidefskyLD_BFD		:= elf64-s390
261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsLDFLAGS		:= -m elf64_s390
276588169d516560f68672e2928680b71c647b7806Sam RavnborgKBUILD_AFLAGS_MODULE += -fpic -D__PIC__
286588169d516560f68672e2928680b71c647b7806Sam RavnborgKBUILD_CFLAGS_MODULE += -fpic -D__PIC__
29a0f97e06a43cf524e616f09e6af3398e1e9c1c5bSam RavnborgKBUILD_CFLAGS	+= -m64
30222d394d30e74bb7a2a65029fcea68107b0d0eb6Sam RavnborgKBUILD_AFLAGS	+= -m64
311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsUTS_MACHINE	:= s390x
321da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsSTACK_SIZE	:= 16384
33d310a35a487388859432648daa2ea4fc5e51c049Al ViroCHECKFLAGS	+= -D__s390__ -D__s390x__
341da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
351da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
361844c9bc0b2fed3023551c1affe033ab38e90b9aMartin Schwidefskyexport LD_BFD
371844c9bc0b2fed3023551c1affe033ab38e90b9aMartin Schwidefsky
381da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_MARCH_G5)   += $(call cc-option,-march=g5)
391da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
401da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
410efa470363699ecba49e67cc3c75f46b300f98a4Christian Borntraegercflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109)
42e37f50e1811d68170e4d58a087cf634b2bf1cef9Martin Schwidefskycflags-$(CONFIG_MARCH_Z10) += $(call cc-option,-march=z10)
43f861e4057263033ad9134bfd6745f91b2165b351Heiko Carstenscflags-$(CONFIG_MARCH_Z196) += $(call cc-option,-march=z196)
441da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
451681cedaee9f8dcb59d499a9277bc3a190a2378dChristian Borntraeger#KBUILD_IMAGE is necessary for make rpm
461681cedaee9f8dcb59d499a9277bc3a190a2378dChristian BorntraegerKBUILD_IMAGE	:=arch/s390/boot/image
471681cedaee9f8dcb59d499a9277bc3a190a2378dChristian Borntraeger
48cbbd1fa72d22896332301ca7e6b7164284be105cHeiko Carstens#
49cbbd1fa72d22896332301ca7e6b7164284be105cHeiko Carstens# Prevent tail-call optimizations, to get clearer backtraces:
50cbbd1fa72d22896332301ca7e6b7164284be105cHeiko Carstens#
51cbbd1fa72d22896332301ca7e6b7164284be105cHeiko Carstenscflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
52cbbd1fa72d22896332301ca7e6b7164284be105cHeiko Carstens
531da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# old style option for packed stacks
541da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsifeq ($(call cc-option-yn,-mkernel-backchain),y)
551da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
561da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
571da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
581da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsaflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
591da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsifdef CONFIG_SMALL_STACK
601da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsSTACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
611da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
621da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
631da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
641da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# new style option for packed stacks
651da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsifeq ($(call cc-option-yn,-mpacked-stack),y)
661da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
671da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
681da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
691da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsaflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
701da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsifdef CONFIG_SMALL_STACK
711da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsSTACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
721da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
731da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
741da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
751da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
761da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
77be7962856d299a0f231ac36f89f4a89cbecfe0ffMartin Schwidefskyifneq ($(call cc-option-yn,-mstack-size=8192),y)
781da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
791da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
80be7962856d299a0f231ac36f89f4a89cbecfe0ffMartin Schwidefskyendif
811da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
821da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
832c190da477c9ab167f5bb37414d99ef2063b388aJan Glaubercflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack
841da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendif
851da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
86a0f97e06a43cf524e616f09e6af3398e1e9c1c5bSam RavnborgKBUILD_CFLAGS	+= -mbackchain -msoft-float $(cflags-y)
87a0f97e06a43cf524e616f09e6af3398e1e9c1c5bSam RavnborgKBUILD_CFLAGS	+= -pipe -fno-strength-reduce -Wno-sign-compare
88222d394d30e74bb7a2a65029fcea68107b0d0eb6Sam RavnborgKBUILD_AFLAGS	+= $(aflags-y)
891da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
901da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus TorvaldsOBJCOPYFLAGS	:= -O binary
911da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
921844c9bc0b2fed3023551c1affe033ab38e90b9aMartin Schwidefskyhead-y		:= arch/s390/kernel/head.o
931844c9bc0b2fed3023551c1affe033ab38e90b9aMartin Schwidefskyhead-y		+= arch/s390/kernel/$(if $(CONFIG_64BIT),head64.o,head31.o)
941844c9bc0b2fed3023551c1affe033ab38e90b9aMartin Schwidefskyhead-y		+= arch/s390/kernel/init_task.o
951da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
96014859430ba72ffeb363a4acd2200851765fe6deHeiko Carstens# See arch/s390/Kbuild for content of core part of the kernel
97014859430ba72ffeb363a4acd2200851765fe6deHeiko Carstenscore-y		+= arch/s390/
98155af2f95f905c830688dd0ca7c7cac4107334fdHans-Joachim Picht
994562c9fffc3f8fca99f22671ad497aedd1737a5eMichael Holzheulibs-y		+= arch/s390/lib/
1001da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsdrivers-y	+= drivers/s390/
1011da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1021da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# must be linked after kernel
1031da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsdrivers-$(CONFIG_OPROFILE)	+= arch/s390/oprofile/
1041da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1054562c9fffc3f8fca99f22671ad497aedd1737a5eMichael Holzheuboot		:= arch/s390/boot
1061da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1071844c9bc0b2fed3023551c1affe033ab38e90b9aMartin Schwidefskyall: image bzImage
1081da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1091da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsinstall: vmlinux
1101da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $@
1111da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1121844c9bc0b2fed3023551c1affe033ab38e90b9aMartin Schwidefskyimage bzImage: vmlinux
1131da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
1141da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
115411ed3225733dbd83b4cbaaa992ef80d6ec1534eMichael Holzheuzfcpdump:
116411ed3225733dbd83b4cbaaa992ef80d6ec1534eMichael Holzheu	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
117411ed3225733dbd83b4cbaaa992ef80d6ec1534eMichael Holzheu
118f3cb31e495668eae568c584c666631e26c68bdeaHendrik Bruecknervdso_install:
119f3cb31e495668eae568c584c666631e26c68bdeaHendrik Bruecknerifeq ($(CONFIG_64BIT),y)
120f3cb31e495668eae568c584c666631e26c68bdeaHendrik Brueckner	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
121f3cb31e495668eae568c584c666631e26c68bdeaHendrik Bruecknerendif
122f3cb31e495668eae568c584c666631e26c68bdeaHendrik Brueckner	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
123f3cb31e495668eae568c584c666631e26c68bdeaHendrik Brueckner
1241da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsarchclean:
1251da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds	$(Q)$(MAKE) $(clean)=$(boot)
1261da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds
1271da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds# Don't use tabs in echo arguments
1281da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsdefine archhelp
1291da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvalds  echo  '* image           - Kernel image for IPL ($(boot)/image)'
1301844c9bc0b2fed3023551c1affe033ab38e90b9aMartin Schwidefsky  echo	'* bzImage         - Compressed kernel image for IPL ($(boot)/bzImage)'
1311da177e4c3f41524e886b7f1b8a0c1fc7321cacLinus Torvaldsendef
132