blob: 5deb9f7544a1da444b1ba0034685d511c74fc67b [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
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 Schwidefsky347a8dc2006-01-06 00:19:28 -080016ifndef CONFIG_64BIT
Linus Torvalds1da177e2005-04-16 15:20:36 -070017LDFLAGS := -m elf_s390
18CFLAGS += -m31
19AFLAGS += -m31
20UTS_MACHINE := s390
21STACK_SIZE := 8192
viro@ZenIV.linux.org.ukd310a352005-09-09 16:56:05 +010022CHECKFLAGS += -D__s390__
Martin Schwidefsky347a8dc2006-01-06 00:19:28 -080023else
Linus Torvalds1da177e2005-04-16 15:20:36 -070024LDFLAGS := -m elf64_s390
25MODFLAGS += -fpic -D__PIC__
26CFLAGS += -m64
27AFLAGS += -m64
28UTS_MACHINE := s390x
29STACK_SIZE := 16384
viro@ZenIV.linux.org.ukd310a352005-09-09 16:56:05 +010030CHECKFLAGS += -D__s390__ -D__s390x__
Linus Torvalds1da177e2005-04-16 15:20:36 -070031endif
32
33cflags-$(CONFIG_MARCH_G5) += $(call cc-option,-march=g5)
34cflags-$(CONFIG_MARCH_Z900) += $(call cc-option,-march=z900)
35cflags-$(CONFIG_MARCH_Z990) += $(call cc-option,-march=z990)
Christian Borntraeger0efa4702006-09-28 16:55:46 +020036cflags-$(CONFIG_MARCH_Z9_109) += $(call cc-option,-march=z9-109)
Linus Torvalds1da177e2005-04-16 15:20:36 -070037
Heiko Carstenscbbd1fa2006-07-03 00:24:38 -070038#
39# Prevent tail-call optimizations, to get clearer backtraces:
40#
41cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
42
Linus Torvalds1da177e2005-04-16 15:20:36 -070043# old style option for packed stacks
44ifeq ($(call cc-option-yn,-mkernel-backchain),y)
45cflags-$(CONFIG_PACK_STACK) += -mkernel-backchain -D__PACK_STACK
46aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
47cflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
48aflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
49ifdef CONFIG_SMALL_STACK
50STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
51endif
52endif
53
54# new style option for packed stacks
55ifeq ($(call cc-option-yn,-mpacked-stack),y)
56cflags-$(CONFIG_PACK_STACK) += -mpacked-stack -D__PACK_STACK
57aflags-$(CONFIG_PACK_STACK) += -D__PACK_STACK
58cflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
59aflags-$(CONFIG_SMALL_STACK) += -D__SMALL_STACK
60ifdef CONFIG_SMALL_STACK
61STACK_SIZE := $(shell echo $$(($(STACK_SIZE)/2)) )
62endif
63endif
64
65ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
66cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
67cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
68endif
69
70ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
71cflags-$(CONFIG_WARN_STACK) += -mwarn-dynamicstack
72cflags-$(CONFIG_WARN_STACK) += -mwarn-framesize=$(CONFIG_WARN_STACK_SIZE)
73endif
74
75CFLAGS += -mbackchain -msoft-float $(cflags-y)
Linus Torvalds1da177e2005-04-16 15:20:36 -070076CFLAGS += -pipe -fno-strength-reduce -Wno-sign-compare
77AFLAGS += $(aflags-y)
78
79OBJCOPYFLAGS := -O binary
80LDFLAGS_vmlinux := -e start
81
Heiko Carstens0ad775d2005-11-07 00:59:12 -080082head-y := arch/$(ARCH)/kernel/head.o arch/$(ARCH)/kernel/init_task.o
Linus Torvalds1da177e2005-04-16 15:20:36 -070083
84core-y += arch/$(ARCH)/mm/ arch/$(ARCH)/kernel/ arch/$(ARCH)/crypto/ \
Michael Holzheu24bbb1f2006-06-23 02:05:06 -070085 arch/$(ARCH)/appldata/ arch/$(ARCH)/hypfs/
Linus Torvalds1da177e2005-04-16 15:20:36 -070086libs-y += arch/$(ARCH)/lib/
87drivers-y += drivers/s390/
88drivers-$(CONFIG_MATHEMU) += arch/$(ARCH)/math-emu/
89
90# must be linked after kernel
91drivers-$(CONFIG_OPROFILE) += arch/s390/oprofile/
92
93boot := arch/$(ARCH)/boot
94
95all: image
96
97install: vmlinux
98 $(Q)$(MAKE) $(build)=$(boot) $@
99
100image: vmlinux
101 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
102
103archclean:
104 $(Q)$(MAKE) $(clean)=$(boot)
105
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106# Don't use tabs in echo arguments
107define archhelp
108 echo '* image - Kernel image for IPL ($(boot)/image)'
109endef