Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | # |
| 2 | # s390/Makefile |
| 3 | # |
| 4 | # This file is included by the global makefile so that you can add your own |
| 5 | # architecture-specific flags and dependencies. Remember to do have actions |
| 6 | # for "archclean" and "archdep" for cleaning up and making dependencies for |
| 7 | # this architecture |
| 8 | # |
| 9 | # This file is subject to the terms and conditions of the GNU General Public |
| 10 | # License. See the file "COPYING" in the main directory of this archive |
| 11 | # for more details. |
| 12 | # |
| 13 | # Copyright (C) 1994 by Linus Torvalds |
| 14 | # |
| 15 | |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 16 | LD_BFD := elf64-s390 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 17 | LDFLAGS := -m elf64_s390 |
Martin Schwidefsky | 7bdc229 | 2013-01-11 15:26:01 +0100 | [diff] [blame] | 18 | KBUILD_AFLAGS_MODULE += -fPIC |
| 19 | KBUILD_CFLAGS_MODULE += -fPIC |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 20 | KBUILD_CFLAGS += -m64 |
Sam Ravnborg | 222d394 | 2007-10-15 21:59:31 +0200 | [diff] [blame] | 21 | KBUILD_AFLAGS += -m64 |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 22 | UTS_MACHINE := s390x |
| 23 | STACK_SIZE := 16384 |
viro@ZenIV.linux.org.uk | d310a35a | 2005-09-09 16:56:05 +0100 | [diff] [blame] | 24 | CHECKFLAGS += -D__s390__ -D__s390x__ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 26 | export LD_BFD |
| 27 | |
Heiko Carstens | 0f1b1ff | 2014-08-14 16:06:02 +0200 | [diff] [blame] | 28 | mflags-$(CONFIG_MARCH_Z900) := -march=z900 |
| 29 | mflags-$(CONFIG_MARCH_Z990) := -march=z990 |
| 30 | mflags-$(CONFIG_MARCH_Z9_109) := -march=z9-109 |
| 31 | mflags-$(CONFIG_MARCH_Z10) := -march=z10 |
| 32 | mflags-$(CONFIG_MARCH_Z196) := -march=z196 |
| 33 | mflags-$(CONFIG_MARCH_ZEC12) := -march=zEC12 |
Martin Schwidefsky | f8b2dcb | 2015-01-14 17:50:19 +0100 | [diff] [blame] | 34 | mflags-$(CONFIG_MARCH_Z13) := -march=z13 |
Heiko Carstens | 0f1b1ff | 2014-08-14 16:06:02 +0200 | [diff] [blame] | 35 | |
Martin Schwidefsky | 22362a0 | 2015-07-08 10:20:04 +0200 | [diff] [blame] | 36 | export CC_FLAGS_MARCH := $(mflags-y) |
| 37 | |
Heiko Carstens | 0f1b1ff | 2014-08-14 16:06:02 +0200 | [diff] [blame] | 38 | aflags-y += $(mflags-y) |
| 39 | cflags-y += $(mflags-y) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 40 | |
Heiko Carstens | 1db9e05 | 2013-10-30 12:12:50 +0100 | [diff] [blame] | 41 | cflags-$(CONFIG_MARCH_Z900_TUNE) += -mtune=z900 |
| 42 | cflags-$(CONFIG_MARCH_Z990_TUNE) += -mtune=z990 |
| 43 | cflags-$(CONFIG_MARCH_Z9_109_TUNE) += -mtune=z9-109 |
| 44 | cflags-$(CONFIG_MARCH_Z10_TUNE) += -mtune=z10 |
| 45 | cflags-$(CONFIG_MARCH_Z196_TUNE) += -mtune=z196 |
| 46 | cflags-$(CONFIG_MARCH_ZEC12_TUNE) += -mtune=zEC12 |
Martin Schwidefsky | f8b2dcb | 2015-01-14 17:50:19 +0100 | [diff] [blame] | 47 | cflags-$(CONFIG_MARCH_Z13_TUNE) += -mtune=z13 |
Heiko Carstens | 1db9e05 | 2013-10-30 12:12:50 +0100 | [diff] [blame] | 48 | |
Christian Borntraeger | 1681ced | 2006-12-04 15:40:49 +0100 | [diff] [blame] | 49 | #KBUILD_IMAGE is necessary for make rpm |
| 50 | KBUILD_IMAGE :=arch/s390/boot/image |
| 51 | |
Heiko Carstens | cbbd1fa | 2006-07-03 00:24:38 -0700 | [diff] [blame] | 52 | # |
| 53 | # Prevent tail-call optimizations, to get clearer backtraces: |
| 54 | # |
| 55 | cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls |
| 56 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | # old style option for packed stacks |
| 58 | ifeq ($(call cc-option-yn,-mkernel-backchain),y) |
| 59 | cflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK |
| 60 | aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 61 | endif |
| 62 | |
| 63 | # new style option for packed stacks |
| 64 | ifeq ($(call cc-option-yn,-mpacked-stack),y) |
| 65 | cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK |
| 66 | aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 67 | endif |
| 68 | |
| 69 | ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y) |
| 70 | cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE) |
Martin Schwidefsky | be79628 | 2007-04-27 16:01:46 +0200 | [diff] [blame] | 71 | ifneq ($(call cc-option-yn,-mstack-size=8192),y) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD) |
| 73 | endif |
Martin Schwidefsky | be79628 | 2007-04-27 16:01:46 +0200 | [diff] [blame] | 74 | endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | |
| 76 | ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y) |
Jan Glauber | 2c190da | 2011-03-15 17:08:19 +0100 | [diff] [blame] | 77 | cflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 78 | endif |
| 79 | |
Heiko Carstens | e6d60b3 | 2015-01-09 13:08:28 +0100 | [diff] [blame] | 80 | ifdef CONFIG_FUNCTION_TRACER |
| 81 | # make use of hotpatch feature if the compiler supports it |
| 82 | cc_hotpatch := -mhotpatch=0,3 |
| 83 | ifeq ($(call cc-option-yn,$(cc_hotpatch)),y) |
| 84 | CC_FLAGS_FTRACE := $(cc_hotpatch) |
| 85 | KBUILD_AFLAGS += -DCC_USING_HOTPATCH |
| 86 | KBUILD_CFLAGS += -DCC_USING_HOTPATCH |
| 87 | endif |
| 88 | endif |
| 89 | |
Sam Ravnborg | a0f97e0 | 2007-10-14 22:21:35 +0200 | [diff] [blame] | 90 | KBUILD_CFLAGS += -mbackchain -msoft-float $(cflags-y) |
| 91 | KBUILD_CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare |
Sam Ravnborg | 222d394 | 2007-10-15 21:59:31 +0200 | [diff] [blame] | 92 | KBUILD_AFLAGS += $(aflags-y) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | |
| 94 | OBJCOPYFLAGS := -O binary |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 95 | |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 96 | head-y := arch/s390/kernel/head.o |
Heiko Carstens | 5a79859 | 2015-02-12 13:08:27 +0100 | [diff] [blame] | 97 | head-y += arch/s390/kernel/head64.o |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 98 | |
Heiko Carstens | 0148594 | 2010-10-25 16:10:09 +0200 | [diff] [blame] | 99 | # See arch/s390/Kbuild for content of core part of the kernel |
| 100 | core-y += arch/s390/ |
Hans-Joachim Picht | 155af2f | 2009-06-16 10:30:52 +0200 | [diff] [blame] | 101 | |
Michael Holzheu | 4562c9f | 2007-02-21 10:55:46 +0100 | [diff] [blame] | 102 | libs-y += arch/s390/lib/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 103 | drivers-y += drivers/s390/ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 104 | |
| 105 | # must be linked after kernel |
| 106 | drivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/ |
| 107 | |
Michael Holzheu | 4562c9f | 2007-02-21 10:55:46 +0100 | [diff] [blame] | 108 | boot := arch/s390/boot |
Heiko Carstens | c30f682 | 2015-02-02 07:08:44 +0100 | [diff] [blame] | 109 | tools := arch/s390/tools |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 110 | |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 111 | all: image bzImage |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 112 | |
| 113 | install: vmlinux |
| 114 | $(Q)$(MAKE) $(build)=$(boot) $@ |
| 115 | |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 116 | image bzImage: vmlinux |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 117 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
| 118 | |
Michael Holzheu | 411ed32 | 2007-04-27 16:01:49 +0200 | [diff] [blame] | 119 | zfcpdump: |
| 120 | $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@ |
| 121 | |
Hendrik Brueckner | f3cb31e | 2010-05-17 10:00:09 +0200 | [diff] [blame] | 122 | vdso_install: |
Hendrik Brueckner | f3cb31e | 2010-05-17 10:00:09 +0200 | [diff] [blame] | 123 | $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@ |
Hendrik Brueckner | f3cb31e | 2010-05-17 10:00:09 +0200 | [diff] [blame] | 124 | $(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@ |
| 125 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 126 | archclean: |
| 127 | $(Q)$(MAKE) $(clean)=$(boot) |
Heiko Carstens | c30f682 | 2015-02-02 07:08:44 +0100 | [diff] [blame] | 128 | $(Q)$(MAKE) $(clean)=$(tools) |
| 129 | |
| 130 | archprepare: |
| 131 | $(Q)$(MAKE) $(build)=$(tools) include/generated/facilities.h |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 132 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 133 | # Don't use tabs in echo arguments |
| 134 | define archhelp |
| 135 | echo '* image - Kernel image for IPL ($(boot)/image)' |
Martin Schwidefsky | 1844c9b | 2010-02-26 22:37:53 +0100 | [diff] [blame] | 136 | echo '* bzImage - Compressed kernel image for IPL ($(boot)/bzImage)' |
Michael Holzheu | b8eecf3 | 2015-11-25 11:54:36 +0100 | [diff] [blame] | 137 | echo ' install - Install kernel using' |
| 138 | echo ' (your) ~/bin/$(INSTALLKERNEL) or' |
| 139 | echo ' (distribution) /sbin/$(INSTALLKERNEL) or' |
| 140 | echo ' install to $$(INSTALL_PATH)' |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 141 | endef |