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 171da177e4SLinus TorvaldsLDFLAGS := -m elf_s390 181da177e4SLinus TorvaldsCFLAGS += -m31 191da177e4SLinus TorvaldsAFLAGS += -m31 201da177e4SLinus TorvaldsUTS_MACHINE := s390 211da177e4SLinus TorvaldsSTACK_SIZE := 8192 22*22bb3e9eSAl ViroCHECKFLAGS += -D__s390__ -msize-long 23347a8dc3SMartin Schwidefskyelse 241da177e4SLinus TorvaldsLDFLAGS := -m elf64_s390 251da177e4SLinus TorvaldsMODFLAGS += -fpic -D__PIC__ 261da177e4SLinus TorvaldsCFLAGS += -m64 271da177e4SLinus TorvaldsAFLAGS += -m64 281da177e4SLinus TorvaldsUTS_MACHINE := s390x 291da177e4SLinus TorvaldsSTACK_SIZE := 16384 30d310a35aSviro@ZenIV.linux.org.ukCHECKFLAGS += -D__s390__ -D__s390x__ 311da177e4SLinus Torvaldsendif 321da177e4SLinus Torvalds 331da177e4SLinus Torvaldscflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5) 341da177e4SLinus Torvaldscflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900) 351da177e4SLinus Torvaldscflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990) 360efa4703SChristian Borntraegercflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109) 371da177e4SLinus Torvalds 381681cedaSChristian Borntraeger#KBUILD_IMAGE is necessary for make rpm 391681cedaSChristian BorntraegerKBUILD_IMAGE :=arch/s390/boot/image 401681cedaSChristian Borntraeger 41cbbd1fa7SHeiko Carstens# 42cbbd1fa7SHeiko Carstens# Prevent tail-call optimizations, to get clearer backtraces: 43cbbd1fa7SHeiko Carstens# 44cbbd1fa7SHeiko Carstenscflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls 45cbbd1fa7SHeiko Carstens 461da177e4SLinus Torvalds# old style option for packed stacks 471da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mkernel-backchain),y) 481da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK 491da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK 501da177e4SLinus Torvaldscflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK 511da177e4SLinus Torvaldsaflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK 521da177e4SLinus Torvaldsifdef CONFIG_SMALL_STACK 531da177e4SLinus TorvaldsSTACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) ) 541da177e4SLinus Torvaldsendif 551da177e4SLinus Torvaldsendif 561da177e4SLinus Torvalds 571da177e4SLinus Torvalds# new style option for packed stacks 581da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mpacked-stack),y) 591da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK 601da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK 611da177e4SLinus Torvaldscflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK 621da177e4SLinus Torvaldsaflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK 631da177e4SLinus Torvaldsifdef CONFIG_SMALL_STACK 641da177e4SLinus TorvaldsSTACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) ) 651da177e4SLinus Torvaldsendif 661da177e4SLinus Torvaldsendif 671da177e4SLinus Torvalds 681da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y) 691da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) 70be796285SMartin Schwidefskyifneq ($(call cc-option-yn,-mstack-size=8192),y) 711da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) 721da177e4SLinus Torvaldsendif 73be796285SMartin Schwidefskyendif 741da177e4SLinus Torvalds 751da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mwarn-dynamicstack),y) 761da177e4SLinus Torvaldscflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack 771da177e4SLinus Torvaldscflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE) 781da177e4SLinus Torvaldsendif 791da177e4SLinus Torvalds 801da177e4SLinus TorvaldsCFLAGS += -mbackchain -msoft-float $(cflags-y) 811da177e4SLinus TorvaldsCFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare 821da177e4SLinus TorvaldsAFLAGS += $(aflags-y) 831da177e4SLinus Torvalds 841da177e4SLinus TorvaldsOBJCOPYFLAGS := -O binary 851da177e4SLinus TorvaldsLDFLAGS_vmlinux := -e start 861da177e4SLinus Torvalds 874562c9ffSMichael Holzheuhead-y := arch/s390/kernel/head.o arch/s390/kernel/init_task.o 881da177e4SLinus Torvalds 894562c9ffSMichael Holzheucore-y += arch/s390/mm/ arch/s390/kernel/ arch/s390/crypto/ \ 904562c9ffSMichael Holzheu arch/s390/appldata/ arch/s390/hypfs/ 914562c9ffSMichael Holzheulibs-y += arch/s390/lib/ 921da177e4SLinus Torvaldsdrivers-y += drivers/s390/ 934562c9ffSMichael Holzheudrivers-$(CONFIG_MATHEMU) += arch/s390/math-emu/ 941da177e4SLinus Torvalds 951da177e4SLinus Torvalds# must be linked after kernel 961da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/ 971da177e4SLinus Torvalds 984562c9ffSMichael Holzheuboot := arch/s390/boot 991da177e4SLinus Torvalds 1001da177e4SLinus Torvaldsall: image 1011da177e4SLinus Torvalds 1021da177e4SLinus Torvaldsinstall: vmlinux 1031da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(boot) $@ 1041da177e4SLinus Torvalds 1051da177e4SLinus Torvaldsimage: vmlinux 1061da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 1071da177e4SLinus Torvalds 108411ed322SMichael Holzheuzfcpdump: 109411ed322SMichael Holzheu $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 110411ed322SMichael Holzheu 1111da177e4SLinus Torvaldsarchclean: 1121da177e4SLinus Torvalds $(Q)$(MAKE) $(clean)=$(boot) 1131da177e4SLinus Torvalds 1141da177e4SLinus Torvalds# Don't use tabs in echo arguments 1151da177e4SLinus Torvaldsdefine archhelp 1161da177e4SLinus Torvalds echo '* image - Kernel image for IPL ($(boot)/image)' 1171da177e4SLinus Torvaldsendef 118