xref: /linux/arch/s390/Makefile (revision e6d60b368b45b9be3aa068f8e5fa98c3487c9d4e)
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
380f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_G5)     := -march=g5
390f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z900)   := -march=z900
400f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z990)   := -march=z990
410f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z9_109) := -march=z9-109
420f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z10)    := -march=z10
430f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_Z196)   := -march=z196
440f1b1ff5SHeiko Carstensmflags-$(CONFIG_MARCH_ZEC12)  := -march=zEC12
45f8b2dcbdSMartin Schwidefskymflags-$(CONFIG_MARCH_Z13)   := -march=z13
460f1b1ff5SHeiko Carstens
470f1b1ff5SHeiko Carstensaflags-y += $(mflags-y)
480f1b1ff5SHeiko Carstenscflags-y += $(mflags-y)
491da177e4SLinus Torvalds
501db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_G5_TUNE)		+= -mtune=g5
511db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z900_TUNE)	+= -mtune=z900
521db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z990_TUNE)	+= -mtune=z990
531db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z9_109_TUNE)	+= -mtune=z9-109
541db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z10_TUNE)		+= -mtune=z10
551db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z196_TUNE)	+= -mtune=z196
561db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_ZEC12_TUNE)	+= -mtune=zEC12
57f8b2dcbdSMartin Schwidefskycflags-$(CONFIG_MARCH_Z13_TUNE)	+= -mtune=z13
581db9e051SHeiko Carstens
591681cedaSChristian Borntraeger#KBUILD_IMAGE is necessary for make rpm
601681cedaSChristian BorntraegerKBUILD_IMAGE	:=arch/s390/boot/image
611681cedaSChristian Borntraeger
62cbbd1fa7SHeiko Carstens#
63cbbd1fa7SHeiko Carstens# Prevent tail-call optimizations, to get clearer backtraces:
64cbbd1fa7SHeiko Carstens#
65cbbd1fa7SHeiko Carstenscflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
66cbbd1fa7SHeiko Carstens
671da177e4SLinus Torvalds# old style option for packed stacks
681da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mkernel-backchain),y)
691da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
701da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
711da177e4SLinus Torvaldsendif
721da177e4SLinus Torvalds
731da177e4SLinus Torvalds# new style option for packed stacks
741da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mpacked-stack),y)
751da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
761da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
771da177e4SLinus Torvaldsendif
781da177e4SLinus Torvalds
791da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
801da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
81be796285SMartin Schwidefskyifneq ($(call cc-option-yn,-mstack-size=8192),y)
821da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
831da177e4SLinus Torvaldsendif
84be796285SMartin Schwidefskyendif
851da177e4SLinus Torvalds
861da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
872c190da4SJan Glaubercflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack
881da177e4SLinus Torvaldsendif
891da177e4SLinus Torvalds
90*e6d60b36SHeiko Carstensifdef CONFIG_FUNCTION_TRACER
91*e6d60b36SHeiko Carstens# make use of hotpatch feature if the compiler supports it
92*e6d60b36SHeiko Carstenscc_hotpatch	:= -mhotpatch=0,3
93*e6d60b36SHeiko Carstensifeq ($(call cc-option-yn,$(cc_hotpatch)),y)
94*e6d60b36SHeiko CarstensCC_FLAGS_FTRACE := $(cc_hotpatch)
95*e6d60b36SHeiko CarstensKBUILD_AFLAGS	+= -DCC_USING_HOTPATCH
96*e6d60b36SHeiko CarstensKBUILD_CFLAGS	+= -DCC_USING_HOTPATCH
97*e6d60b36SHeiko Carstensendif
98*e6d60b36SHeiko Carstensendif
99*e6d60b36SHeiko Carstens
100a0f97e06SSam RavnborgKBUILD_CFLAGS	+= -mbackchain -msoft-float $(cflags-y)
101a0f97e06SSam RavnborgKBUILD_CFLAGS	+= -pipe -fno-strength-reduce -Wno-sign-compare
102222d394dSSam RavnborgKBUILD_AFLAGS	+= $(aflags-y)
1031da177e4SLinus Torvalds
1041da177e4SLinus TorvaldsOBJCOPYFLAGS	:= -O binary
1051da177e4SLinus Torvalds
1061844c9bcSMartin Schwidefskyhead-y		:= arch/s390/kernel/head.o
1071844c9bcSMartin Schwidefskyhead-y		+= arch/s390/kernel/$(if $(CONFIG_64BIT),head64.o,head31.o)
1081da177e4SLinus Torvalds
10901485943SHeiko Carstens# See arch/s390/Kbuild for content of core part of the kernel
11001485943SHeiko Carstenscore-y		+= arch/s390/
111155af2f9SHans-Joachim Picht
1124562c9ffSMichael Holzheulibs-y		+= arch/s390/lib/
1131da177e4SLinus Torvaldsdrivers-y	+= drivers/s390/
1141da177e4SLinus Torvalds
1151da177e4SLinus Torvalds# must be linked after kernel
1161da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)	+= arch/s390/oprofile/
1171da177e4SLinus Torvalds
1184562c9ffSMichael Holzheuboot		:= arch/s390/boot
1191da177e4SLinus Torvalds
1201844c9bcSMartin Schwidefskyall: image bzImage
1211da177e4SLinus Torvalds
1221da177e4SLinus Torvaldsinstall: vmlinux
1231da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $@
1241da177e4SLinus Torvalds
1251844c9bcSMartin Schwidefskyimage bzImage: vmlinux
1261da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
1271da177e4SLinus Torvalds
128411ed322SMichael Holzheuzfcpdump:
129411ed322SMichael Holzheu	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
130411ed322SMichael Holzheu
131f3cb31e4SHendrik Bruecknervdso_install:
132f3cb31e4SHendrik Bruecknerifeq ($(CONFIG_64BIT),y)
133f3cb31e4SHendrik Brueckner	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
134f3cb31e4SHendrik Bruecknerendif
135f3cb31e4SHendrik Brueckner	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
136f3cb31e4SHendrik Brueckner
1371da177e4SLinus Torvaldsarchclean:
1381da177e4SLinus Torvalds	$(Q)$(MAKE) $(clean)=$(boot)
1391da177e4SLinus Torvalds
1401da177e4SLinus Torvalds# Don't use tabs in echo arguments
1411da177e4SLinus Torvaldsdefine archhelp
1421da177e4SLinus Torvalds  echo  '* image           - Kernel image for IPL ($(boot)/image)'
1431844c9bcSMartin Schwidefsky  echo	'* bzImage         - Compressed kernel image for IPL ($(boot)/bzImage)'
1441da177e4SLinus Torvaldsendef
145