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 22d310a35aSviro@ZenIV.linux.org.ukCHECKFLAGS += -D__s390__ 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 38*1681cedaSChristian Borntraeger#KBUILD_IMAGE is necessary for make rpm 39*1681cedaSChristian BorntraegerKBUILD_IMAGE :=arch/s390/boot/image 40*1681cedaSChristian 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) 701da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) 711da177e4SLinus Torvaldsendif 721da177e4SLinus Torvalds 731da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mwarn-dynamicstack),y) 741da177e4SLinus Torvaldscflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack 751da177e4SLinus Torvaldscflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE) 761da177e4SLinus Torvaldsendif 771da177e4SLinus Torvalds 781da177e4SLinus TorvaldsCFLAGS += -mbackchain -msoft-float $(cflags-y) 791da177e4SLinus TorvaldsCFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare 801da177e4SLinus TorvaldsAFLAGS += $(aflags-y) 811da177e4SLinus Torvalds 821da177e4SLinus TorvaldsOBJCOPYFLAGS := -O binary 831da177e4SLinus TorvaldsLDFLAGS_vmlinux := -e start 841da177e4SLinus Torvalds 850ad775dbSHeiko Carstenshead-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o 861da177e4SLinus Torvalds 871da177e4SLinus Torvaldscore-y += arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/ arch/$(ARCH)/crypto/ \ 8824bbb1faSMichael Holzheu arch/$(ARCH)/appldata/ arch/$(ARCH)/hypfs/ 891da177e4SLinus Torvaldslibs-y += arch/$(ARCH)/lib/ 901da177e4SLinus Torvaldsdrivers-y += drivers/s390/ 911da177e4SLinus Torvaldsdrivers-$(CONFIG_MATHEMU) += arch/$(ARCH)/math-emu/ 921da177e4SLinus Torvalds 931da177e4SLinus Torvalds# must be linked after kernel 941da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/ 951da177e4SLinus Torvalds 961da177e4SLinus Torvaldsboot := arch/$(ARCH)/boot 971da177e4SLinus Torvalds 981da177e4SLinus Torvaldsall: image 991da177e4SLinus Torvalds 1001da177e4SLinus Torvaldsinstall: vmlinux 1011da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(boot) $@ 1021da177e4SLinus Torvalds 1031da177e4SLinus Torvaldsimage: vmlinux 1041da177e4SLinus Torvalds $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ 1051da177e4SLinus Torvalds 1061da177e4SLinus Torvaldsarchclean: 1071da177e4SLinus Torvalds $(Q)$(MAKE) $(clean)=$(boot) 1081da177e4SLinus Torvalds 1091da177e4SLinus Torvalds# Don't use tabs in echo arguments 1101da177e4SLinus Torvaldsdefine archhelp 1111da177e4SLinus Torvalds echo '* image - Kernel image for IPL ($(boot)/image)' 1121da177e4SLinus Torvaldsendef 113