Back to home page

LXR

 
 

    


0001 #
0002 # s390/Makefile
0003 #
0004 # This file is included by the global makefile so that you can add your own
0005 # architecture-specific flags and dependencies. Remember to do have actions
0006 # for "archclean" and "archdep" for cleaning up and making dependencies for
0007 # this architecture
0008 #
0009 # This file is subject to the terms and conditions of the GNU General Public
0010 # License.  See the file "COPYING" in the main directory of this archive
0011 # for more details.
0012 #
0013 # Copyright (C) 1994 by Linus Torvalds
0014 #
0015 
0016 LD_BFD          := elf64-s390
0017 LDFLAGS         := -m elf64_s390
0018 KBUILD_AFLAGS_MODULE += -fPIC
0019 KBUILD_CFLAGS_MODULE += -fPIC
0020 KBUILD_CFLAGS   += -m64
0021 KBUILD_AFLAGS   += -m64
0022 UTS_MACHINE     := s390x
0023 STACK_SIZE      := 16384
0024 CHECKFLAGS      += -D__s390__ -D__s390x__
0025 
0026 export LD_BFD
0027 
0028 mflags-$(CONFIG_MARCH_Z900)   := -march=z900
0029 mflags-$(CONFIG_MARCH_Z990)   := -march=z990
0030 mflags-$(CONFIG_MARCH_Z9_109) := -march=z9-109
0031 mflags-$(CONFIG_MARCH_Z10)    := -march=z10
0032 mflags-$(CONFIG_MARCH_Z196)   := -march=z196
0033 mflags-$(CONFIG_MARCH_ZEC12)  := -march=zEC12
0034 mflags-$(CONFIG_MARCH_Z13)   := -march=z13
0035 
0036 export CC_FLAGS_MARCH := $(mflags-y)
0037 
0038 aflags-y += $(mflags-y)
0039 cflags-y += $(mflags-y)
0040 
0041 cflags-$(CONFIG_MARCH_Z900_TUNE)        += -mtune=z900
0042 cflags-$(CONFIG_MARCH_Z990_TUNE)        += -mtune=z990
0043 cflags-$(CONFIG_MARCH_Z9_109_TUNE)      += -mtune=z9-109
0044 cflags-$(CONFIG_MARCH_Z10_TUNE)         += -mtune=z10
0045 cflags-$(CONFIG_MARCH_Z196_TUNE)        += -mtune=z196
0046 cflags-$(CONFIG_MARCH_ZEC12_TUNE)       += -mtune=zEC12
0047 cflags-$(CONFIG_MARCH_Z13_TUNE) += -mtune=z13
0048 
0049 cflags-y += -Wa,-I$(srctree)/arch/$(ARCH)/include
0050 
0051 #KBUILD_IMAGE is necessary for make rpm
0052 KBUILD_IMAGE    :=arch/s390/boot/image
0053 
0054 #
0055 # Prevent tail-call optimizations, to get clearer backtraces:
0056 #
0057 cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
0058 
0059 # old style option for packed stacks
0060 ifeq ($(call cc-option-yn,-mkernel-backchain),y)
0061 cflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
0062 aflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
0063 endif
0064 
0065 # new style option for packed stacks
0066 ifeq ($(call cc-option-yn,-mpacked-stack),y)
0067 cflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
0068 aflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
0069 endif
0070 
0071 ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
0072 cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
0073 ifneq ($(call cc-option-yn,-mstack-size=8192),y)
0074 cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
0075 endif
0076 endif
0077 
0078 ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
0079 cflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack
0080 endif
0081 
0082 ifdef CONFIG_FUNCTION_TRACER
0083 # make use of hotpatch feature if the compiler supports it
0084 cc_hotpatch     := -mhotpatch=0,3
0085 ifeq ($(call cc-option-yn,$(cc_hotpatch)),y)
0086 CC_FLAGS_FTRACE := $(cc_hotpatch)
0087 KBUILD_AFLAGS   += -DCC_USING_HOTPATCH
0088 KBUILD_CFLAGS   += -DCC_USING_HOTPATCH
0089 endif
0090 endif
0091 
0092 KBUILD_CFLAGS   += -mbackchain -msoft-float $(cflags-y)
0093 KBUILD_CFLAGS   += -pipe -fno-strength-reduce -Wno-sign-compare
0094 KBUILD_AFLAGS   += $(aflags-y)
0095 
0096 OBJCOPYFLAGS    := -O binary
0097 
0098 head-y          := arch/s390/kernel/head.o
0099 head-y          += arch/s390/kernel/head64.o
0100 
0101 # See arch/s390/Kbuild for content of core part of the kernel
0102 core-y          += arch/s390/
0103 
0104 libs-y          += arch/s390/lib/
0105 drivers-y       += drivers/s390/
0106 
0107 # must be linked after kernel
0108 drivers-$(CONFIG_OPROFILE)      += arch/s390/oprofile/
0109 
0110 boot            := arch/s390/boot
0111 tools           := arch/s390/tools
0112 
0113 all: image bzImage
0114 
0115 install: vmlinux
0116         $(Q)$(MAKE) $(build)=$(boot) $@
0117 
0118 image bzImage: vmlinux
0119         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
0120 
0121 zfcpdump:
0122         $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
0123 
0124 vdso_install:
0125         $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
0126         $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
0127 
0128 archclean:
0129         $(Q)$(MAKE) $(clean)=$(boot)
0130         $(Q)$(MAKE) $(clean)=$(tools)
0131 
0132 archprepare:
0133         $(Q)$(MAKE) $(build)=$(tools) include/generated/facilities.h
0134 
0135 # Don't use tabs in echo arguments
0136 define archhelp
0137   echo  '* image           - Kernel image for IPL ($(boot)/image)'
0138   echo  '* bzImage         - Compressed kernel image for IPL ($(boot)/bzImage)'
0139   echo  '  install         - Install kernel using'
0140   echo  '                    (your) ~/bin/$(INSTALLKERNEL) or'
0141   echo  '                    (distribution) /sbin/$(INSTALLKERNEL) or'
0142   echo  '                    install to $$(INSTALL_PATH)'
0143 endef