Blame view

arch/s390/Makefile 4.06 KB
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
  #
  # s390/Makefile
  #
  # This file is included by the global makefile so that you can add your own
  # architecture-specific flags and dependencies. Remember to do have actions
  # for "archclean" and "archdep" for cleaning up and making dependencies for
  # this architecture
  #
  # This file is subject to the terms and conditions of the GNU General Public
  # License.  See the file "COPYING" in the main directory of this archive
  # for more details.
  #
  # Copyright (C) 1994 by Linus Torvalds
  #
1844c9bc0   Martin Schwidefsky   [S390] add suppor...
15
  LD_BFD		:= elf64-s390
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
16
  LDFLAGS		:= -m elf64_s390
7bdc229fa   Martin Schwidefsky   s390: use -fPIC f...
17
18
  KBUILD_AFLAGS_MODULE += -fPIC
  KBUILD_CFLAGS_MODULE += -fPIC
a0f97e06a   Sam Ravnborg   kbuild: enable 'm...
19
  KBUILD_CFLAGS	+= -m64
222d394d3   Sam Ravnborg   kbuild: enable 'm...
20
  KBUILD_AFLAGS	+= -m64
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
21
22
  UTS_MACHINE	:= s390x
  STACK_SIZE	:= 16384
d310a35a4   Al Viro   [PATCH] missing C...
23
  CHECKFLAGS	+= -D__s390__ -D__s390x__
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
24

1844c9bc0   Martin Schwidefsky   [S390] add suppor...
25
  export LD_BFD
0f1b1ff54   Heiko Carstens   s390: pass march ...
26
27
28
29
30
31
  mflags-$(CONFIG_MARCH_Z900)   := -march=z900
  mflags-$(CONFIG_MARCH_Z990)   := -march=z990
  mflags-$(CONFIG_MARCH_Z9_109) := -march=z9-109
  mflags-$(CONFIG_MARCH_Z10)    := -march=z10
  mflags-$(CONFIG_MARCH_Z196)   := -march=z196
  mflags-$(CONFIG_MARCH_ZEC12)  := -march=zEC12
f8b2dcbd9   Martin Schwidefsky   s390: add z13 cod...
32
  mflags-$(CONFIG_MARCH_Z13)   := -march=z13
0f1b1ff54   Heiko Carstens   s390: pass march ...
33

22362a0e2   Martin Schwidefsky   s390/sclp: conver...
34
  export CC_FLAGS_MARCH := $(mflags-y)
0f1b1ff54   Heiko Carstens   s390: pass march ...
35
36
  aflags-y += $(mflags-y)
  cflags-y += $(mflags-y)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
37

1db9e0513   Heiko Carstens   s390: allow to se...
38
39
40
41
42
43
  cflags-$(CONFIG_MARCH_Z900_TUNE)	+= -mtune=z900
  cflags-$(CONFIG_MARCH_Z990_TUNE)	+= -mtune=z990
  cflags-$(CONFIG_MARCH_Z9_109_TUNE)	+= -mtune=z9-109
  cflags-$(CONFIG_MARCH_Z10_TUNE)		+= -mtune=z10
  cflags-$(CONFIG_MARCH_Z196_TUNE)	+= -mtune=z196
  cflags-$(CONFIG_MARCH_ZEC12_TUNE)	+= -mtune=zEC12
f8b2dcbd9   Martin Schwidefsky   s390: add z13 cod...
44
  cflags-$(CONFIG_MARCH_Z13_TUNE)	+= -mtune=z13
1db9e0513   Heiko Carstens   s390: allow to se...
45

1681cedae   Christian Borntraeger   [S390] set KBUILD...
46
47
  #KBUILD_IMAGE is necessary for make rpm
  KBUILD_IMAGE	:=arch/s390/boot/image
cbbd1fa72   Heiko Carstens   [PATCH] lockdep: ...
48
49
50
51
  #
  # Prevent tail-call optimizations, to get clearer backtraces:
  #
  cflags-$(CONFIG_FRAME_POINTER) += -fno-optimize-sibling-calls
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
52
53
54
55
  # old style option for packed stacks
  ifeq ($(call cc-option-yn,-mkernel-backchain),y)
  cflags-$(CONFIG_PACK_STACK)  += -mkernel-backchain -D__PACK_STACK
  aflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
56
57
58
59
60
61
  endif
  
  # new style option for packed stacks
  ifeq ($(call cc-option-yn,-mpacked-stack),y)
  cflags-$(CONFIG_PACK_STACK)  += -mpacked-stack -D__PACK_STACK
  aflags-$(CONFIG_PACK_STACK)  += -D__PACK_STACK
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
62
63
64
65
  endif
  
  ifeq ($(call cc-option-yn,-mstack-size=8192 -mstack-guard=128),y)
  cflags-$(CONFIG_CHECK_STACK) += -mstack-size=$(STACK_SIZE)
