xref: /linux/arch/s390/Makefile (revision 347a8dc3b815f0c0fa62a1df075184ffe4cbdcf1)
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
16*347a8dc3SMartin 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__
23*347a8dc3SMartin 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)
361da177e4SLinus Torvalds
371da177e4SLinus Torvalds# old style option for packed stacks
381da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mkernel-backchain),y)
391da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
401da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
411da177e4SLinus Torvaldscflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
421da177e4SLinus Torvaldsaflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
431da177e4SLinus Torvaldsifdef CONFIG_SMALL_STACK
441da177e4SLinus TorvaldsSTACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
451da177e4SLinus Torvaldsendif
461da177e4SLinus Torvaldsendif
471da177e4SLinus Torvalds
481da177e4SLinus Torvalds# new style option for packed stacks
491da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mpacked-stack),y)
501da177e4SLinus Torvaldscflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
511da177e4SLinus Torvaldsaflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
521da177e4SLinus Torvaldscflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
531da177e4SLinus Torvaldsaflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
541da177e4SLinus Torvaldsifdef CONFIG_SMALL_STACK
551da177e4SLinus TorvaldsSTACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
561da177e4SLinus Torvaldsendif
571da177e4SLinus Torvaldsendif
581da177e4SLinus Torvalds
591da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
601da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
611da177e4SLinus Torvaldscflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
621da177e4SLinus Torvaldsendif
631da177e4SLinus Torvalds
641da177e4SLinus Torvaldsifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
651da177e4SLinus Torvaldscflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack
661da177e4SLinus Torvaldscflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE)
671da177e4SLinus Torvaldsendif
681da177e4SLinus Torvalds
691da177e4SLinus TorvaldsCFLAGS		+= -mbackchain -msoft-float $(cflags-y)
701da177e4SLinus TorvaldsCFLAGS		+= $(call cc-option,-finline-limit=10000)
711da177e4SLinus TorvaldsCFLAGS 		+= -pipe -fno-strength-reduce -Wno-sign-compare
721da177e4SLinus TorvaldsAFLAGS		+= $(aflags-y)
731da177e4SLinus Torvalds
741da177e4SLinus TorvaldsOBJCOPYFLAGS	:= -O binary
751da177e4SLinus TorvaldsLDFLAGS_vmlinux := -e start
761da177e4SLinus Torvalds
770ad775dbSHeiko Carstenshead-y		:= arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
781da177e4SLinus Torvalds
791da177e4SLinus Torvaldscore-y		+= arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/ arch/$(ARCH)/crypto/ \
801da177e4SLinus Torvalds		   arch/$(ARCH)/appldata/
811da177e4SLinus Torvaldslibs-y		+= arch/$(ARCH)/lib/
821da177e4SLinus Torvaldsdrivers-y	+= drivers/s390/
831da177e4SLinus Torvaldsdrivers-$(CONFIG_MATHEMU) += arch/$(ARCH)/math-emu/
841da177e4SLinus Torvalds
851da177e4SLinus Torvalds# must be linked after kernel
861da177e4SLinus Torvaldsdrivers-$(CONFIG_OPROFILE)	+= arch/s390/oprofile/
871da177e4SLinus Torvalds
881da177e4SLinus Torvaldsboot		:= arch/$(ARCH)/boot
891da177e4SLinus Torvalds
901da177e4SLinus Torvaldsall: image
911da177e4SLinus Torvalds
921da177e4SLinus Torvaldsinstall: vmlinux
931da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $@
941da177e4SLinus Torvalds
951da177e4SLinus Torvaldsimage: vmlinux
961da177e4SLinus Torvalds	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
971da177e4SLinus Torvalds
981da177e4SLinus Torvaldsarchclean:
991da177e4SLinus Torvalds	$(Q)$(MAKE) $(clean)=$(boot)
1001da177e4SLinus Torvalds
1011da177e4SLinus Torvalds# Don't use tabs in echo arguments
1021da177e4SLinus Torvaldsdefine archhelp
1031da177e4SLinus Torvalds  echo  '* image           - Kernel image for IPL ($(boot)/image)'
1041da177e4SLinus Torvaldsendef
105