11da177e4SLinus Torvalds# 21da177e4SLinus Torvalds# s390/Makefile 31da177e4SLinus Torvalds# 41da177e4SLinus Torvalds# This file is included by the global makefile so that you can add your own 51da177e4SLinus Torvalds# architecture-specific flags and dependencies. Remember to do have actions 61da177e4SLinus Torvalds# for "archclean" and "archdep" for cleaning up and making dependencies for 71da177e4SLinus Torvalds# this architecture 81da177e4SLinus Torvalds# 91da177e4SLinus Torvalds# This file is subject to the terms and conditions of the GNU General Public 101da177e4SLinus Torvalds# License. See the file "COPYING" in the main directory of this archive 111da177e4SLinus Torvalds# for more details. 121da177e4SLinus Torvalds# 131da177e4SLinus Torvalds# Copyright (C) 1994 by Linus Torvalds 141da177e4SLinus Torvalds# 151da177e4SLinus Torvalds 161844c9bcSMartin SchwidefskyLD_BFD := elf64-s390 171da177e4SLinus TorvaldsLDFLAGS := -m elf64_s390 187bdc229fSMartin SchwidefskyKBUILD_AFLAGS_MODULE += -fPIC 197bdc229fSMartin SchwidefskyKBUILD_CFLAGS_MODULE += -fPIC 20a0f97e06SSam RavnborgKBUILD_CFLAGS += -m64 21222d394dSSam RavnborgKBUILD_AFLAGS += -m64 221da177e4SLinus TorvaldsUTS_MACHINE := s390x 231da177e4SLinus TorvaldsSTACK_SIZE := 16384 24d310a35aSviro@ZenIV.linux.org.ukCHECKFLAGS += -D__s390__ -D__s390x__ 251da177e4SLinus Torvalds 261844c9bcSMartin Schwidefskyexport LD_BFD 271844c9bcSMartin Schwidefsky 280f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z900) := -march=z900 290f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z990) := -march=z990 300f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z9_109) := -march=z9-109 310f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z10) := -march=z10 320f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z196) := -march=z196 330f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_ZEC12) := -march=zEC12 34f8b2dcbdSMartin Schwidefskymflags-$(CONFIG_MARCH_Z13) := -march=z13 350f1b1ff5SHeiko Carstens 36*22362a0eSMartin Schwidefskyexport CC_FLAGS_MARCH := $(mflags-y) 37*22362a0eSMartin Schwidefsky 380f1b1ff5SHeiko Carstensaflags-y += $(mflags-y) 390f1b1ff5SHeiko Carstenscflags-y += $(mflags-y) 401da177e4SLinus Torvalds 411db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z900_TUNE) += -mtune=z900 421db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z990_TUNE) += -mtune=z990 431db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z9_109_TUNE) += -mtune=z9-109 441db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z10_TUNE) += -mtune=z10 451db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z196_TUNE) += -mtune=z196 461db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12 47f8b2dcbdSMartin Schwidefskycflags-$(CONFIG_MARCH_Z13_TUNE) += -mtune=z13 481db9e051SHeiko Carstens 491681cedaSChristian Borntraeger#KBUILD_IMAGE is necessary for make rpm 501681cedaSChristian BorntraegerKBUILD_IMAGE :=arch/s390/boot/image 511681cedaSChristian Borntraeger 52cbbd1fa7SHeiko Carstens# 53cbbd1fa7SHeiko Carstens# Prevent tail-call optimizations, to get clearer backtraces: 54cbbd1fa7SHeiko Carstens# 55cbbd1fa7SHeiko Carstenscflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls 56cbbd1fa7SHeiko Carstens 571da177e4SLinus Torvalds# old style option for packed stacks 581da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mkernel-backchain),y) 591da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK 601da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK 611da177e4SLinus Torvaldsendif 621da177e4SLinus Torvalds 631da177e4SLinus Torvalds# new style option for packed stacks 641da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mpacked-stack),y) 651da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK 661da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK 671da177e4SLinus Torvaldsendif 681da177e4SLinus Torvalds 691da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y) 701da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) 71be796285SMartin Schwidefskyifneq ($(call cc-option-yn,-mstack-size=8192),y) 721da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) 731da177e4SLinus Torvaldsendif 74be796285SMartin Schwidefskyendif 751da177e4SLinus Torvalds 761da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mwarn-dynamicstack),y) 772c190da4SJan Glaubercflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack 781da177e4SLinus Torvaldsendif 791da177e4SLinus Torvalds 80e6d60b36SHeiko Carstensifdef CONFIG_FUNCTION_TRACER 81e6d60b36SHeiko Carstens# make use of hotpatch feature if the compiler supports it 82e6d60b36SHeiko Carstenscc_hotpatch := -mhotpatch=0,3 83e6d60b36SHeiko Carstensifeq ($(call cc-option-yn,$(cc_hotpatch)),y) 84e6d60b36SHeiko CarstensCC_FLAGS_FTRACE := $(cc_hotpatch) 85e6d60b36SHeiko CarstensKBUILD_AFLAGS += -DCC_USING_HOTPATCH 86e6d60b36SHeiko CarstensKBUILD_CFLAGS += -DCC_USING_HOTPATCH 87e6d60b36SHeiko Carstensendif 88e6d60b36SHeiko Carstensendif 89e6d60b36SHeiko Carstens 90a0f97e06SSam RavnborgKBUILD_CFLAGS += -mbackchain -msoft-float $(cflags-y) 91a0f97e06SSam RavnborgKBUILD_CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare 92222d394dSSam RavnborgKBUILD_AFLAGS += $(aflags-y) 931da177e4SLinus Torvalds 941da177e4SLinus TorvaldsOBJCOPYFLAGS := -O binary 951da177e4SLinus Torvalds 961844c9bcSMartin Schwidefskyhead-y := arch/s390/kernel/head.o 975a79859aSHeiko Carstenshead-y += arch/s390/kernel/head64.o 981da177e4SLinus Torvalds 9901485943SHeiko Carstens# See arch/s390/Kbuild for content of core part of the kernel 10001485943SHeiko Carstenscore-y += arch/s390/ 101155af2f9SHans-Joachim Picht 1024562c9ffSMichael Holzheulibs-y += arch/s390/lib/ 1031da177e4SLinus Torvaldsdrivers-y += drivers/s390/ 1041da177e4SLinus Torvalds 1051da177e4SLinus Torvalds# must be linked after kernel 1061da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/ 1071da177e4SLinus Torvalds 1084562c9ffSMichael Holzheuboot := arch/s390/boot 1091da177e4SLinus Torvalds 1101844c9bcSMartin Schwidefskyall: image bzImage 1111da177e4SLinus Torvalds 1121da177e4SLinus Torvaldsinstall: vmlinux 1131da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(boot) $@ 1141da177e4SLinus Torvalds 1151844c9bcSMartin Schwidefskyimage bzImage: vmlinux 1161da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 1171da177e4SLinus Torvalds 118411ed322SMichael Holzheuzfcpdump: 119411ed322SMichael Holzheu $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 120411ed322SMichael Holzheu 121f3cb31e4SHendrik Bruecknervdso_install: 122f3cb31e4SHendrik Brueckner $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ 123f3cb31e4SHendrik Brueckner $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@ 124f3cb31e4SHendrik Brueckner 1251da177e4SLinus Torvaldsarchclean: 1261da177e4SLinus Torvalds $(Q)$(MAKE) $(clean)=$(boot) 1271da177e4SLinus Torvalds 1281da177e4SLinus Torvalds# Don't use tabs in echo arguments 1291da177e4SLinus Torvaldsdefine archhelp 1301da177e4SLinus Torvalds echo '* image - Kernel image for IPL ($(boot)/image)' 1311844c9bcSMartin Schwidefsky echo '* bzImage - Compressed kernel image for IPL ($(boot)/bzImage)' 1321da177e4SLinus Torvaldsendef 133