xref: /linux/arch/s390/Makefile (revision 014859430ba72ffeb363a4acd2200851765fe6de)
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
276588169dSSam RavnborgKBUILD_AFLAGS_MODULE += -fpic -D__PIC__
286588169dSSam RavnborgKBUILD_CFLAGS_MODULE += -fpic -D__PIC__
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
381da177e4SLinus Torvaldscflags-$(CONFIG_MARCH_G5)   += $(call cc-option,-march=g5)
391da177e4SLinus Torvaldscflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
401da177e4SLinus Torvaldscflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
410efa4703SChristian Borntraegercflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109)
42e37f50e1SMartin Schwidefskycflags-$(CONFIG_MARCH_Z10) += $(call cc-option,-march=z10)
431da177e4SLinus Torvalds
441681cedaSChristian Borntraeger#KBUILD_IMAGE is necessary for make rpm
451681cedaSChristian BorntraegerKBUILD_IMAGE	:=arch/s390/boot/image
461681cedaSChristian Borntraeger
47cbbd1fa7SHeiko Carstens#
48cbbd1fa7SHeiko Carstens# Prevent tail-call optimizations, to get clearer backtraces:
49cbbd1fa7SHeiko Carstens#
50cbbd1fa7SHeiko Carstenscflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
51cbbd1fa7SHeiko Carstens
521da177e4SLinus Torvalds# old style option for packed stacks
531da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mkernel-backchain),y)
541da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
551da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
561da177e4SLinus Torvaldscflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
571da177e4SLinus Torvaldsaflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
581da177e4SLinus Torvaldsifdef CONFIG_SMALL_STACK
591da177e4SLinus TorvaldsSTACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
601da177e4SLinus Torvaldsendif
611da177e4SLinus Torvaldsendif
621da177e4SLinus Torvalds
631da177e4SLinus Torvalds# new style option for packed stacks
641da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mpacked-stack),y)
651da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
661da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
671da177e4SLinus Torvaldscflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
681da177e4SLinus Torvaldsaflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
691da177e4SLinus Torvaldsifdef CONFIG_SMALL_STACK
701da177e4SLinus TorvaldsSTACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
711da177e4SLinus Torvaldsendif
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)
821da177e4SLinus Torvaldscflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack
831da177e4SLinus Torvaldscflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE)
841da177e4SLinus Torvaldsendif
851da177e4SLinus Torvalds
86a0f97e06SSam RavnborgKBUILD_CFLAGS	+= -mbackchain -msoft-float $(cflags-y)
87a0f97e06SSam RavnborgKBUILD_CFLAGS	+= -pipe -fno-strength-reduce -Wno-sign-compare
88222d394dSSam RavnborgKBUILD_AFLAGS	+= $(aflags-y)
891da177e4SLinus Torvalds
901da177e4SLinus TorvaldsOBJCOPYFLAGS	:= -O binary
911da177e4SLinus TorvaldsLDFLAGS_vmlinux := -e start
921da177e4SLinus Torvalds
931844c9bcSMartin Schwidefskyhead-y		:= arch/s390/kernel/head.o
941844c9bcSMartin Schwidefskyhead-y		+= arch/s390/kernel/$(if $(CONFIG_64BIT),head64.o,head31.o)
951844c9bcSMartin Schwidefskyhead-y		+= arch/s390/kernel/init_task.o
961da177e4SLinus Torvalds
97*01485943SHeiko Carstens# See arch/s390/Kbuild for content of core part of the kernel
98*01485943SHeiko Carstenscore-y		+= arch/s390/
99155af2f9SHans-Joachim Picht
1004562c9ffSMichael Holzheulibs-y		+= arch/s390/lib/
1011da177e4SLinus Torvaldsdrivers-y	+= drivers/s390/
1024562c9ffSMichael Holzheudrivers-$(CONFIG_MATHEMU) += arch/s390/math-emu/
1031da177e4SLinus Torvalds
1041da177e4SLinus Torvalds# must be linked after kernel
1051da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)	+= arch/s390/oprofile/
1061da177e4SLinus Torvalds
1074562c9ffSMichael Holzheuboot		:= arch/s390/boot
1081da177e4SLinus Torvalds
1091844c9bcSMartin Schwidefskyall: image bzImage
1101da177e4SLinus Torvalds
1111da177e4SLinus Torvaldsinstall: vmlinux
1121da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $@
1131da177e4SLinus Torvalds
1141844c9bcSMartin Schwidefskyimage bzImage: vmlinux
1151da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
1161da177e4SLinus Torvalds
117411ed322SMichael Holzheuzfcpdump:
118411ed322SMichael Holzheu	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
119411ed322SMichael Holzheu
120f3cb31e4SHendrik Bruecknervdso_install:
121f3cb31e4SHendrik Bruecknerifeq ($(CONFIG_64BIT),y)
122f3cb31e4SHendrik Brueckner	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
123f3cb31e4SHendrik Bruecknerendif
124f3cb31e4SHendrik Brueckner	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
125f3cb31e4SHendrik Brueckner
1261da177e4SLinus Torvaldsarchclean:
1271da177e4SLinus Torvalds	$(Q)$(MAKE) $(clean)=$(boot)
1281da177e4SLinus Torvalds
1291da177e4SLinus Torvalds# Don't use tabs in echo arguments
1301da177e4SLinus Torvaldsdefine archhelp
1311da177e4SLinus Torvalds  echo  '* image           - Kernel image for IPL ($(boot)/image)'
1321844c9bcSMartin Schwidefsky  echo	'* bzImage         - Compressed kernel image for IPL ($(boot)/bzImage)'
1331da177e4SLinus Torvaldsendef
134