]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blame - arch/ppc64/Makefile
ppc64: use checksum_64.S from powerpc
[mirror_ubuntu-artful-kernel.git] / arch / ppc64 / Makefile
CommitLineData
1da177e4
LT
1# This file is included by the global makefile so that you can add your own
2# architecture-specific flags and dependencies. Remember to do have actions
3# for "archclean" and "archdep" for cleaning up and making dependencies for
4# this architecture
5#
6# This file is subject to the terms and conditions of the GNU General Public
7# License. See the file "COPYING" in the main directory of this archive
8# for more details.
9#
10# Copyright (C) 1994 by Linus Torvalds
11# Changes for PPC by Gary Thomas
12# Rewritten by Cort Dougan and Paul Mackerras
13# Adjusted for PPC64 by Tom Gall
14#
15
16KERNELLOAD := 0xc000000000000000
17
18# Set default 32 bits cross compilers for vdso and boot wrapper
19CROSS32_COMPILE ?=
20
21CROSS32CC := $(CROSS32_COMPILE)gcc
22CROSS32AS := $(CROSS32_COMPILE)as
23CROSS32LD := $(CROSS32_COMPILE)ld
24CROSS32OBJCOPY := $(CROSS32_COMPILE)objcopy
25
26# If we have a biarch compiler, use it for 32 bits cross compile if
27# CROSS32_COMPILE wasn't explicitely defined, and add proper explicit
28# target type to target compilers
29
30HAS_BIARCH := $(call cc-option-yn, -m64)
31ifeq ($(HAS_BIARCH),y)
32ifeq ($(CROSS32_COMPILE),)
33CROSS32CC := $(CC) -m32
34CROSS32AS := $(AS) -a32
35CROSS32LD := $(LD) -m elf32ppc
36CROSS32OBJCOPY := $(OBJCOPY)
37endif
723e2b35
SL
38override AS += -a64
39override LD += -m elf64ppc
40override CC += -m64
1da177e4
LT
41endif
42
43export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
44
45new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
46
47ifeq ($(new_nm),y)
48NM := $(NM) --synthetic
49
50endif
51
3352ae5d 52CHECKFLAGS += -m64 -D__powerpc__ -D__powerpc64__
1da177e4
LT
53
54LDFLAGS := -m elf64ppc
55LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
56CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \
57 -mcall-aixdesc
45e2a6e4 58# Temporary hack until we have migrated to asm-powerpc
b35b7072 59CPPFLAGS += -Iarch/$(ARCH)/include
1da177e4 60
52292c9b
BH
61GCC_VERSION := $(call cc-version)
62GCC_BROKEN_VEC := $(shell if [ $(GCC_VERSION) -lt 0400 ] ; then echo "y"; fi ;)
63
1da177e4
LT
64ifeq ($(CONFIG_POWER4_ONLY),y)
65ifeq ($(CONFIG_ALTIVEC),y)
52292c9b 66ifeq ($(GCC_BROKEN_VEC),y)
1da177e4
LT
67 CFLAGS += $(call cc-option,-mcpu=970)
68else
69 CFLAGS += $(call cc-option,-mcpu=power4)
70endif
52292c9b
BH
71else
72 CFLAGS += $(call cc-option,-mcpu=power4)
73endif
1da177e4
LT
74else
75 CFLAGS += $(call cc-option,-mtune=power4)
76endif
77
78# Enable unit-at-a-time mode when possible. It shrinks the
79# kernel considerably.
80CFLAGS += $(call cc-option,-funit-at-a-time)
81
82head-y := arch/ppc64/kernel/head.o
25c8a78b 83head-y += arch/powerpc/kernel/fpu.o
640768ee 84head-y += arch/powerpc/kernel/entry_64.o
1da177e4
LT
85
86libs-y += arch/ppc64/lib/
bd142b70 87core-y += arch/ppc64/kernel/ arch/powerpc/kernel/
ab1f9dac 88core-y += arch/powerpc/mm/
d85b525e 89core-y += arch/powerpc/sysdev/
ba0dd617 90core-y += arch/powerpc/platforms/
1a3c061e 91core-y += arch/powerpc/lib/
1da177e4 92core-$(CONFIG_XMON) += arch/ppc64/xmon/
86a5cddb 93drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
1da177e4
LT
94
95boot := arch/ppc64/boot
96
a24c8481
GL
97boottargets-$(CONFIG_PPC_PSERIES) += zImage zImage.initrd
98boottargets-$(CONFIG_PPC_PMAC) += zImage.vmode zImage.initrd.vmode
99boottargets-$(CONFIG_PPC_MAPLE) += zImage zImage.initrd
100boottargets-$(CONFIG_PPC_ISERIES) += vmlinux.sminitrd vmlinux.initrd vmlinux.sm
101boottargets-$(CONFIG_PPC_BPA) += zImage zImage.initrd
102$(boottargets-y): vmlinux
1da177e4
LT
103 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
104
105bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage
106bootimage-$(CONFIG_PPC_PMAC) := vmlinux
107bootimage-$(CONFIG_PPC_MAPLE) := $(boot)/zImage
fef1c772 108bootimage-$(CONFIG_PPC_BPA) := zImage
1da177e4
LT
109bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
110BOOTIMAGE := $(bootimage-y)
111install: vmlinux
112 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
113
114defaultimage-$(CONFIG_PPC_PSERIES) := zImage
40da47e1 115defaultimage-$(CONFIG_PPC_PMAC) := zImage.vmode
1da177e4
LT
116defaultimage-$(CONFIG_PPC_MAPLE) := zImage
117defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
118KBUILD_IMAGE := $(defaultimage-y)
119all: $(KBUILD_IMAGE)
120
121archclean:
122 $(Q)$(MAKE) $(clean)=$(boot)
b35b7072
SR
123 # Temporary hack until we have migrated to asm-powerpc
124 $(Q)rm -rf arch/$(ARCH)/include
1da177e4 125
1da177e4 126
45e2a6e4 127# Temporary hack until we have migrated to asm-powerpc
b35b7072
SR
128include/asm: arch/$(ARCH)/include/asm
129arch/$(ARCH)/include/asm:
130 $(Q)if [ ! -d arch/$(ARCH)/include ]; then mkdir -p arch/$(ARCH)/include; fi
131 $(Q)ln -fsn $(srctree)/include/asm-powerpc arch/$(ARCH)/include/asm
45e2a6e4 132
1da177e4 133define archhelp
a24c8481
GL
134 echo ' zImage.vmode - Compressed kernel image (arch/$(ARCH)/boot/zImage.vmode)'
135 echo ' zImage.initrd.vmode - Compressed kernel image with initrd attached,'
136 echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
137 echo ' (arch/$(ARCH)/boot/zImage.initrd.vmode)'
138 echo ' zImage - zImage for pSeries machines'
139 echo ' zImage.initrd - zImage with initrd for pSeries machines'
1da177e4 140endef