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
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
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
16 KERNELLOAD := 0xc000000000000000
18 # Set default 32 bits cross compilers for vdso and boot wrapper
21 CROSS32CC := $(CROSS32_COMPILE)gcc
22 CROSS32AS := $(CROSS32_COMPILE)as
23 CROSS32LD := $(CROSS32_COMPILE)ld
24 CROSS32OBJCOPY := $(CROSS32_COMPILE)objcopy
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
30 HAS_BIARCH := $(call cc-option-yn, -m64)
31 ifeq ($(HAS_BIARCH),y)
32 ifeq ($(CROSS32_COMPILE),)
33 CROSS32CC := $(CC) -m32
34 CROSS32AS := $(AS) -a32
35 CROSS32LD := $(LD) -m elf32ppc
36 CROSS32OBJCOPY := $(OBJCOPY)
39 LD := $(LD) -m elf64ppc
43 export CROSS32CC CROSS32AS CROSS32LD CROSS32OBJCOPY
45 new_nm := $(shell if $(NM) --help 2>&1 | grep -- '--synthetic' > /dev/null; then echo y; else echo n; fi)
48 NM := $(NM) --synthetic
52 CHECKFLAGS += -m64 -D__powerpc__
54 LDFLAGS := -m elf64ppc
55 LDFLAGS_vmlinux := -Bstatic -e $(KERNELLOAD) -Ttext $(KERNELLOAD)
56 CFLAGS += -msoft-float -pipe -mminimal-toc -mtraceback=none \
59 ifeq ($(CONFIG_POWER4_ONLY),y)
60 ifeq ($(CONFIG_ALTIVEC),y)
61 CFLAGS += $(call cc-option,-mcpu=970)
63 CFLAGS += $(call cc-option,-mcpu=power4)
66 CFLAGS += $(call cc-option,-mtune=power4)
69 # Enable unit-at-a-time mode when possible. It shrinks the
70 # kernel considerably.
71 CFLAGS += $(call cc-option,-funit-at-a-time)
73 head-y := arch/ppc64/kernel/head.o
75 libs-y += arch/ppc64/lib/
76 core-y += arch/ppc64/kernel/
77 core-y += arch/ppc64/mm/
78 core-$(CONFIG_XMON) += arch/ppc64/xmon/
79 drivers-$(CONFIG_OPROFILE) += arch/ppc64/oprofile/
81 boot := arch/ppc64/boot
83 boottarget-$(CONFIG_PPC_PSERIES) := zImage zImage.initrd
84 boottarget-$(CONFIG_PPC_MAPLE) := zImage zImage.initrd
85 boottarget-$(CONFIG_PPC_ISERIES) := vmlinux.sminitrd vmlinux.initrd vmlinux.sm
86 $(boottarget-y): vmlinux
87 $(Q)$(MAKE) $(build)=$(boot) $(boot)/$@
89 bootimage-$(CONFIG_PPC_PSERIES) := $(boot)/zImage
90 bootimage-$(CONFIG_PPC_PMAC) := vmlinux
91 bootimage-$(CONFIG_PPC_MAPLE) := $(boot)/zImage
92 bootimage-$(CONFIG_PPC_ISERIES) := vmlinux
93 BOOTIMAGE := $(bootimage-y)
95 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(BOOTIMAGE) $@
97 defaultimage-$(CONFIG_PPC_PSERIES) := zImage
98 defaultimage-$(CONFIG_PPC_PMAC) := vmlinux
99 defaultimage-$(CONFIG_PPC_MAPLE) := zImage
100 defaultimage-$(CONFIG_PPC_ISERIES) := vmlinux
101 KBUILD_IMAGE := $(defaultimage-y)
105 $(Q)$(MAKE) $(clean)=$(boot)
107 prepare: include/asm-ppc64/offsets.h
109 arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \
110 include/config/MARKER
112 include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s
113 $(call filechk,gen-asm-offsets)
116 echo '* zImage - Compressed kernel image (arch/$(ARCH)/boot/zImage)'
117 echo ' zImage.initrd- Compressed kernel image with initrd attached,'
118 echo ' sourced from arch/$(ARCH)/boot/ramdisk.image.gz'
119 echo ' (arch/$(ARCH)/boot/zImage.initrd)'
122 CLEAN_FILES += include/asm-ppc64/offsets.h