be7962856   Martin Schwidefsky   [S390] Improved k...
66
  ifneq ($(call cc-option-yn,-mstack-size=8192),y)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
67
68
  cflags-$(CONFIG_CHECK_STACK) += -mstack-guard=$(CONFIG_STACK_GUARD)
  endif
be7962856   Martin Schwidefsky   [S390] Improved k...
69
  endif
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
70
71
  
  ifeq ($(call cc-option-yn,-mwarn-dynamicstack),y)
2c190da47   Jan Glauber   [S390] remove red...
72
  cflags-$(CONFIG_WARN_DYNAMIC_STACK) += -mwarn-dynamicstack
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
73
  endif
e6d60b368   Heiko Carstens   s390/ftrace: hotp...
74
75
76
77
78
79
80
81
82
  ifdef CONFIG_FUNCTION_TRACER
  # make use of hotpatch feature if the compiler supports it
  cc_hotpatch	:= -mhotpatch=0,3
  ifeq ($(call cc-option-yn,$(cc_hotpatch)),y)
  CC_FLAGS_FTRACE := $(cc_hotpatch)
  KBUILD_AFLAGS	+= -DCC_USING_HOTPATCH
  KBUILD_CFLAGS	+= -DCC_USING_HOTPATCH
  endif
  endif
a0f97e06a   Sam Ravnborg   kbuild: enable 'm...
83
84
  KBUILD_CFLAGS	+= -mbackchain -msoft-float $(cflags-y)
  KBUILD_CFLAGS	+= -pipe -fno-strength-reduce -Wno-sign-compare
222d394d3   Sam Ravnborg   kbuild: enable 'm...
85
  KBUILD_AFLAGS	+= $(aflags-y)
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
86
87
  
  OBJCOPYFLAGS	:= -O binary
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
88

1844c9bc0   Martin Schwidefsky   [S390] add suppor...
89
  head-y		:= arch/s390/kernel/head.o
5a79859ae   Heiko Carstens   s390: remove 31 b...
90
  head-y		+= arch/s390/kernel/head64.o
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
91

014859430   Heiko Carstens   [S390] standardiz...
92
93
  # See arch/s390/Kbuild for content of core part of the kernel
  core-y		+= arch/s390/
155af2f95   Hans-Joachim Picht   [S390] s390: hibe...
94

4562c9fff   Michael Holzheu   [S390] Replace $(...
95
  libs-y		+= arch/s390/lib/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
96
  drivers-y	+= drivers/s390/
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
97
98
99
  
  # must be linked after kernel
  drivers-$(CONFIG_OPROFILE)	+= arch/s390/oprofile/
4562c9fff   Michael Holzheu   [S390] Replace $(...
100
  boot		:= arch/s390/boot
c30f6828f   Heiko Carstens   s390/facilities: ...
101
  tools		:= arch/s390/tools
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
102

1844c9bc0   Martin Schwidefsky   [S390] add suppor...
103
  all: image bzImage
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
104
105
106
  
  install: vmlinux
  	$(Q)$(MAKE) $(build)=$(boot) $@
1844c9bc0   Martin Schwidefsky   [S390] add suppor...
107
  image bzImage: vmlinux
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
108
  	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
411ed3225   Michael Holzheu   [S390] zfcpdump s...
109
110
  zfcpdump:
  	$(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
f3cb31e49   Hendrik Brueckner   [S390] vdso: add ...
111
  vdso_install:
f3cb31e49   Hendrik Brueckner   [S390] vdso: add ...
112
  	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso64 $@
f3cb31e49   Hendrik Brueckner   [S390] vdso: add ...
113
  	$(Q)$(MAKE) $(build)=arch/$(ARCH)/kernel/vdso32 $@
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
114
115
  archclean:
  	$(Q)$(MAKE) $(clean)=$(boot)
c30f6828f   Heiko Carstens   s390/facilities: ...
116
117
118
119
  	$(Q)$(MAKE) $(clean)=$(tools)
  
  archprepare:
  	$(Q)$(MAKE) $(build)=$(tools) include/generated/facilities.h
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
120

1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
121
122
123
  # Don't use tabs in echo arguments
  define archhelp
    echo  '* image           - Kernel image for IPL ($(boot)/image)'
1844c9bc0   Martin Schwidefsky   [S390] add suppor...
124
    echo	'* bzImage         - Compressed kernel image for IPL ($(boot)/bzImage)'
b8eecf36a   Michael Holzheu   s390: add 'instal...
125
126
127
128
    echo	'  install         - Install kernel using'
    echo	'                    (your) ~/bin/$(INSTALLKERNEL) or'
    echo	'                    (distribution) /sbin/$(INSTALLKERNEL) or'
    echo	'                    install to $$(INSTALL_PATH)'
1da177e4c   Linus Torvalds   Linux-2.6.12-rc2
129
  endef