xref: /linux/arch/s390/Makefile (revision 3b42c17a7e264ce4b351d2de205d4c39f725af0f)
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
24*3b42c17aSLuc Van OostenryckCHECKFLAGS	+= -D__s390__ -D__s390x__ -mbig-endian
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
356997c323SMartin Schwidefskymflags-$(CONFIG_MARCH_Z14)    := -march=z14
360f1b1ff5SHeiko Carstens
3722362a0eSMartin Schwidefskyexport CC_FLAGS_MARCH := $(mflags-y)
3822362a0eSMartin Schwidefsky
390f1b1ff5SHeiko Carstensaflags-y += $(mflags-y)
400f1b1ff5SHeiko Carstenscflags-y += $(mflags-y)
411da177e4SLinus Torvalds
421db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z900_TUNE)	+= -mtune=z900
431db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z990_TUNE)	+= -mtune=z990
441db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z9_109_TUNE)	+= -mtune=z9-109
451db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z10_TUNE)		+= -mtune=z10
461db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_Z196_TUNE)	+= -mtune=z196
471db9e051SHeiko Carstenscflags-$(CONFIG_MARCH_ZEC12_TUNE)	+= -mtune=zEC12
48f8b2dcbdSMartin Schwidefskycflags-$(CONFIG_MARCH_Z13_TUNE)		+= -mtune=z13
496997c323SMartin Schwidefskycflags-$(CONFIG_MARCH_Z14_TUNE)		+= -mtune=z14
501db9e051SHeiko Carstens
51c783b91eSMartin Schwidefskycflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include
52c783b91eSMartin Schwidefsky
531681cedaSChristian Borntraeger#KBUILD_IMAGE is necessary for make rpm
541681cedaSChristian BorntraegerKBUILD_IMAGE	:=arch/s390/boot/image
551681cedaSChristian Borntraeger
56cbbd1fa7SHeiko Carstens#
57cbbd1fa7SHeiko Carstens# Prevent tail-call optimizations, to get clearer backtraces:
58cbbd1fa7SHeiko Carstens#
59cbbd1fa7SHeiko Carstenscflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
60cbbd1fa7SHeiko Carstens
611da177e4SLinus Torvalds# old style option for packed stacks
621da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mkernel-backchain),y)
631da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
641da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
651da177e4SLinus Torvaldsendif
661da177e4SLinus Torvalds
671da177e4SLinus Torvalds# new style option for packed stacks
681da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mpacked-stack),y)
691da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
701da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
711da177e4SLinus Torvaldsendif
721da177e4SLinus Torvalds
731da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
741da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
75be796285SMartin Schwidefskyifneq ($(call cc-option-yn,-mstack-size=8192),y)
761da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
771da177e4SLinus Torvaldsendif
78be796285SMartin Schwidefskyendif
791da177e4SLinus Torvalds
801da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
812c190da4SJan Glaubercflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack
821da177e4SLinus Torvaldsendif
831da177e4SLinus Torvalds
84e6d60b36SHeiko Carstensifdef CONFIG_FUNCTION_TRACER
85e6d60b36SHeiko Carstens# make use of hotpatch feature if the compiler supports it
86e6d60b36SHeiko Carstenscc_hotpatch	:= -mhotpatch=0,3
87e6d60b36SHeiko Carstensifeq ($(call cc-option-yn,$(cc_hotpatch)),y)
88e6d60b36SHeiko CarstensCC_FLAGS_FTRACE := $(cc_hotpatch)
89e6d60b36SHeiko CarstensKBUILD_AFLAGS	+= -DCC_USING_HOTPATCH
90e6d60b36SHeiko CarstensKBUILD_CFLAGS	+= -DCC_USING_HOTPATCH
91e6d60b36SHeiko Carstensendif
92e6d60b36SHeiko Carstensendif
93e6d60b36SHeiko Carstens
94a0f97e06SSam RavnborgKBUILD_CFLAGS	+= -mbackchain -msoft-float $(cflags-y)
95a0f97e06SSam RavnborgKBUILD_CFLAGS	+= -pipe -fno-strength-reduce -Wno-sign-compare
96222d394dSSam RavnborgKBUILD_AFLAGS	+= $(aflags-y)
971da177e4SLinus Torvalds
981da177e4SLinus TorvaldsOBJCOPYFLAGS	:= -O binary
991da177e4SLinus Torvalds
1001844c9bcSMartin Schwidefskyhead-y		:= arch/s390/kernel/head.o
1015a79859aSHeiko Carstenshead-y		+= arch/s390/kernel/head64.o
1021da177e4SLinus Torvalds
10301485943SHeiko Carstens# See arch/s390/Kbuild for content of core part of the kernel
10401485943SHeiko Carstenscore-y		+= arch/s390/
105155af2f9SHans-Joachim Picht
1064562c9ffSMichael Holzheulibs-y		+= arch/s390/lib/
1071da177e4SLinus Torvaldsdrivers-y	+= drivers/s390/
1081da177e4SLinus Torvalds
1091da177e4SLinus Torvalds# must be linked after kernel
1101da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)	+= arch/s390/oprofile/
1111da177e4SLinus Torvalds
1124562c9ffSMichael Holzheuboot		:= arch/s390/boot
113c30f6828SHeiko Carstenstools		:= arch/s390/tools
1141da177e4SLinus Torvalds
1151844c9bcSMartin Schwidefskyall: image bzImage
1161da177e4SLinus Torvalds
1171da177e4SLinus Torvaldsinstall: vmlinux
1181da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $@
1191da177e4SLinus Torvalds
1201844c9bcSMartin Schwidefskyimage bzImage: vmlinux
1211da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
1221da177e4SLinus Torvalds
123411ed322SMichael Holzheuzfcpdump:
124411ed322SMichael Holzheu	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
125411ed322SMichael Holzheu
126f3cb31e4SHendrik Bruecknervdso_install:
127f3cb31e4SHendrik Brueckner	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
128f3cb31e4SHendrik Brueckner	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
129f3cb31e4SHendrik Brueckner
1301da177e4SLinus Torvaldsarchclean:
1311da177e4SLinus Torvalds	$(Q)$(MAKE) $(clean)=$(boot)
132c30f6828SHeiko Carstens	$(Q)$(MAKE) $(clean)=$(tools)
133c30f6828SHeiko Carstens
134c30f6828SHeiko Carstensarchprepare:
135c30f6828SHeiko Carstens	$(Q)$(MAKE) $(build)=$(tools) include/generated/facilities.h
1361da177e4SLinus Torvalds
1371da177e4SLinus Torvalds# Don't use tabs in echo arguments
1381da177e4SLinus Torvaldsdefine archhelp
1391da177e4SLinus Torvalds  echo  '* image           - Kernel image for IPL ($(boot)/image)'
1401844c9bcSMartin Schwidefsky  echo	'* bzImage         - Compressed kernel image for IPL ($(boot)/bzImage)'
141b8eecf36SMichael Holzheu  echo	'  install         - Install kernel using'
142b8eecf36SMichael Holzheu  echo	'                    (your) ~/bin/$(INSTALLKERNEL) or'
143b8eecf36SMichael Holzheu  echo	'                    (distribution) /sbin/$(INSTALLKERNEL) or'
144b8eecf36SMichael Holzheu  echo	'                    install to $$(INSTALL_PATH)'
1451da177e4SLinus Torvaldsendef
146