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 16347a8dc3SMartin Schwidefskyifndef CONFIG_64BIT 171844c9bcSMartin SchwidefskyLD_BFD := elf32-s390 181da177e4SLinus TorvaldsLDFLAGS := -m elf_s390 19a0f97e06SSam RavnborgKBUILD_CFLAGS += -m31 20222d394dSSam RavnborgKBUILD_AFLAGS += -m31 211da177e4SLinus TorvaldsUTS_MACHINE := s390 221da177e4SLinus TorvaldsSTACK_SIZE := 8192 2322bb3e9eSAl ViroCHECKFLAGS += -D__s390__ -msize-long 24347a8dc3SMartin Schwidefskyelse 251844c9bcSMartin SchwidefskyLD_BFD := elf64-s390 261da177e4SLinus TorvaldsLDFLAGS := -m elf64_s390 277bdc229fSMartin SchwidefskyKBUILD_AFLAGS_MODULE += -fPIC 287bdc229fSMartin SchwidefskyKBUILD_CFLAGS_MODULE += -fPIC 29a0f97e06SSam RavnborgKBUILD_CFLAGS += -m64 30222d394dSSam RavnborgKBUILD_AFLAGS += -m64 311da177e4SLinus TorvaldsUTS_MACHINE := s390x 321da177e4SLinus TorvaldsSTACK_SIZE := 16384 33d310a35aSviro@ZenIV.linux.org.ukCHECKFLAGS += -D__s390__ -D__s390x__ 341da177e4SLinus Torvaldsendif 351da177e4SLinus Torvalds 361844c9bcSMartin Schwidefskyexport LD_BFD 371844c9bcSMartin Schwidefsky 38faf499dfSHeiko Carstenscflags-$(CONFIG_MARCH_G5) += -march=g5 39faf499dfSHeiko Carstenscflags-$(CONFIG_MARCH_Z900) += -march=z900 40faf499dfSHeiko Carstenscflags-$(CONFIG_MARCH_Z990) += -march=z990 41faf499dfSHeiko Carstenscflags-$(CONFIG_MARCH_Z9_109) += -march=z9-109 42faf499dfSHeiko Carstenscflags-$(CONFIG_MARCH_Z10) += -march=z10 43faf499dfSHeiko Carstenscflags-$(CONFIG_MARCH_Z196) += -march=z196 44faf499dfSHeiko Carstenscflags-$(CONFIG_MARCH_ZEC12) += -march=zEC12 451da177e4SLinus Torvalds 46*1db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_G5_TUNE) += -mtune=g5 47*1db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z900_TUNE) += -mtune=z900 48*1db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z990_TUNE) += -mtune=z990 49*1db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z9_109_TUNE) += -mtune=z9-109 50*1db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z10_TUNE) += -mtune=z10 51*1db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z196_TUNE) += -mtune=z196 52*1db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12 53*1db9e051SHeiko Carstens 541681cedaSChristian Borntraeger#KBUILD_IMAGE is necessary for make rpm 551681cedaSChristian BorntraegerKBUILD_IMAGE :=arch/s390/boot/image 561681cedaSChristian Borntraeger 57cbbd1fa7SHeiko Carstens# 58cbbd1fa7SHeiko Carstens# Prevent tail-call optimizations, to get clearer backtraces: 59cbbd1fa7SHeiko Carstens# 60cbbd1fa7SHeiko Carstenscflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls 61cbbd1fa7SHeiko Carstens 621da177e4SLinus Torvalds# old style option for packed stacks 631da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mkernel-backchain),y) 641da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK 651da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK 661da177e4SLinus Torvaldsendif 671da177e4SLinus Torvalds 681da177e4SLinus Torvalds# new style option for packed stacks 691da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mpacked-stack),y) 701da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK 711da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK 721da177e4SLinus Torvaldsendif 731da177e4SLinus Torvalds 741da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y) 751da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) 76be796285SMartin Schwidefskyifneq ($(call cc-option-yn,-mstack-size=8192),y) 771da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) 781da177e4SLinus Torvaldsendif 79be796285SMartin Schwidefskyendif 801da177e4SLinus Torvalds 811da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mwarn-dynamicstack),y) 822c190da4SJan Glaubercflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack 831da177e4SLinus Torvaldsendif 841da177e4SLinus Torvalds 85a0f97e06SSam RavnborgKBUILD_CFLAGS += -mbackchain -msoft-float $(cflags-y) 86a0f97e06SSam RavnborgKBUILD_CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare 87222d394dSSam RavnborgKBUILD_AFLAGS += $(aflags-y) 881da177e4SLinus Torvalds 891da177e4SLinus TorvaldsOBJCOPYFLAGS := -O binary 901da177e4SLinus Torvalds 911844c9bcSMartin Schwidefskyhead-y := arch/s390/kernel/head.o 921844c9bcSMartin Schwidefskyhead-y += arch/s390/kernel/$(if $(CONFIG_64BIT),head64.o,head31.o) 931da177e4SLinus Torvalds 9401485943SHeiko Carstens# See arch/s390/Kbuild for content of core part of the kernel 9501485943SHeiko Carstenscore-y += arch/s390/ 96155af2f9SHans-Joachim Picht 974562c9ffSMichael Holzheulibs-y += arch/s390/lib/ 981da177e4SLinus Torvaldsdrivers-y += drivers/s390/ 991da177e4SLinus Torvalds 1001da177e4SLinus Torvalds# must be linked after kernel 1011da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/ 1021da177e4SLinus Torvalds 1034562c9ffSMichael Holzheuboot := arch/s390/boot 1041da177e4SLinus Torvalds 1051844c9bcSMartin Schwidefskyall: image bzImage 1061da177e4SLinus Torvalds 1071da177e4SLinus Torvaldsinstall: vmlinux 1081da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(boot) $@ 1091da177e4SLinus Torvalds 1101844c9bcSMartin Schwidefskyimage bzImage: vmlinux 1111da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 1121da177e4SLinus Torvalds 113411ed322SMichael Holzheuzfcpdump: 114411ed322SMichael Holzheu $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 115411ed322SMichael Holzheu 116f3cb31e4SHendrik Bruecknervdso_install: 117f3cb31e4SHendrik Bruecknerifeq ($(CONFIG_64BIT),y) 118f3cb31e4SHendrik Brueckner $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ 119f3cb31e4SHendrik Bruecknerendif 120f3cb31e4SHendrik Brueckner $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@ 121f3cb31e4SHendrik Brueckner 1221da177e4SLinus Torvaldsarchclean: 1231da177e4SLinus Torvalds $(Q)$(MAKE) $(clean)=$(boot) 1241da177e4SLinus Torvalds 1251da177e4SLinus Torvalds# Don't use tabs in echo arguments 1261da177e4SLinus Torvaldsdefine archhelp 1271da177e4SLinus Torvalds echo '* image - Kernel image for IPL ($(boot)/image)' 1281844c9bcSMartin Schwidefsky echo '* bzImage - Compressed kernel image for IPL ($(boot)/bzImage)' 1291da177e4SLinus Torvaldsendef 130